Expand description
OAuth token-file probing: the oauth_status canonical-value
constants, OAuthProbeStatus, and probe_oauth_status itself.
Split out of the single ~2193-line resolver.rs (pure relocation, no
behavior change) — self-contained, on-disk OAuth token-file probing
with no dependency on the rest of the resolver module.
Modules§
- oauth_
status - Canonical-value enumeration for OAuth-class
IdentityAccount.status.
Enums§
- OAuth
Probe Status - Result of probing a per-bundle OAuth token directory.
Constants§
- MAX_
SIGN_ IN_ VALUE - The longest sign-in value that is withheld (bytes). A file a container can write could hold a value so large that the matcher of every withheld value no longer builds, so a longer one is not withheld.
Functions§
- claude_
token_ expiry_ ms - When the access token in a Claude config dir’s
.credentials.jsonexpires (unix ms), orNonewhen the file is missing, unreadable or has no expiry. A token that expired before a turn failed on “OAuth access token has expired” cannot be the one that is there now if this reads later. - probe_
oauth_ status - Cheap on-disk probe of the per-bundle OAuth token file for a
provider. No network calls — just reads + parses the token JSON,
then compares
expiresAtagainstnow_ms. - release_
sign_ in - Stops withholding every value read from the sign-in files under config dir
dir: the account that owned the directory is deleted, and its credentials with it. - sign_
in_ file - The file
probe_oauth_statusreads the sign-in ofproviderfrom under config dirdir, orNonefor a provider it does not read a file for. - withhold_
sign_ in - Keeps the tokens in a sign-in file just read out of every transcript: the CLI reads the file itself and renews both
tokens while an agent runs, so each look at the file holds what is there now. An access token is withheld until
its own expiry, even after a renewed one is in the file (the old one still works); a value with no known expiry
stays withheld after the file holds another (up to
withhold::KEPT_PER_OWNERper owner). A look that finds no token (a sign-out) leaves what was held.