You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Bearer token (JWT) authentication via PAS plugin (#88)
* Add Bearer token (JWT) authentication via PAS plugin
* Added bearer doctest
* Add #88 changelog entry
* Set Secure + SameSite=Lax on JWT cookie
SameSite=None requires Secure on modern browsers, which silently drops
the cookie over HTTP. Lax doesn't have that constraint and is the right
default for an API token cookie; clients that need cross-site requests
should use the Authorization: Bearer header instead.
* Document JWT/Bearer auth and explain peek_userid trust model
* Drop cookie assertion from login doctest
The test browser drives the API over plain HTTP, so the Secure cookie
set by /login is not retained. Bearer-header auth is exercised in the
following section and is the recommended path for non-HTTPS clients.
* Add 'Try it' section to auth docs
* Use single backticks in auth docs
* Test X-JWT-Auth-Token fallback and cookie security attributes
* Add uninstall profile, declare senaite.core dependency, fix X-JWT-Auth-Token doctest
- profiles/default/metadata.xml declares profile-senaite.core:default
as dependency.
- New profiles/uninstall profile + uninstall_handler removes the JWT
PAS plugin and clears the per-user key storage annotation.
- Changelog note that existing 2.6.x sites must install the new
profile from Site Setup -> Add-ons to enable JWT authentication.
- Encode the token as ASCII bytes when setting the X-JWT-Auth-Token
doctest header to satisfy WebTest's WSGI environ lint.
* Hide uninstall profile from Add-ons panel via INonInstallable
Register an INonInstallable adapter so the Add-ons control panel only
lists 'SENAITE JSONAPI' (the default profile) as installable; the
uninstall profile is applied automatically when the user clicks
'Uninstall' and should not appear as a separate add-on entry.
---------
Co-authored-by: Ramon Bartl <rb@ridingbytes.com>
0 commit comments