Skip to content

feat(ui): allow non-owner users to authorize on accessible OAuth gateways#3935

Open
kimsehwan96 wants to merge 1 commit intoIBM:mainfrom
kimsehwan96:feat/authorize-non-owner-access
Open

feat(ui): allow non-owner users to authorize on accessible OAuth gateways#3935
kimsehwan96 wants to merge 1 commit intoIBM:mainfrom
kimsehwan96:feat/authorize-non-owner-access

Conversation

@kimsehwan96
Copy link
Copy Markdown
Contributor

@kimsehwan96 kimsehwan96 commented Mar 31, 2026

🔗 Related Issue

Closes #3934


📝 Summary

Non-owner team members and public gateway users cannot see the "🔐 Authorize" button on OAuth gateways, preventing them from completing the OAuth flow. The backend already stores tokens per-user (oauth_tokens.app_user_email), so this is purely a UI visibility fix.

  • Add can_authorize template variable (broader than can_modify) for Authorize/Fetch Tools buttons
  • Keep can_modify for Edit/Deactivate/Delete (unchanged)

🏷️ Type of Change

  • Bug fix
  • Feature / Enhancement
  • Documentation
  • Refactor
  • Chore (deps, CI, tooling)
  • Other (describe below)

🧪 Verification

Check Command Status
Lint suite make lint pass
Unit tests make test pass
Coverage ≥ 80% make coverage

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • Tests added/updated for changes
  • Documentation updated (if applicable)
  • No secrets or credentials committed

📓 Notes (optional)

Changed files:

  • gateways_partial.html: 1 line added + 1 line modified
  • test_admin.py: 5 tests added (2 positive, 2 regression, 1 negative)

Visibility logic:

  ┌─────────────────────────────────┬───────────┬─────────────┐
  │            User type            │ Authorize │ Edit/Delete │
  ├─────────────────────────────────┼───────────┼─────────────┤
  │ Admin                           │    ✅     │     ✅      │
  ├─────────────────────────────────┼───────────┼─────────────┤
  │ Gateway owner                   │    ✅     │     ✅      │
  ├─────────────────────────────────┼───────────┼─────────────┤
  │ Team member (non-gateway-owner) │    ✅     │     ❌      │
  ├─────────────────────────────────┼───────────┼─────────────┤
  │ Any user (public gw)            │    ✅     │     ❌      │
  ├─────────────────────────────────┼───────────┼─────────────┤
  │ Non-member (team gw)            │    ❌     │     ❌      │
  └─────────────────────────────────┴───────────┴─────────────┘

Screenshot as team member but not the mcp owner.

스크린샷 2026-03-31 오전 11 30 46

(AWS Docs MCP set as no auth type)

E2E Verification (manual):

  • Built and deployed from this commit to a live K8s cluster
  • Tested as a team member who is not the gateway owner
  • Confirmed Authorize button is visible and OAuth flow completes successfully
  • As team owner: authorization, tool fetch, and tool invocation all work with the user's own token
  • As team member: authorization works, but tool fetch/invocation is blocked due to missing tools.execute permission (pending feat(rbac): add tools.execute permission to team-scoped viewer role #3882)

…ways

Non-owner team members and public gateway users could not see the
Authorize button, preventing them from completing the OAuth flow and
storing their own tokens. The backend already supports per-user OAuth
tokens (keyed by gateway_id + app_user_email), but the UI gated the
Authorize button behind can_modify which requires owner/admin status.

Introduce can_authorize — a broader visibility check that includes
team members and public gateway users — and apply it to the Authorize
and Fetch Tools buttons while keeping Edit/Deactivate/Delete behind
can_modify.

Closes: IBM#3934

Signed-off-by: kimsehwan96 <sktpghks138@gmail.com>
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.

[FEATURE][AUTH]: Allow non-owner users to initiate OAuth authorization on accessible gateways

1 participant