Skip to content

feat(developer): last used display on API keys - #25

Merged
Zingzy merged 1 commit into
mainfrom
feat/keys-last-used
Jul 22, 2026
Merged

feat(developer): last used display on API keys#25
Zingzy merged 1 commit into
mainfrom
feat/keys-last-used

Conversation

@Zingzy

@Zingzy Zingzy commented Jul 22, 2026

Copy link
Copy Markdown
Member

Shows when each API key last authenticated a request, so you can tell whether a key is safe to revoke.

The keys page now reads the last_used_at field from GET /api/v1/keys (Unix seconds, normalized to ISO in the client) and renders it in the key metadata row as relative time, next to created. Keys that have never been used render as never used. The mock backend serves the field too and seeds a never-used key, so the row is verifiable in walkthrough mode.

Pairs with the merged backend change in spoo-me/spoo#266. Until that deploys, every key reads null on the wire and renders as never used, which is correct.

Read last_used_at from GET /api/v1/keys and show it per key as
relative time next to created; null renders as never used. Mock
now serves the field and seeds a never-used key so the row is
verifiable in walkthrough mode.
Copilot AI review requested due to automatic review settings July 22, 2026 15:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Zingzy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 329df85e-daf7-47d1-9d6a-0f2cb63f523c

📥 Commits

Reviewing files that changed from the base of the PR and between 7703665 and 90cae9e.

📒 Files selected for processing (4)
  • app/api/mock/[...path]/route.ts
  • app/api/mock/[...path]/seed.ts
  • app/dashboard/developer/page.tsx
  • lib/api/keys.ts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@Zingzy Zingzy left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mergeable, nothing blocking. Small and correctly built.

  • The wire field staying optional (last_used_at?: number | null) is the load-bearing detail: until spoo#266 deploys, the backend omits the field entirely, absence and null both normalize to null, and the row renders never used. No deploy-order coupling in either direction.
  • Verified formatWhen(null) returns "never", so the old row read "last used never"; this is a copy fix, not a broken-render fix. "never used" is the better sentence.
  • The mock discipline is the part worth praising: keyToWire serves the field with the same unix-seconds shape, the comment was updated in lockstep instead of drifting, and the new seed key exercises the null branch in walkthrough mode. That habit is what keeps the mock trustworthy.
  • The seed's prefix is unique among its siblings, and the never-used state renders as muted metadata text rather than a badge, consistent with the rest of the row.

One thing to know, not to change: for the transition window after #266 deploys, every pre-existing key reads null and renders "never used" until its next authentication restamps it (within the hour for active keys). Since the whole point of the field is "is this key safe to revoke", a user checking the page on deploy day could read an active key as dead. It self-corrects fast and the alternative (transition copy) isn't worth the complexity at this scale; just don't mass-revoke based on the column that day.

@Zingzy
Zingzy merged commit e74f3ee into main Jul 22, 2026
2 checks passed
@Zingzy
Zingzy deleted the feat/keys-last-used branch August 16, 2026 12:37
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.

2 participants