Skip to content

Fixes login handling for Origin and Cache#2278

Merged
bbockelm merged 4 commits into
PelicanPlatform:mainfrom
CannonLock:origin-cache-auth
Jul 25, 2025
Merged

Fixes login handling for Origin and Cache#2278
bbockelm merged 4 commits into
PelicanPlatform:mainfrom
CannonLock:origin-cache-auth

Conversation

@CannonLock

Copy link
Copy Markdown
Contributor
  • Adds 403 page to explain what happened if a user logs in to non admin account
  • Redirects cache and origin pages if user is not admin

Closes #2202

@CannonLock CannonLock requested review from Copilot and h2zh April 30, 2025 20:29
@CannonLock CannonLock added bug Something isn't working cache Issue relating to the cache component origin Issue relating to the origin component labels Apr 30, 2025

Copilot AI left a comment

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.

Pull Request Overview

This PR fixes the login handling for Origin and Cache by adding a dedicated 403 page for non-admin accounts and adjusting the routing logic to redirect non-admin users appropriately.

  • Updated root page extraction and redirection logic in the authentication middleware.
  • Added a new frontend page to display a 403 error with account details and logout functionality.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web_ui/ui.go Revised authentication redirection and root path extraction logic.
web_ui/frontend/app/(login)/403/page.tsx Introduced the new 403 error page for non-admin accounts.

Comment thread web_ui/ui.go Outdated
Comment thread web_ui/frontend/app/(login)/403/page.tsx Outdated
Comment thread web_ui/frontend/app/(login)/403/page.tsx
Comment thread web_ui/ui.go Outdated
Comment thread web_ui/ui.go
@CannonLock CannonLock requested a review from h2zh May 19, 2025 19:25
@h2zh

h2zh commented May 21, 2025

Copy link
Copy Markdown
Contributor

@CannonLock It seems like url package was forgotten. Also rebase the latest main if it's possible.

Comment thread web_ui/ui.go Outdated
@bbockelm

Copy link
Copy Markdown
Collaborator

@CannonLock - this is now 1.5 months old, can you get things wrapped up? Seems to be 90% there.

- Adds 403 page to explain what happened if a user logs in to non admin account
- Redirects cache and origin pages if user is not admin

Closes PelicanPlatform#2202
… account

Redirects cache and origin pages if user is not admin
Closes PelicanPlatform#2202
@CannonLock CannonLock self-assigned this Jun 26, 2025
@CannonLock CannonLock requested a review from h2zh June 26, 2025 16:07
@h2zh

h2zh commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

There're a bunch of auth-related tests failing. Could you take a look? @CannonLock

@h2zh h2zh left a comment

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.

There're a bunch of auth-related tests failing. Could you take a look?

If you are trying to access an admin only page not as an admin we will send you to a page that explains the distinction.

If you are trying to access an admin only page without logging in we will redirect you to login.

Signed-off-by: Cannon Lock <clock@wisc.edu>
@CannonLock CannonLock requested a review from h2zh July 23, 2025 17:10
@CannonLock

Copy link
Copy Markdown
Contributor Author

@h2zh I fixed the tests, although I am not sure what to make of the current test failures...

@h2zh h2zh left a comment

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.

LGTM - the remaining TestStatMemory failure has nothing to do with this PR

@bbockelm bbockelm merged commit 6a521c4 into PelicanPlatform:main Jul 25, 2025
26 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cache Issue relating to the cache component origin Issue relating to the origin component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Origin/Cache metrics page can be accessed by non-logged in user

4 participants