[Candidate Intake] Upstream PR #224 - feat(api-keys): add per-API-key model allowlist filtering#6
Draft
[Candidate Intake] Upstream PR #224 - feat(api-keys): add per-API-key model allowlist filtering#6
Conversation
Implement fine-grained access control by allowing API keys to restrict which models they can access via pattern matching. Features: - Pattern matching: exact (gh/gpt-5.1), wildcard (gh/*), multiple patterns - Database schema: allowedModels array with auto-migration - API validation: 403 when model denied, backward compatible (empty = unrestricted) - REST API: CRUD operations for managing allowedModels - Dashboard UI: visual pattern selector with quick-add buttons - Comprehensive tests: 17/17 passing, 95.23% coverage Implementation Details: - src/shared/utils/model-pattern-matcher.js: Core pattern matching logic - src/shared/components/AllowedModelsInput.js: Dashboard UI component - src/lib/localDb.js: Schema migration and validation - src/sse/services/auth.js: Model validation in authentication - src/app/api/keys/*: REST endpoints for allowedModels CRUD Breaking Changes: None (backward compatible)
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.
Context
This draft PR mirrors upstream branch 'upstream-prs/pr-224' into 'master' for review, provenance, and later decision-making only.
It must not be merged wholesale. If we adopt anything from it, the intended path is commit-level intake only.
Upstream Source
Current Intake Recommendation
Selected Commits For Any Future Intake
89830a0feat(api-keys): add per-API-key model allowlist filteringSkipped / Excluded Scope
Acceptance Gates
Verification / Validation Checklist
allowedModelssafely.Review Focus
allowedModelsNotes