Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix authentication error viewing ZMI resource with virtual hosting #1204

Merged
merged 5 commits into from
Apr 24, 2024

Conversation

perrinjerome
Copy link
Contributor

Fixes #1203

src/zmi/styles/subscriber.py Outdated Show resolved Hide resolved
The previous approach from #1196 was not correct when using virtual host,
because AUTHENTICATION_PATH is not usable in virtual host contexts.

This uses a different approach, by making the js and css path
subscribers take care of generating the URLs with the authentication
path prepended using request API aware of virtual hosting.
/++resource++zmi/logo/ and /++resource++logo/ is the same folder on disk,
the former is protected by Manage portal and the later is public.
Protected resources were problematic, because we want to serve them from
the root, but the manager user might not have permission on the root.
Using this approach we serve a resource relative to the path where user
is authenticated.
@perrinjerome perrinjerome force-pushed the perrinjerome/fix-zmi-user-path branch from fd73b7d to 1a4b3e4 Compare April 14, 2024 14:31
dataflake
dataflake previously approved these changes Apr 19, 2024
mauritsvanrees
mauritsvanrees previously approved these changes Apr 19, 2024
Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

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

Seems to work. Thanks!

One small inline suggestion, but that is not a problem caused by this PR, so I approve.

src/App/dtml/copyright.dtml Outdated Show resolved Hide resolved
This was referencing an old URL.

Co-authored-by: Maurits van Rees <[email protected]>
@perrinjerome perrinjerome dismissed stale reviews from mauritsvanrees and dataflake via d8a7054 April 24, 2024 02:59
@perrinjerome
Copy link
Contributor Author

after applying the suggestion of fixing bootstrap url in copyright page, your approvals became "stale", so I had to ask review again.

@perrinjerome perrinjerome merged commit 2e49bac into master Apr 24, 2024
26 checks passed
@perrinjerome perrinjerome deleted the perrinjerome/fix-zmi-user-path branch April 24, 2024 05:43
@perrinjerome
Copy link
Contributor Author

Thanks you !

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.

Authentication error viewing ZMI resource with virtual hosting.
3 participants