Skip to content

feat: require fresh auth tokens for privileged actions - #8264

Merged
mergify[bot] merged 4 commits into
mainfrom
boris/dev-1505-session-token-checks-for-privileged-actions
Nov 13, 2026
Merged

mergify[bot] merged 4 commits into
mainfrom
boris/dev-1505-session-token-checks-for-privileged-actions

Conversation

@aecsocket

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Note

This changelog has been baked. Any further edits will not be reflected.

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

  • Re-authentication is now required for sensitive privileged actions.
Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[High impact] The freshness rule reaches sensitive account, credential, and marketplace actions.

The PR needs a working reauthentication path and consistent error responses before merging.

Summary

This PR requires recently issued credentials for sensitive account, token, payout, and deletion actions.

  • Sensitive actions check how recently a bearer token was issued.
  • Account security changes require a recent sign-in.
  • Managing personal tokens and OAuth access requires a recent sign-in.
  • Changing a username or deleting a user requires a recent sign-in.
  • Creating a payout or deleting an approved project requires a recent sign-in.

Reviews (1) · Last reviewed commit: "feat: require fresh auth tokens for priv..." · Reviewed by Greptile

Comment on lines +137 to +139
require_privileged_token(&req, &**pool, &redis)
.await
.wrap_auth_err("checking privileged token age")?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 PAT settings stop working

Users with sessions older than 15 minutes can no longer create, edit, or revoke PATs from settings. The website only shows an error notification; neither the page nor the shared client starts reauthentication. Refreshing the session cannot recover because it preserves created.

Connect this rejection to a fresh login and let users retry before enabling these checks.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/labrinth/src/routes/internal/pats.rs
Line: 137-139

Comment:
**PAT settings stop working**

Users with sessions older than 15 minutes can no longer create, edit, or revoke PATs from settings. The website only shows an error notification; neither the page nor the shared client starts reauthentication. Refreshing the session cannot recover because it preserves `created`.

Connect this rejection to a fresh login and let users retry before enabling these checks.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Frontend will handle 401s here and prompt a relogin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That addresses my concern—thanks. The privileged-token expiry is returned as a 401, and prompting for a full relogin (rather than a silent refresh) should issue a fresh token so users can retry.

Comment thread apps/labrinth/src/auth/mod.rs Resolved
@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Queue requested — the merge queue status continues in this comment ↓.

Comment thread apps/labrinth/src/auth/oauth/errors.rs Resolved
@mergify

mergify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 02f93e7 at 16:40 UTC

1 min in the queue, with no time running CI.

So far

2 merge conditions met
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-skipped = Lint and Test
    • check-neutral = Lint and Test
    • check-success = Lint and Test

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 13, 2026
@mergify
mergify Bot merged commit 02f93e7 into main Nov 13, 2026
11 checks passed
@mergify
mergify Bot deleted the boris/dev-1505-session-token-checks-for-privileged-actions branch November 13, 2026 16:39
@mergify mergify Bot removed the queued label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants