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

[refactor] Nil pointer check and some improvements #11

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

msrexe
Copy link

@msrexe msrexe commented Jun 19, 2024

No description provided.

@ckalpakoglu ckalpakoglu self-requested a review July 23, 2024 09:41
Copy link
Contributor

@ckalpakoglu ckalpakoglu left a comment

Choose a reason for hiding this comment

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

The command parameters should not be marked as required. A better approach would be to check if both parameters are empty, and then throwing an error.

@@ -21,7 +21,9 @@ func initTracerCommand() *cobra.Command {
tracerCMD.Flags().Bool("allow-local-ranges", true, "allows access to local IP ranges")
tracerCMD.Flags().Bool("allow-github-meta", false, "allows access to GitHub meta IP ranges (https://api.github.com/meta)")
tracerCMD.Flags().String("allowed-hosts", "", "enter allowed hostnames (example.com, .github.com)")
tracerCMD.MarkFlagRequired("allowed-hosts")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be marked as required.
The tool can be run in monitor mode.
The allowed IP might have passed.

tracerCMD.Flags().String("allowed-ips", "", "enter allowed IP addresses")
tracerCMD.MarkFlagRequired("allowed-ips")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be marked as required.
The tool can be run in monitor mode.
The allowed Hosts might have passed.

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