Uh oh!
There was an error while loading. Please reload this page.
docs(protocol): correct the X-API-Key example to the real osk_ prefix - #8733
Merged
Conversation
The HTTP protocol page showed a Stripe-shaped `sk_live_abc123...` placeholder. ObjectStack keys are `osk_`-prefixed (API_KEY_PREFIX, core/src/security/api-key.ts) and the prefix is load-bearing: extractApiKey accepts an Authorization: Bearer token only when it starts with osk_, which is what stops a session Bearer being read as an API key. Also states why the prefix matters, since the surrounding prose was silent. Part of #8715 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5tUwGM3LQoqErTfkvRW7W
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-zhuang
marked this pull request as ready for review
August 14, 2026 16:44
os-zhuang
enabled auto-merge
August 14, 2026 16:44
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Part of #8715
Carries only §2 of the card. §1 is escalated, not implemented — it is not the
docs correction the card assumed, and the reason is measured below. Deliberately
Part ofrather than a closing keyword: this PR does not finish #8715, whose main half sits in the
decision box. (Wording note: an earlier draft of this line used a bare closing keyword in
a negated sentence — GitHub's parser ignores the negation, so
Part-of PR must not also close its cardcorrectly refused it. Reworded, not re-argued.)What changed (§2 — the
osk_prefix)content/docs/protocol/kernel/http-protocol.mdxshowed a Stripe-shapedsk_live_abc123...value in theX-API-Keyexample. Corrected toosk_abc123..., andsince the surrounding prose was silent on the prefix, added a short paragraph saying why
it is load-bearing.
Traceable to source:
API_KEY_PREFIX = 'osk_'andextractApiKeyinpackages/core/src/security/api-key.ts, whose own comment states the mechanism — Beareris accepted only for prefixed api-keys, never for session tokens, because a better-auth
session token never starts with
osk_.Swept
content/docs/**forsk_live/sk_test/pk_live/os_pk_as #8717 asks.Two other hits are correct as written and were left alone:
automation/connectors.mdx(an OUTBOUND bearer token for a third-party API) and
protocol/kernel/config-resolution.mdx(
OS_CRM_API_KEY, a third-party CRM credential). Neither is an ObjectStack inbound key.#8717 is the split-out card for this same example and remains open — the PM decides
whether it is served by this PR or should carry its own.
Why §1 is not in this PR
The card asks for the
ApiKeyreference table to be rebuilt from the realsys_api_keycolumn set. Three findings say that cannot be a docs change:
The page is generated.
content/docs/references/identity/identity.mdxcarries theAUTO-GENERATED — DO NOT EDITbanner and names its source,packages/spec/src/identity/identity.zod.ts. Hand-editing it is barred and would beundone by the next
gen:docs. The table is a faithful rendering ofApiKeySchema,which really does declare
start,lastRefetchAt,enabled,rateLimitEnabled,rateLimitTimeWindow,rateLimitMax,remaining,permissions,metadata,organizationId. The doc is not the defect; the schema is.Fixing the schema is an ADR-0049 retirement, not a JSDoc edit. All 19
identity/ApiKey:*keys are inpackages/spec/authorable-surface.base.json. Removingten of them needs the ADR-0087 conversion plus the exact-key
RETIRED_KEYS_BY_MAJORentry, the liveness ledger, regenerated baselines, forms, i18n, pin tests and a
major changeset for
@objectstack/spec. That is the opposite of this card's statedskip-changeset, docs-only disposition.The card's prescribed replacement column set is ahead of
main. It listsactive_organization_id, whichsys_api_keydoes not have onmain—packages/platform-objects/src/identity/sys-api-key.object.tsdeclares no such field,and
resolveApiKeyPrincipalstill readsrow.organization_id ?? row.organizationId.The column arrives with PR fix(identity): API keys are minted against the minter's active organization (#8287) #8709, still an open draft. Documenting it today would
re-commit the same PD chore: version packages #10 sin the card was filed about.
The real column set on
main, each traceable tosys-api-key.object.ts:name, prefix, user_id, scopes, expires_at, last_used_at, revoked, key, id, created_at, updated_at— eleven, not the card's twelve.There is also a disposition question the dev seat should not settle alone:
ApiKeySchemahas zero consumers anywhere in the monorepo (only its own test, the export-surface
snapshots and this generated page), so "delete it and let the platform object be the one
declaration" is a live alternative to rebuilding it. Full analysis in the report on #8715.
Verification
Gate union run after the final commit, at
f82c72acd, all PASS:check:nul-bytes·check:doc-authoring·check:doc-anchors·check:docs-audit-scope·
check:role-word·check:adr-links·check:empty-changeset·check:changeset-gate-self-testsRe-derived against the actual changed path with
scripts/pm/dispatch-gates.mjs, whichsurfaced
check:role-word— a family the dispatch prompt did not name. The prompt alsonamed
check:doc-formula-expressions, which exists as no script in the rootpackage.json.check:generatedis not implicated: no generated artifact moved, becausethe generated page is untouched.
check:doc-anchorsfailed on the first pass purely for a missinggithub-slugger— theworktree had no
pnpm installyet. It passes after installing.Docs-only prose, releases nothing, so no changeset and the
skip-changesetlabel;check:empty-changesetpasses on this diff in that shape.Generated by Claude Code