Skip to content

fix(console): show OIDC account name for console admin users#102

Merged
cxymds merged 1 commit intorustfs:mainfrom
GatewayJ:fix/oidc-consoleadmin-account-display
Apr 21, 2026
Merged

fix(console): show OIDC account name for console admin users#102
cxymds merged 1 commit intorustfs:mainfrom
GatewayJ:fix/oidc-consoleadmin-account-display

Conversation

@GatewayJ
Copy link
Copy Markdown
Member

@GatewayJ GatewayJ commented Apr 21, 2026

Description

This PR fixes the user dropdown showing the hardcoded label rustfsAdmin for OIDC users who have the consoleAdmin policy (and are treated as console administrators). The console previously skipped fetching /accountinfo for admin sessions and substituted a placeholder name.

Changes:

  • PermissionsProvider: fetch user policy/account info whenever the user is authenticated and admin resolution is complete, not only for non-admin users.
  • UserDropdown: display account_name from the API without the rustfsAdmin fallback (empty string when missing).

This aligns the UI with the API, which returns the OIDC session identity (e.g. preferred_username) for temporary credentials.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated (no test runner configured in this repo)
  • Manual testing completed
pnpm install --frozen-lockfile
rm -rf .next && pnpm exec tsc --noEmit
pnpm lint

Note: pnpm test:run is not defined in package.json.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass (no test script in project)
  • No new dependencies added, or they are justified

Related Issues

Closes rustfs/rustfs#2612 (console-side; server already returns account_name from OIDC parent_user for temp sessions).

Screenshots (if applicable)

N/A (username text in user menu).

Additional Notes

Upstream issue: rustfs/rustfs#2612

Fetch /accountinfo for all authenticated users after admin is resolved so temporary/OIDC sessions expose account_name from the API. Remove the rustfsAdmin placeholder in the user dropdown.

Related: rustfs/rustfs#2612
Made-with: Cursor
@GatewayJ GatewayJ requested a review from cxymds April 21, 2026 01:53
@cxymds cxymds merged commit ca678d2 into rustfs:main Apr 21, 2026
11 checks passed
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.

Username wrongly set to rustfsAdmin when using OIDC and the consoleAdmin policy

2 participants