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

Allow configuration via command-line options #41

Merged
merged 10 commits into from
Dec 11, 2024
Merged

Conversation

ikretz
Copy link
Collaborator

@ikretz ikretz commented Dec 10, 2024

This PR adds command-line options to the scfw configure subcommand so that users may configure the command non-interactively via scripting.

usage: scfw configure [-h] [--alias-pip] [--alias-npm] [--dd-api-key KEY] [--dd-log-level LEVEL]

Configure the environment for using Supply-Chain Firewall.

options:
  -h, --help            show this help message and exit
  --alias-pip           Add shell aliases to always run pip commands through Supply-Chain Firewall
  --alias-npm           Add shell aliases to always run npm commands through Supply-Chain Firewall
  --dd-api-key KEY      API key to use when forwarding logs to Datadog
  --dd-log-level LEVEL  Desired logging level for Datadog log forwarding (options: ALLOW, ABORT, BLOCK)

If no command-line options are present, the interactive script runs as it did previously. Otherwise, the command-line configuration is used and no output is printed.

The PR also performs various small refactoring.

@ikretz ikretz marked this pull request as ready for review December 10, 2024 14:58
Copy link
Contributor

@sobregosodd sobregosodd left a comment

Choose a reason for hiding this comment

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

LGTM

scfw/commands/__init__.py Show resolved Hide resolved
@ikretz ikretz merged commit 10bd2b9 into main Dec 11, 2024
76 checks passed
@ikretz ikretz deleted the ikretz/configure-cli branch December 11, 2024 15:37
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