Skip to content

Add user defined callback to be called on every shell execution#13

Open
igcybers wants to merge 2 commits intodjk2:masterfrom
cyber-smart:master
Open

Add user defined callback to be called on every shell execution#13
igcybers wants to merge 2 commits intodjk2:masterfrom
cyber-smart:master

Conversation

@igcybers
Copy link
Copy Markdown

Adds a user defined callback option which can be defined in settings.
This function will be called after every execution.

It helps with audit, e.g. saving all users executions into a database.

Copy link
Copy Markdown
Owner

@djk2 djk2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi
Great thanks for extension of my lib.
What you prepared look good.
Nice idea to add callback - it could be very handy.

I have small request, if you could:

  • add info to CHANGELOG.md
  • upgrade version from VERSION = (2, 0, 1) =>VERSION = (2, 1, 0)

ctx['auto_import'] = str(self.runner.importer)
return ctx

def call_callback(self, request, response, code) -> None:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you could add some docstring will be nice.

@samiashi
Copy link
Copy Markdown

samiashi commented Mar 9, 2026

This feature has now been cherry-picked into #14 and adapted on top of the current upgrade branch, including the requested changelog/version follow-up in the current 3.0.0 line. #14 now supersedes this PR, so this one can be closed once #14 is accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants