Files
Lenardt Gerhardts 84db9b2276 Added configuration option to skip OIDC authorization checks for certain endpoints (#969)
* Added posibility to bypass oidc authentication for certain endpoints

* fixxed missing .clone()

* Fixxed oidc_skip_endpoints not being optional

* feat(oidc): Introduce protected path prefixes

This commit replaces the OIDC endpoint blacklist with a path prefix whitelist. This is a more intuitive and secure approach for managing protected routes.

The new `oidc_protected_paths` configuration option allows users to specify a list of URL prefixes that require OIDC authentication. By default, all paths are protected.

The documentation has been updated to reflect this change, with clear examples and more user-friendly language.

* docs(oidc): Improve OIDC documentation and examples

This commit improves the OIDC documentation and the "single sign on"
example to better demonstrate how to create a selective login system.

The main documentation now includes a section on creating a public
login page and the "single sign on" example has been updated to
reflect this pattern.

* Simplify OIDC middleware request handling for unprotected paths

* docs(oidc): Improve single sign on example

This commit improves the "single sign on" example to better
demonstrate a public information page that adapts to the users
login status and a separate protected page.

* docs(oidc): Document oidc_protected_paths in configuration.md

This commit updates the main configuration documentation to reflect the
new `oidc_protected_paths` option. It removes the outdated
`oidc_skip_endpoints` and provides a more detailed explanation of how
to create a mix of public and private pages.

* Improve SSO demo UX

- Update docker compose command to use `--watch` flag - Add watch
configuration for SQLPage development - Enhance login page with hero
component and better styling - Simplify protected page welcome message -
Fix OIDC middleware path check logic - Update protected paths in config
to use `/protected` instead of `/protected.sql`

* Skip OIDC auth for non-protected paths later in middleware

We still want to be able to access authenticated user's info in
non-authenticated parts of the app.

We crucially need to check request.path() == SQLPAGE_REDIRECT_URI before
the protected_paths check

* Added whitelist option

* Update configuration.md

* Improve OIDC public paths documentation

The documentation now provides clearer examples and explains the
interaction between public and protected paths more precisely. Also
removes the now-unused default_oidc_public_paths function since the
field's default is handled by serde's default for Vec.

* Add OidcConfig method to check public paths

The new `is_public_path` method consolidates the logic for checking if a
path should bypass OIDC authentication. This replaces the previous
inline checks for public and protected paths.

* fix default empty public paths

* Update SSO example with new image path and public access rules

- Change hero image path in login page - Remove protected.sql as it's no
longer needed - Update sqlpage.yaml to allow public access to
/protected/public

---------

Co-authored-by: Lenardt Gerhardts <lenardt.gerhardts@obi.de>
Co-authored-by: lovasoa <contact@ophir.dev>
2025-07-25 21:15:53 +02:00
..