You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(orb): add a stored tenant-DB-credential secret type + generic revoke path to the token broker (#8064)
Adds ORB_SECRET_TYPE_TENANT_DB_CREDENTIAL to src/orb/broker.ts: a STORED (not
minted) secret type for a credential the caller already has in hand (e.g. a
hosted tenant's Postgres connection string, #7180's provisioning core) rather
than the GitHub-token type's mint-on-exchange shape. issueOrbStoredSecret
encrypts and stores the value at issue time (new secret_value_ciphertext/iv/
salt/version columns, same shape as repositories.ts's BYOK provider-key
storage); brokerOrbToken decrypts and returns it verbatim on exchange, with no
installation-eligibility re-check, cache, or re-mint -- none of which apply to
a value that isn't derived from a GitHub App. installation_id is always NULL
on these rows: an AMS tenant has no GitHub installation at all, and even a
hosted ORB tenant's installation lives in control-plane's own registry
(#7181), not this table's orb_github_installations.
Also adds revokeOrbEnrollment, a generic revoke path that works for ANY
secret type -- brokerOrbToken's existing revoked_at check (since #7174) has
always refused a revoked row, but nothing has ever written to that column
until now. Idempotent: revoking an already-revoked enrollment succeeds
without disturbing its original timestamp.
POST /v1/internal/orb/enrollments gains an optional
{ secretType: "tenant_db_credential", secretValue } body for the new
stored-secret issuance path; POST /v1/internal/orb/enrollments/:enrollId/revoke
is the new admin-facing revoke route. Both sit behind the existing
/v1/internal/* Bearer wall. The GitHub-token type's existing behavior is
completely unchanged -- this is additive.
Broker-side only: control-plane's own injectSecrets/revokeSecrets wiring
against this is #8066, a separate, blocked-on-this sub-issue of #7852.
Closes#8064
// Warn when TOKEN_ENCRYPTION_SECRET is absent — without it, the broker cache is bypassed and every exchange hits
69
134
// GitHub's token endpoint, dramatically increasing exposure to throttle-induced failures.
70
135
if(!env.TOKEN_ENCRYPTION_SECRET){
71
136
console.warn(JSON.stringify({level: "warn",event: "orb_broker_no_encryption_key",message: "TOKEN_ENCRYPTION_SECRET is not set; broker token cache is disabled. Set this variable to enable caching and reduce GitHub throttle risk."}));
72
137
}
73
138
constrow=awaitenv.DB
74
-
.prepare("SELECT enroll_id, installation_id, state, revoked_at, cached_token_json, secret_type FROM orb_enrollments WHERE secret_hash = ?")
console.error(JSON.stringify({level: "error",event: "orb_broker_misconfigured",message: "TOKEN_ENCRYPTION_SECRET is not set, or this enrollment has no stored secret value; the broker cannot serve a stored secret."}));
0 commit comments