Signpost src/auth and disambiguate two colliding type names#478
Merged
Conversation
Add src/auth/README.md mapping the subsystem on its central distinction: the top level is this server acting as an OAuth client to a wiki, while authorizationServer/ is this server acting as an authorization server (the hosted proxy). AGENTS.md gains a src/auth entry pointing to it; its transport line drops the now-moved request context and the runtime line gains it. Rename two names that read as collisions: - metadata.ts AsMetadata -> UpstreamAsMetadata. It is an upstream wiki's AS metadata, distinct from authorizationServer/asMetadata.ts's AsMetadataDoc (the metadata this server serves about itself). A comment now states the contrast. - proxyConfig.ts's local WikiSlice -> ProxyWikiInput, so the exported WikiSlice in metadata.ts is the only type by that name. Different shape, different concern; the two never met at an import. Pure rename plus docs; no behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review caught one-liners that pointed a reader at the wrong file: - consent.ts renders pages and handles cookies; the consent cookie is signed and verified in jwt.ts, so credit jwt.ts for it. - redirectPolicy.ts holds a redirect-URI allowlist, not a host allowlist; the CIMD host allowlist is in cimd.ts. - pageShell.ts also renders the stdio loopback login pages, so it is shared between both roles, not just the proxy consent flow. - paths.ts resolves two files (client credentials and the proxy store), not a single credential directory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
oxfmt normalizes markdown emphasis to underscores; the prior commit's `*host*` tripped fmt:check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alistair3149
marked this pull request as ready for review
July 23, 2026 15:01
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.
Pure docs + renames, no behaviour change.
README
New
src/auth/README.mdmaps the subsystem on its central distinction, which is easy to miss when reading the files cold:src/auth/(top level) — this server acting as an OAuth client to a wiki (discover, log in, acquire/refresh/store a token).src/auth/authorizationServer/— this server acting as an OAuth authorization server: the hosted proxy that mints its own per-user tokens and speaks the full authorize / consent / callback / token / registration surface.Each file gets a one-line role.
AGENTS.mdgains asrc/authrepo-layout entry pointing to it; while there, itstransportline drops the request context that #476 moved toruntime/, and theruntimeline gains it.Renames
Two names read as collisions:
AsMetadata→UpstreamAsMetadata(metadata.ts). It is an upstream wiki's AS metadata, distinct fromauthorizationServer/asMetadata.ts'sAsMetadataDoc(the metadata this server serves about itself as the proxy). "upstream" matches the vocabulary already used for the wiki throughout the proxy code. A comment now states the contrast.WikiSlice(local, inproxyConfig.ts) →ProxyWikiInput. There were twointerface WikiSlice— the exported one inmetadata.ts(client discovery) and a separate local one inproxyConfig.ts(proxy resolution). Different shape, different concern, and they never met at an import, so it was reader-confusion rather than a type bug. Renaming the local one leaves the exportedWikiSliceas the only type by that name.Testing
Renames are reference-complete (a missed site fails
tsc). Verified:tsc, 1572 tests, oxlint, oxfmt, build — all green. TheAsMetadata → UpstreamAsMetadatarewrite used a word-boundary match so it could not touchAsMetadataDoc/buildAsMetadata; confirmed no mangling.Pure-internal refactor + docs: no tool surface or user-visible behaviour change, so no top-level README / CHANGELOG entry per repo policy.
🤖 Generated with Claude Code