Skip to content

Bannerbear Detector V2 #4222

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

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

Conversation

shahzadhaider1
Copy link
Contributor

@shahzadhaider1 shahzadhaider1 commented Jun 13, 2025

Description:

This pull request introduces a new V2 detector for Bannerbear API keys. The new version adds support for modern key formats and implements live API verification to eliminate false positives.

Implementation Details

  • New V2 Detector: A new bannerbearv2 detector was created to house the updated logic.
  • Precise Regex: The detector uses the pattern \b(bb_(?:pr|ma)_[a-f0-9]{30})\b to accurately identify both key formats.
  • API Verification: A verification function calls the GET /v2/auth endpoint.
    • A 200 OK response validates a Project API Key.
    • A 400 Bad Request with a specific error message validates a Master API Key, in line with the official API documentation.
  • Keywords: Added bannerbear, bb_pr_, and bb_ma_ to the keyword list for efficient scanning.

Testing

To ensure correctness and reliability, this change includes:

  • Pattern Tests: Tests validating the regex against positive and negative samples.
  • Integration Tests: Live API tests confirming the verification logic for valid Project keys and invalid keys.

Closes OSS-143

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

bannerbear-detector-tests

@shahzadhaider1 shahzadhaider1 requested review from a team as code owners June 13, 2025 13:17
@shahzadhaider1 shahzadhaider1 force-pushed the feat/OSS-143-banner-bear-v2 branch from c87f902 to fdaaacc Compare June 13, 2025 13:20
@shahzadhaider1 shahzadhaider1 force-pushed the feat/OSS-143-banner-bear-v2 branch from fdaaacc to b8285a3 Compare June 13, 2025 13:23
@shahzadhaider1 shahzadhaider1 self-assigned this Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants