Repository navigation
feat: expose BYOK provider-key storage through the public /v1 API - #30
Merged
Merged
Conversation
PUT/GET/DELETE /v1/provider-keys(/{provider}) proxy into
omnibioai-auth's own /orgs/{org_id}/provider-keys(/{provider}) (M14's
storage service), the same forwarded-bearer-token pattern GET /v1/usage
already uses for omnibioai-billing. Storage only, never a billable
call; still rate-limited like every other /v1 route. The real
authorization decision (manage_org) is enforced live by the
destination endpoint itself, not this gateway.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Paired with omnibioai-auth's registry PR -- finishes exposing M14's BYOK provider-key storage through the public API surface.
PUT/GET/DELETE /v1/provider-keys(/{provider})proxy into omnibioai-auth's ownPUT/GET/DELETE /orgs/{org_id}/provider-keys(/{provider})-- the exact same forwarded-bearer-token patternGET /v1/usagealready uses for omnibioai-billing (newSERVICE_MAP["auth"]/SERVICE_PERMISSION_MAP["auth"]/V1_SERVICE_MAP["provider-keys"]entries, mirroring the "billing" entry precisely)./v1route.manage_org) ->forbidden, 404 (no key configured for that provider) ->not_found, 5xx (e.g.CONFIG_ENCRYPTION_KEYunset) ->upstream_error.manage_org, enforced live at the destination -- this gateway adds no new access-control logic of its own, same layered "coarse gate + service-level independent, finer check" posturerouter.py's own comments already establish for every otherSERVICE_MAPentry.Test plan
pytest tests/test_v1_literature.py-- 71 passed (62 existing + 9 new: org-requirement, successful PUT/GET/DELETE forwarding with correct URLs/methods/bodies, 403/404/5xx error mapping, non-JSON body rejection, rate limiting)🤖 Generated with Claude Code