Skip to content

feat: clear user session issuer#2999

Open
qstearns wants to merge 3 commits into
mainfrom
clear-user-session-issuer-ReDO
Open

feat: clear user session issuer#2999
qstearns wants to merge 3 commits into
mainfrom
clear-user-session-issuer-ReDO

Conversation

@qstearns
Copy link
Copy Markdown
Contributor

Sometimes you set up a user session issuer and you change your mind (oft because you wish to take another crack)

This fixes that problem

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

🦋 Changeset detected

Latest commit: bddc1ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
server Minor
dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@qstearns qstearns marked this pull request as ready for review May 22, 2026 05:18
@qstearns qstearns requested review from a team as code owners May 22, 2026 05:18
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 22, 2026 3:03pm

Request Review

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1141a6f205

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +47 to +51
if _, err := s.repo.WithTx(dbtx).UpdateToolsetUserSessionIssuer(ctx, repo.UpdateToolsetUserSessionIssuerParams{
UserSessionIssuerID: uuid.NullUUID{UUID: uuid.Nil, Valid: false},
Slug: string(payload.Slug),
ProjectID: *authCtx.ProjectID,
}); err != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip write/audit when issuer is already absent

clearUserSessionIssuer is documented and tested as a no-op when no issuer is linked, but this implementation always executes UpdateToolsetUserSessionIssuer and later logs a toolset update event. When beforeView.UserSessionIssuerID is already nil, repeated calls still create a synthetic update (including audit noise and state churn) instead of behaving as a true no-op. Consider returning early before the update/audit path when the toolset is already clear.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the preview Spawn a preview environment label May 22, 2026
@speakeasybot
Copy link
Copy Markdown
Collaborator

speakeasybot commented May 22, 2026

🚀 Preview Environment (PR #2999)

Preview URL: https://pr-2999.dev.getgram.ai

Component Status Details Updated (UTC)
❌ Database Blocked Image build timed out 2026-05-22 23:56:59.
❌ Images Failed Timed out after 1185s waiting for images 2026-05-22 23:56:57.

Gram Preview Bot

Copy link
Copy Markdown
Member

@simplesagar simplesagar left a comment

Choose a reason for hiding this comment

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

NIT: ideally the admin capabilities are added via a toolbar rather on the core dashboard itself

qstearns and others added 3 commits May 22, 2026 08:00
Adds toolsets.clearUserSessionIssuer to unlink any user_session_issuer
attached to a toolset (sets toolsets.user_session_issuer_id to NULL).
The USI row itself is untouched. Calling it on a toolset that already
has no USI is a no-op.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a small destructive button next to the "Login Secured" badge on the
MCP authentication tab, visible only to admins when a user_session_issuer
is wired. Clicking it calls toolsets.clearUserSessionIssuer to unlink the
USI from the toolset so the wiring can be re-done without dropping into
the database.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Spawn a preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants