Loading
Harden token mode against installation properties and run-dir loss
Closes #58 (closed)
Four token-mode gaps, each with a self-test case that goes red when its fix is reverted.
- gcloud reads the SDK installation properties file, which a fresh
CLOUDSDK_CONFIGdoes not hide.prov_token_setupandtoken_env.pynow exportCLOUDSDK_AUTH_IMPERSONATE_SERVICE_ACCOUNT,CLOUDSDK_AUTH_AUTHORITY_SELECTORandCLOUDSDK_AUTH_AUTHORIZATION_TOKEN_FILEas empty strings. Inproperties.pythe environment is checked before the property file and an empty value is notNone, so it wins;transport.pytreats it as unset. A real-gcloud check in token-selftest seedsauth/impersonate_service_accountin a config and shows it reads unset with the empty override. - Each run directory records its owner pid,
prov_token_setuptouches it, and the prune removes only directories whose owner failskill -0(directories with no pid file fall back to the two-day mtime). token_env.pycreates its config directory underSIM_STATE_DIR/token-configand removes it withatexit.- The provider-selftest copy of the gate runs in a temp dir with the new
PROVIDER_GATE_ROOToverride. A second case removes theALLOWEDscan from the copy and expects green, so the test is red only when the scan is gone.
Gates: just word-budget ok at 40489 (ceiling unchanged), just vale-check pass, token-selftest, provider-selftest, preflight-selftest and state-dir-selftest pass.