Support API key auth alongside the legacy webhook secret - #16
Merged
Conversation
K_API_URL/K_API_KEY/K_PROJECT_ID upload to the tracker's scan.ingest endpoint with a Bearer key. Falls back to K_SARIF_URL/K_SARIF_SECRET when the new trio isn't set, so existing CI configs keep working unmodified.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
K_API_URL+K_API_KEY+K_PROJECT_ID— posts to<base url>/api/v1/scan/ingestwith a Bearer key, matching the tracker's normal API auth. No per-project secret to manage.K_SARIF_URL+K_SARIF_SECRETstill works unchanged when the new trio isn't set — no existing CI config breaks.action.yml: newapi-url/api-key/project-idinputs alongsideurl/secret..github/workflows/scan.yml: new optional secrets, config-check accepts either scheme.templates/gitlab-ci.yml: job-skip rule accepts either scheme.Purely additive — nothing in production changes until a CI config actually sets the new variables.
Test plan
npm test— 30/30 pass (added cases for the newtargetFromEnvbranching and scheme precedence)npm run build(tsc) clean