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

Support paths in BASE during routing #451

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bajnokk
Copy link
Contributor

@bajnokk bajnokk commented Jan 3, 2024

This is a squashed and slightly polished variant of #405 .
Original description follows:

If Satosa is installed under a path which is not the root of the
webserver (ie. "https://example.com/satosa"), then endpoint routing must
take the base path into consideration.

Some modules registered some of their endpoints with the base path
included, but other times the base path was omitted, thus it made the
routing fail. Now all endpoint registrations include the base path in
their endpoint map.

Additionally, DEBUG logging was configured for the tests so that the
debug logs are accessible during testing.

Fixes #404

bajnokk and others added 3 commits November 24, 2023 16:40
If Satosa is installed under a path which is not the root of the
webserver (ie. "https://example.com/satosa"), then endpoint routing must
take the base path into consideration.

Some modules registered some of their endpoints with the base path
included, but other times the base path was omitted, thus it made the
routing fail. Now all endpoint registrations include the base path in
their endpoint map.

Provide a simple implementation for joining path components, since we
don't want to add the separator for empty strings and when any of the
path components already have it.

Additionally, DEBUG logging was configured for the tests so that the
debug logs are accessible during testing.
Even though the OIDC provider configuration has an element for setting
the issuer, for some reason it was rewritten to BASE unconditionally,
but this has broken provider endpoint discovery when multiple OIDC
frontends were in use.
Setting an alternative issuer should not be an encouraged setup,
although provider discovery should work either way. The recommended
setting is to use the BASE as the issuer, and we can leverage the
agressive configuration value replacement logic, which rewrites all
occurences of <base_url> to the value of BASE. The unit test was
modified to guarantee this behaviour, though.
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.

Can't use paths in BASE
1 participant