Context and Request
GitHub is rolling out a new token format for GitHub App installation tokens. The new format is a stateless JWT (ghs_-prefixed, ~520 characters, containing two dots) replacing the current short opaque string format.
A developer using the PSModule/GitHub module to authenticate via GitHub App installation tokens needs confidence that the module handles both the current stateful (opaque) format and the incoming stateless (JWT) format without errors or data loss.
Today the module already supports ghs_-prefixed installation tokens (resolved in #83), but any assumptions about token length, structure, or validation patterns may break when GitHub begins returning the longer JWT-format tokens.
Acceptance criteria
Technical Decisions
Validation pattern: Use the regex ghs_[A-Za-z0-9\._]{36,} as recommended by GitHub. This handles both the short opaque tokens and the new JWT tokens.
No token introspection: Tokens are treated as opaque strings regardless of internal structure. No parsing of the JWT payload.
Opt-in testing header: During development, use the X-GitHub-Stateless-S2S-Token: enabled request header on POST /app/installations/:installation_id/access_tokens to force the new format and validate compatibility. Remove the header before merging.
Implementation Plan
Audit
Fix
Test
References
Context and Request
GitHub is rolling out a new token format for GitHub App installation tokens. The new format is a stateless JWT (
ghs_-prefixed, ~520 characters, containing two dots) replacing the current short opaque string format.A developer using the PSModule/GitHub module to authenticate via GitHub App installation tokens needs confidence that the module handles both the current stateful (opaque) format and the incoming stateless (JWT) format without errors or data loss.
Today the module already supports
ghs_-prefixed installation tokens (resolved in #83), but any assumptions about token length, structure, or validation patterns may break when GitHub begins returning the longer JWT-format tokens.Acceptance criteria
ghs_[A-Za-z0-9\._]{36,}).POST /app/installations/:installation_id/access_tokens.Technical Decisions
Validation pattern: Use the regex
ghs_[A-Za-z0-9\._]{36,}as recommended by GitHub. This handles both the short opaque tokens and the new JWT tokens.No token introspection: Tokens are treated as opaque strings regardless of internal structure. No parsing of the JWT payload.
Opt-in testing header: During development, use the
X-GitHub-Stateless-S2S-Token: enabledrequest header onPOST /app/installations/:installation_id/access_tokensto force the new format and validate compatibility. Remove the header before merging.Implementation Plan
Audit
ghs_tokens.Fix
ghs_[A-Za-z0-9\._]{36,}.Test
ghs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) and a long JWT-format token (ghs_<header>.<payload>.<signature>~520 chars) through the authentication path.X-GitHub-Stateless-S2S-Token: enabledheader against a real GitHub App installation.References