Skip to content

Log CLI auth token correlation fields#631

Merged
jahooma merged 1 commit intomainfrom
jahooma/add-cli-auth-token-logging
May 9, 2026
Merged

Log CLI auth token correlation fields#631
jahooma merged 1 commit intomainfrom
jahooma/add-cli-auth-token-logging

Conversation

@jahooma
Copy link
Copy Markdown
Contributor

@jahooma jahooma commented May 9, 2026

Summary

  • Add a SHA-256 auth-code hash prefix helper for safe log correlation without recording opaque login tokens.
  • Log issued CLI auth token hash prefixes, token length, fingerprint prefix/length, URL origin, request forwarding headers, configured app URL, and environment in both Codebuff and Freebuff token issuance routes.
  • Extend Freebuff invalid auth-code warnings with the auth-code hash prefix, trimmed length, opaque-token shape, and authenticated user id.

Validation

  • bun test web/src/app/onboard/__tests__/helpers.test.ts freebuff/web/src/app/onboard/__tests__/helpers.test.ts web/src/app/api/auth/cli/code/__tests__/origin.test.ts freebuff/web/src/app/api/auth/cli/code/__tests__/origin.test.ts
  • bunx prettier --check web/src/app/api/auth/cli/code/route.ts web/src/app/onboard/__tests__/helpers.test.ts web/src/app/onboard/_helpers.ts freebuff/web/src/app/api/auth/cli/code/route.ts freebuff/web/src/app/onboard/__tests__/helpers.test.ts freebuff/web/src/app/onboard/_helpers.ts freebuff/web/src/app/onboard/page.tsx
  • bun run typecheck in web/
  • bun run typecheck in freebuff/web/
  • git diff --check

@jahooma jahooma merged commit 77ca87c into main May 9, 2026
35 checks passed
@jahooma jahooma deleted the jahooma/add-cli-auth-token-logging branch May 9, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant