Skip to content

feat: expose BYOK provider-key storage through the public /v1 API - #30

Merged
man4ish merged 1 commit into
mainfrom
feature/m15-public-provider-keys-proxy
Oct 4, 2026
Merged

man4ish merged 1 commit into
mainfrom
feature/m15-public-provider-keys-proxy

Conversation

@man4ish

@man4ish man4ish commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

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 own PUT/GET/DELETE /orgs/{org_id}/provider-keys(/{provider}) -- the exact same forwarded-bearer-token pattern GET /v1/usage already uses for omnibioai-billing (new SERVICE_MAP["auth"]/SERVICE_PERMISSION_MAP["auth"]/V1_SERVICE_MAP["provider-keys"] entries, mirroring the "billing" entry precisely).
  • Storage only -- not provider routing or token metering (the rest of design-audit gap PR12: Enterprise IAM/RBAC end-to-end validation and hardening #4), and never a billable call. Still rate-limited like every other /v1 route.
  • Error mapping: auth-service's 403 (not manage_org) -> forbidden, 404 (no key configured for that provider) -> not_found, 5xx (e.g. CONFIG_ENCRYPTION_KEY unset) -> upstream_error.
  • The real authorization decision stays 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" posture router.py's own comments already establish for every other SERVICE_MAP entry.

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)
  • Full repo suite -- 393 passed

🤖 Generated with Claude Code

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>
@man4ish
man4ish merged commit 8182a0d into main Oct 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant