Repository navigation
Replies: 1 comment
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What
Platform-API's publishing calls to the API Portal admin REST APIs (publish / update / delete API, API content, MCP Server, MCP Server content, Subscription Plan) authenticate with a shared secret — a 256-bit random key.
sha256(key).Authorization: SharedKey <raw>— a custom auth scheme (RFC 7235), not the OAuth 2.0Bearerscheme.Covers only Platform-API's S2S publishing path. Consumer login (portal UI) is untouched — shared-key middleware is additive and scoped to specific admin handlers.
Flow
Changes
API Portal
portals/scripts/setup.sh— same shape as the existingencryption_key/session_secretgeneration:openssl rand -hex 32, write hash and raw to separate files, idempotent (skip if hash file exists). New flags:--force,--rotate-internal-key.portals/api-portal/configs/config.toml:compose()utility — same scoping pattern already used for CSRF middleware. Middleware dispatches byAuthorizationscheme name:SharedKey→ hash + constant-time compare, synthesiseplatform-api-systemprincipal on match;Bearer→ fall through to the existing OAuth verifier; anything else → 401. UI / login routes live on separate page routers, automatically unaffected. There is no URL-prefix split between admin and consumer routes today — scoping must be per-handler, not per-route.Platform-API
internal_auth_secret BYTEAcolumn onapi_portals, holding the encrypted raw. Reuses the existing at-rest encryption key path platform-api already uses for other credentials. No per-portalauth_typecolumn — shared-key is the only S2S mechanism.POST /api-portals:sharedKey: "<raw>"required in the request body (hex string, 64 chars). Response never echoes it.PUT /api-portals/{id}:sharedKeyoptional; if present, replaces the stored value (rotation path).GETendpoints: never return key material.Rotation
Customer-driven. No dedicated endpoint.
portals/scripts/setup.sh --rotate-internal-key→ new raw + hash.PUT /api-portals/{id}with the newsharedKey.rmthe raw file.Between (2) and (3) Platform-API's publishing calls with the old raw will 401. Order matters: rotate the API Portal first, then update Platform-API, then delete the file.
All reactions