Skip to content

auth: propagate OAuth token lifetime - #431

Merged
TylerLeonhardt merged 2 commits into
mainfrom
auth/oauth-token-lifetime
Sep 1, 2026
Merged

auth: propagate OAuth token lifetime#431
TylerLeonhardt merged 2 commits into
mainfrom
auth/oauth-token-lifetime

Conversation

@TylerLeonhardt

Copy link
Copy Markdown
Member

Summary

  • add optional expiresIn to AuthenticateParams using OAuth 2.0 expires_in semantics
  • require positive whole seconds in generated JSON schemas and expose the field in every generated client
  • document remaining-lifetime forwarding and require renewal or reacquisition after an expired challenge

Testing

  • npm run generate
  • npx tsx --test scripts/generate-json-schema.test.ts
  • npm test (445 tests passed, 100% reducer branch coverage)

Add optional expiresIn semantics to authenticate, constrain it to positive whole seconds in generated schemas, and regenerate every language client. Clarify expired credential handling and document the OAuth mapping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Balanced
Findings: None

What changed in this PR

Adds optional OAuth token lifetime propagation to authentication while preserving backward compatibility.

Changes:

  • Adds AuthenticateParams.expiresIn with positive-integer schema constraints.
  • Regenerates all language clients and schemas.
  • Documents token renewal and expiry handling.
File Description
types/​common/​notifications.ts Clarifies expired-token handling.
types/​common/​commands.ts Defines optional expiresIn.
scripts/​generate-json-schema.ts Supports numeric schema constraints.
scripts/​generate-json-schema.test.ts Tests generated lifetime constraints.
schema/​notifications.schema.json Updates authentication guidance.
schema/​errors.schema.json Adds constrained expiresIn.
schema/​commands.schema.json Adds constrained expiresIn.
docs/​specification/​authentication.md Documents lifetime forwarding and renewal.
docs/​.changes/​20260901-authenticate-token-lifetime.json Records the protocol addition.
clients/​swift/​AgentHostProtocol/​Sources/​AgentHostProtocol/​Generated/​Notifications.generated.swift Updates expiry documentation.
clients/​swift/​AgentHostProtocol/​Sources/​AgentHostProtocol/​Generated/​Commands.generated.swift Exposes expiresIn.
clients/​rust/​crates/​ahp-types/​src/​notifications.rs Updates expiry documentation.
clients/​rust/​crates/​ahp-types/​src/​commands.rs Exposes expires_in.
clients/​kotlin/​src/​main/​kotlin/​com/​microsoft/​agenthostprotocol/​generated/​Notifications.generated.kt Updates expiry documentation.
clients/​kotlin/​src/​main/​kotlin/​com/​microsoft/​agenthostprotocol/​generated/​Commands.generated.kt Exposes expiresIn.
clients/​go/​ahptypes/​notifications.generated.go Updates expiry documentation.
clients/​go/​ahptypes/​commands.generated.go Exposes ExpiresIn.
clients/​dotnet/​src/​AgentHostProtocol.Abstractions/​Generated/​Notifications.generated.cs Updates expiry documentation.
clients/​dotnet/​src/​AgentHostProtocol.Abstractions/​Generated/​Commands.generated.cs Exposes ExpiresIn.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread types/common/commands.ts Outdated
Use an explicit @integer schema annotation for expiresIn while retaining the positive minimum constraint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TylerLeonhardt
TylerLeonhardt marked this pull request as ready for review September 1, 2026 18:50
@TylerLeonhardt
TylerLeonhardt enabled auto-merge (squash) September 1, 2026 18:50
@TylerLeonhardt
TylerLeonhardt merged commit fd0471d into main Sep 1, 2026
9 checks passed
@TylerLeonhardt
TylerLeonhardt deleted the auth/oauth-token-lifetime branch September 1, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants