The GitHub Actions job "Tests" on 
airflow.git/fix/securecookie-session-serialization has failed.
Run started by GitHub user smartlin5228 (triggered by vincbeck).

Head commit for run:
6c2ce71b455679c293a263a7aefb396cd75dce6c / tlin219 <[email protected]>
Fix session cookie serialization when using securecookie backend

When `session_backend = securecookie`, `AirflowSecureCookieSessionInterface`
inherits a custom `_LazySafeSerializer` via `SessionExemptMixin.__init__`,
which overrides `self.serializer` with a msgpack-based serializer that
returns bytes.

Flask's `SecureCookieSessionInterface.get_signing_serializer()` passes
`self.serializer` to `itsdangerous.URLSafeTimedSerializer`. The signed
cookie value eventually reaches Werkzeug's `dump_cookie`, which expects
a string, causing:

    TypeError: cannot use a string pattern on a bytes-like object

The custom `_LazySafeSerializer` was designed for the database session
interface where the `data` column is `LargeBinary` and needs bytes.
The cookie interface doesn't need it — Flask's default serializer
handles cookies correctly.

Move the custom serializer assignment from the shared `SessionExemptMixin`
into `AirflowDatabaseSessionInterface.__init__` only, so the cookie
interface uses Flask's built-in serializer.

Report URL: https://github.com/apache/airflow/actions/runs/25520748532

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to