-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Guard cloud service #6053
Guard cloud service #6053
Conversation
WalkthroughThe changes introduce a new conditional block in the main application entry point that checks if the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cmd/nuclei/main.go (1)
530-538
: LGTM with minor suggestions!The credential check is well-implemented with clear user guidance. Consider two improvements:
- Use a non-zero exit code (e.g., 1) to indicate a configuration error
- Extract the warning message to a constant for reusability
Apply this diff to improve the implementation:
+const ( + errMissingAPIKey = "[%v] To utilize the `-ai` flag, please configure your API key with the `-auth` flag or set the `PDCP_API_KEY` environment variable" +) if options.AITemplatePrompt != "" { h := &pdcp.PDCPCredHandler{} _, err := h.GetCreds() if err != nil { - gologger.Print().Msgf("%s", fmt.Sprintf("[%v] To utilize the `-ai` flag, please configure your API key with the `-auth` flag or set the `PDCP_API_KEY` environment variable", aurora.NewAurora(!options.NoColor).BrightYellow("WRN"))) - os.Exit(0) + gologger.Print().Msgf("%s", fmt.Sprintf(errMissingAPIKey, aurora.NewAurora(!options.NoColor).BrightYellow("WRN"))) + os.Exit(1) } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmd/nuclei/main.go
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Lint
🔇 Additional comments (1)
cmd/nuclei/main.go (1)
16-16
: LGTM!The aurora package is appropriately imported for colored console output.
I think this should return a fatal error instead of just a warning and exit with a code >0. |
@dwisiswant0 Absolutely! I was attempting to make modifications in the library and chose to do them here; I probably left things unchanged after the copy/paste 🤦♂️ Good catch! |
Proposed changes
Closes #6050
in case of empty or missing creds:
Checklist
Summary by CodeRabbit