feat(observability): Linear OAuth token-lineage logging for revocation investigation
Maintainers usually reply within 1 day
@isadeks is already working on this.
Since Aug 27, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
Add resolver-local diagnostic logging to the Linear OAuth refresh path
(cdk/src/handlers/shared/linear-oauth-resolver.ts) so we can investigate a recurring
per-workspace grant revocation. Additive observability only — no behavior change to the refresh
or persist logic.
Motivation
One Linear workspace's OAuth grant is being revoked ~25h after each (re-)onboard: the platform's
refresh returns invalid_grant / "Refresh token revoked". A second workspace on the identical code
path is durable, so the refresh code itself is sound (verified: the rotated refresh_token is
persisted on success). The cause is upstream/app-side, but today's logs can't reconstruct the
token's lifecycle to prove what Linear is rejecting — we can't distinguish "a spent/rotated token
was replayed" from "a live grant was killed server-side," nor correlate a failure to the token we
last persisted, nor see the token's age at death.
Proposed logging (resolver-local, one file)
Threaded through refreshLinearToken / tryRefreshOnce / the persist path:
- Refresh-token fingerprint —
sha256(refresh_token).slice(0,12), logged on every refresh
outcome. Identifies which token across events; the raw token is never logged. - Token age —
token_age_h(now −installed_at) andsince_last_refresh_h
(now −updated_at) on each outcome. Both fields already exist on the stored bundle; no schema
change. - Rotation trail — on successful persist, log
rotated <oldFp> → <newFp>, so the next
failure can be correlated to the token we just wrote (server-side kill vs stale/race). - Revocation forensics line — at "permanently rejected," one structured line:
{workspace_id, refresh_token_fp, token_age_h, since_last_refresh_h, installed_at, updated_at}.
Non-goals
- No change to refresh/persist behavior, cache, or the
invalid_grantre-read/race handling. - No trigger/caller threading into other handlers (kept resolver-local to bound blast radius on a
security-sensitive credential file; can follow up if the fingerprint+age data proves insufficient). - Never log token material — fingerprints (truncated sha256) only.
Acceptance criteria
- Every refresh outcome (success,
invalid_grant, failure, permanently-rejected) logs the
refresh-token fingerprint +token_age_h+since_last_refresh_h. - Successful persist logs the old→new fingerprint rotation.
- No raw token/secret value appears in any log (verified against the masking gate).
- No behavior change: existing resolver tests pass unchanged; new tests assert the fingerprint
is a truncated hash and never the raw token.
Security / priority
Diagnostic-only, additive; touches a credential path so reviewed accordingly (masking gate). Suggest
P1 — it unblocks an active, recurring auth outage investigation.
- Dominant language
- TypeScript
- Stars
- 151
- Forks
- 48
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 23
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws-samples/sample-autonomous-cloud-coding-agents
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws-samples/sample-autonomous-cloud-coding-agents#908 ·
Maintainers usually reply within 1 day
-
bug v1
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws-samples/sample-autonomous-cloud-coding-agents#886 ·
Maintainers usually reply within 1 day
-
bug v1
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
aws-samples/sample-autonomous-cloud-coding-agents#861 ·
Maintainers usually reply within 1 day
-
documentation P2 security
Difficulty 2/5 1-2 days Newbie friendliness 74/100
aws-samples/sample-autonomous-cloud-coding-agents#793 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws-samples/sample-autonomous-cloud-coding-agents#767 · 2 comments ·
Maintainers usually reply within 1 day
All issues in aws-samples/sample-autonomous-cloud-coding-agents
Similar issues
-
resources
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
railmapgen/rmg-palette#2445 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
danielmiessler/LifeOS#2242 ·
Maintainers usually reply within 5 days
-
good first issue hacktoberfest help wanted translation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/appduct#129 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100