You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kcc-cache: default TTL for no-expiry credentials + debug mode (#11)
Some credential plugins (e.g. the passman krew plugin) emit an
ExecCredential without a status.expirationTimestamp, which decodes to the
zero time. Such credentials look permanently expired, so they were
re-fetched on every call and never effectively cached despite leaving an
entry in the OS secret store.
When a refreshed credential's expiry is more than
KUBE_CREDENTIAL_CACHE_NO_EXPIRY_THRESHOLD (default 24h) in the past, treat
it as "no expiry provided" and cache it for KUBE_CREDENTIAL_CACHE_DEFAULT_TTL
(default 1h). Genuinely recently-expired credentials still refresh.
Add KUBE_CREDENTIAL_CACHE_DEBUG to log the cache key, backend, hit/miss,
expiry and refresh decisions to stderr (never credential material).
Claude-Session: https://claude.ai/code/session_01XP6Vo1jhL3S96g8hQ76umo
Co-authored-by: Claude <noreply@anthropic.com>
| KUBE_CREDENTIAL_CACHE_DEBUG |_unset_| when set to a truthy value (`1`/`true`/`yes`/`on`), log cache key, hit/miss, expiry and refresh decisions to stderr |
193
+
194
+
#### Credentials without an expiry (default TTL)
195
+
196
+
Some credential plugins (for example the [passman](https://github.com/abenz1267/passman)
197
+
krew plugin) emit an `ExecCredential` with no `status.expirationTimestamp`. That
198
+
decodes to the zero time (`0001-01-01T00:00:00Z`), so the credential looks
199
+
permanently expired and would be re-fetched on **every** call — defeating the
200
+
cache while still leaving an entry in your secret store.
201
+
202
+
To handle this, when a refreshed credential's expiry is more than
203
+
`KUBE_CREDENTIAL_CACHE_NO_EXPIRY_THRESHOLD` (default `24h`) in the past, kcc-cache
204
+
treats it as "no expiry provided" and caches it for
0 commit comments