feat: extract mintcore shared library with JWKSVerifier and status endpoint#1783
feat: extract mintcore shared library with JWKSVerifier and status endpoint#1783ggallen wants to merge 2 commits into
Conversation
Site previewPreview: https://60b304bd-site.fullsend-ai.workers.dev Commit: |
Review — PR #1783Outcome: ✅ Approve Change summary: Extracts shared OIDC verification, STS token exchange, claims validation, and GitHub API helpers from Resolved prior findings
Findings
Notes
Previous runPrior review evaluated commit 4c2e750. Previous runReviewFindingsMedium
Low
Info
Previous run (2)ReviewFindingsMedium
Low
Previous run (3)ReviewFindingsMedium
Low
Info
Previous run (4)ReviewFindingsMedium
Low
Info
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)ReviewFindingsLow
Info
Previous run (7)ReviewFindingsLow
Info
Previous run (8)ReviewFindingsMedium
Low
Info
Previous run (9)ReviewFindingsMedium
Low
Info
Previous run (10)ReviewFindingsMedium
Low
Previous run (11)ReviewFindingsMedium
Low
Info
Previous run (12)ReviewFindingsMedium
Low
Info
Previous run (13)ReviewFindingsMedium
Low
|
9806077 to
e5a32f6
Compare
waynesun09
left a comment
There was a problem hiding this comment.
Review Squad Report — 7 agents, 11 findings (MEDIUM+)
Agents: 2x claude-coder, 2x claude-researcher, 2x gemini-code-review, 1x cursor-code-review
Total findings: 21 (after dedup and false positive removal) — 3 HIGH, 8 MEDIUM, 7 LOW, 3 INFO
False positives removed: 5
Summary
The STSVerifier extraction is faithful — identical validation logic, error messages, and control flow preserved. The most actionable finding is the JWKSVerifier fail-open design on empty allowlists (3-agent consensus), which creates a security asymmetry with STSVerifier that should be fixed before devmint uses it. The status endpoint App ID exposure (4-agent consensus) and duplicate BuildRepoProviderID are cleanup items to address in this PR. Four deleted test suites covering security-relevant edge cases should be restored in mintcore.
Only MEDIUM+ findings are posted inline. 7 LOW and 3 INFO findings available on request.
e5a32f6 to
fc4843d
Compare
|
All findings from both review sources have been addressed in From review #4411014072 (8 inline comments): All fixed and threads resolved. From issue comment #4603468794:
|
fc4843d to
60e46b1
Compare
60e46b1 to
9f4015b
Compare
9f4015b to
a2ed9bb
Compare
a2ed9bb to
6d173b4
Compare
6d173b4 to
2e7eb18
Compare
2e7eb18 to
5630f86
Compare
5630f86 to
808b21e
Compare
Extract shared types, validation, and GitHub API helpers from the monolithic mint Cloud Function into a reusable mintcore module. The GCP mint now imports mintcore for claims validation, JWT generation, and installation token creation. Signed-off-by: Greg Allen <gallen@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
808b21e to
4c2e750
Compare
waynesun09
left a comment
There was a problem hiding this comment.
All 11 HIGH/MEDIUM findings from the prior review round are resolved. The update is thorough — JWKSVerifier is now fail-closed, status endpoint is org-scoped with no App ID exposure, singleflight coalesces JWKS refreshes, routing is correct, and all test gaps were restored.
Two minor items for follow-up (non-blocking):
STSVerifierOptions.AllowedWorkflows→AllowedWorkflowFilesfor consistency withJWKSVerifierOptions- Add
TestSTSVerifier_MissingIat,TestSTSVerifier_FutureToken,TestSTSVerifier_MissingRepositoryto match JWKS verifier test coverage
…on tests Address review findings from PR fullsend-ai#1783: Medium: - Add issuer mismatch check in discoverJWKSURI per OIDC Discovery spec Section 4.3: verify doc.Issuer == expected issuerURL before trusting the discovery document. Applied to both mintcore and .embed. - Add 5 handler-level integration tests restoring end-to-end coverage for scenarios removed during mintcore extraction: - Upstream workflow ref acceptance through ServeHTTP - Per-repo cross-repo ref rejection - Non-workflow path rejection - Unregistered per-repo WIF repo rejection - Per-repo mixed-case matching Low findings verified as already addressed: - getKey already uses RLock on the hot path (line 195) - addDirToZip already has symlink detection (line 1756) - /v1/status data-exposure is documented as intentional Signed-off-by: Greg Allen <gallen@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
Response to review findings (head SHA
|
Summary
Extract shared types and functions from
internal/mint/main.gointo a newinternal/mintcore/Go module, then refactor the GCP mint to import from it. This PR also introduces new features alongside the refactoring.This is the first half of #1751, split to isolate the production-risk changes for focused review.
New features
RolePermissionsis now a function returning a deep copy, preventing accidental mutation of the canonical permission mapWhat moved to mintcore
JWKSVerifier(new) andSTSVerifier(extracted from GCP mint)ValidateOrgAllowed,ValidateWorkflowRef)GenerateAppJWT,FindInstallation,CreateInstallationToken)GitHubOrgPattern,RepoNamePattern,RolePattern)BuildRepoProviderID)What changed in the GCP mint
main.gonow imports frommintcoreinstead of defining types/functions inlineSTSVerifierreplaces inlinestsTokenValidator(same logic, just relocated)NewHandlerconstructs the verifier internally/v1/statusendpoint added for mint health inspection (authenticated)Provisioner / Cloud Function deployment
mintcore/source alongside the mint function in the deployment zipgo.modreplace directive rewritten from../mintcoreto./mintcoreduring zip creation.embedfiles for mintcore (synced from source, including go.sum)Review focus
STSVerifierextraction faithful — same logic, no behavioral changes?bundleFunctionSourcecorrectly nest mintcore in the deployment zip?JWKSVerifiercorrectly validate org allowlist and workflow refs?Test plan
go test ./internal/mintcore/...— all tests pass (including new JWKSVerifier validation tests)go test ./internal/mint/...— all tests pass (including new STSVerifier integration test)go test ./internal/dispatch/gcf/...— provisioner tests pass (including embed sync)go vet ./...— clean🤖 Generated with Claude Code