git-remote-entire: trim surrounding whitespace from ENTIRE_TOKEN

main

Commit

Soph3mo ago

A token sourced via $(cat token) or a here-doc commonly carries a trailing newline; previously that padded-but-valid token failed at JWT parse (and the newline would also be POSTed verbatim to /oauth/token). Trim the value inside the env-token path so both aud-derivation and the exchanged subject_token use the cleaned token.

Whitespace-only is unchanged: it still enters the env path (raw != "" at the caller) and fails closed with "ENTIRE_TOKEN is set but blank" — it never falls back to context auth. Only a truly empty/unset ENTIRE_TOKEN is treated as unset.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 7feccbc0b808

Checkpoints

ENTIRE_TOKEN Security and Validation Fixes

Claude Code
View session
Checkpoint 1