Skip to content

[ENG-12611] Admin auth middleware - #11989

Merged
brianjgeiger merged 2 commits into
CenterForOpenScience:feature/pbs-26-20from
adlius:admin-auth-middleware
Oct 29, 2026
Merged

brianjgeiger merged 2 commits into
CenterForOpenScience:feature/pbs-26-20from
adlius:admin-auth-middleware

Conversation

@adlius

@adlius adlius commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Ticket

Purpose

Changes

Side Effects

QE Notes

CE Notes

Documentation

@adlius
adlius force-pushed the admin-auth-middleware branch from c7680da to 03b7841 Compare October 28, 2026 14:30

@brianjgeiger brianjgeiger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, this looks great. What I'd love to see is the all views vs. protected views vs. non-protected views be refactored into a utility somewhere that the test script calls, and also to have a new admin panel added that is called "Unprotected views" that will list all the unprotected views and maybe link to them if that's easy enough. This will prevent someone from marking a view as "login-not-required" without it being discoverable on the interface.

@adlius
adlius force-pushed the admin-auth-middleware branch from 03b7841 to 43e5b7a Compare October 28, 2026 18:51
Comment thread admin_tests/utilities.py


def public_views():
return {LoginView}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of this, should we use the information from https://github.com/CenterForOpenScience/osf.io/pull/11989/changes#diff-96ba09f60ecd239a0ddc3a3c4c50ebb990141852057b3c8059a736ce11421676R45 to determine the public views, so we know those lists are synchronized?

From a practical perspective, it shouldn't matter too much, because this list will have to be updated to get tests to pass if a view is added that's unprotected, so we could let it through as is. Thoughts?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If we add a view that is marked as a public view by accident, then the test would fail. If we make this getter fetch public views automatically, then it would rely on the login_required attribute of the view, which could be something done by mistake.

@brianjgeiger
brianjgeiger merged commit a904410 into CenterForOpenScience:feature/pbs-26-20 Oct 29, 2026
8 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.

2 participants