-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add api key support #1660
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
add api key support #1660
Conversation
WalkthroughThe AlienVault subscraping source now supports API key authentication. The implementation adds API key storage, random key selection during execution, bearer token authorization headers, and a skipped state when keys are unavailable. The public AddApiKeys method signature was updated to accept and store provided keys. Changes
Sequence DiagramsequenceDiagram
participant Caller
participant Run as Run Method
participant ApiKeyMgmt as API Key Management
participant HttpClient as HTTP Client
participant Target as AlienVault API
Caller->>Run: Execute
Run->>ApiKeyMgmt: Check apiKeys available?
alt No API Keys
ApiKeyMgmt-->>Run: None available
Run->>Run: Set skipped=true
Run-->>Caller: Return with Skipped state
else API Keys Available
ApiKeyMgmt-->>Run: Select random key
Run->>HttpClient: Get (with Authorization header)
HttpClient->>Target: Request + Bearer Token
Target-->>HttpClient: Response
HttpClient-->>Run: Return data
Run-->>Caller: Return with results
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Single-file change with straightforward authentication logic, random key selection, and state management. The pattern is clear and localized to one source, though the public API signature change warrants verification of call sites. Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)pkg/subscraping/sources/alienvault/alienvault.go (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (6)
Comment |
closes #1659
Summary by CodeRabbit