Skip to content

Custom sessions & X-Session-UUID#1

Merged
torotil merged 3 commits into
mainfrom
keep-session-uuid
Jun 1, 2026
Merged

Custom sessions & X-Session-UUID#1
torotil merged 3 commits into
mainfrom
keep-session-uuid

Conversation

@torotil

@torotil torotil commented May 28, 2026

Copy link
Copy Markdown
Contributor

Two changes:

  • The session class can be overridden using the manager object.
  • The default Session respects the X-Session-UUID header when creating anonymous sessions.

@torotil torotil force-pushed the keep-session-uuid branch from 30a8929 to 792118a Compare May 28, 2026 13:52
@torotil torotil force-pushed the keep-session-uuid branch from 792118a to 5e8e00d Compare May 29, 2026 09:01
org = flask.request.headers.get("x-ist-org", None)
return cls(None, {org: []} if org else {})
headers = flask.request.headers
session_header = flask.current_app.config.get("AUTH_UUID_HEADER", "x-ist-session-uuid")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Following the naming scheme of the auth-wsgi-middleware, this should be called uuid_header. Also matches the setting better.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are all the header names configurable, only the X-IST-org header is not? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it should be too. But it wasn’t before. So I left it. Happy to make it configurable in a follow-up.

@torotil torotil merged commit e082770 into main Jun 1, 2026
2 checks passed
@torotil torotil deleted the keep-session-uuid branch June 1, 2026 12:21
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