Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow plugins to set custom patterns for dangerous commands #281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajgray-stripe
Copy link
Contributor

Description

Refactors the is_dangerous_command utility function to move it to a separate module, then adds a method to that module which allows adding custom patterns. Our use case is that we have some internal CLI tooling touching production resourcing that is definitely dangerous, so we'd like to be able to add an invocation to our plugin to flag those commands as requiring human approval.

Testing

  • Added a unit test
  • Verified that adding a pattern works by adding a dummy .* entry from the __init__.py of our custom plugin and seeing a command blocked:

CleanShot 2024-11-19 at 18 12 21

@michaelneale
Copy link
Collaborator

oh I like this idea

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.

2 participants