fix(api): report effective OAuth metadata availability - #60
Closed
GuGuLiuSandao wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Superseded by #61, recreated from the correct GitHub account. |
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.
What changed
oauthEnabled: trueonly when the Agent publishes OAuth and the platform OAuth channel is configuredisOauthChannelConfigured()gate, including the enterprise OIDC configuration and non-empty channel audience requirementWhy
Previously,
/api/public/agents/metadataderivedoauthEnabledonly from the Agent's publish-channel list. It could therefore advertise OAuth as enabled while every invocation returned503 OAUTH_NOT_CONFIGUREDbecause the platform had no usable enterprise OIDC/audience configuration.External consumers only need one answer: whether the Agent currently exposes a usable OAuth channel. The existing field now provides that answer without adding another public state field.
Impact
For published Agents whose OAuth switch is on but whose platform OAuth verification is not configured,
oauthEnabledchanges fromtruetofalse. No response shape or field name changes.Validation
pnpm --filter @a2wave/api test -- src/routes/__tests__/public-metadata.test.ts src/lib/__tests__/oauth-channel-verify.test.tspnpm --filter @a2wave/api typecheckpnpm --filter @a2wave/web typecheckpnpm lint