Skip to content

Move authnRequestSession to symfony sessions#1982

Open
kayjoosten wants to merge 5 commits intofeature/issue-1971-correlation-id-loggingfrom
feature/authn-request-session-symfony
Open

Move authnRequestSession to symfony sessions#1982
kayjoosten wants to merge 5 commits intofeature/issue-1971-correlation-id-loggingfrom
feature/authn-request-session-symfony

Conversation

@kayjoosten
Copy link
Copy Markdown
Contributor

No description provided.

@kayjoosten kayjoosten changed the title Feature/authn request session symfony Move authnRequestSession to symfony sessions Apr 17, 2026
@kayjoosten kayjoosten force-pushed the feature/authn-request-session-symfony branch 4 times, most recently from e92841d to a0096cf Compare April 17, 2026 09:20
@kayjoosten kayjoosten requested a review from johanib April 17, 2026 09:24
@kayjoosten kayjoosten force-pushed the feature/issue-1971-correlation-id-logging branch 2 times, most recently from 73b3503 to 7e17a65 Compare April 21, 2026 16:08
kayjoosten added 5 commits May 5, 2026 10:49
Introduces three new components to address issue #1971:

- CorrelationId: shared mutable DI service (get/set) that acts as a
  per-request holder for the active correlation ID
- CorrelationIdRepository: Symfony service backed by the session with
  three operations:
    mint(requestId)  — generate a random ID for an SP request (idempotent)
    link(target, src) — copy the ID to an IdP request ID
    resolve(requestId) — push the stored ID into CorrelationId
  Safely no-ops when no session is available (CLI, unit tests).
- CorrelationIdProcessor: Monolog processor that stamps correlation_id
  on every log record from the shared CorrelationId service

DI wiring: services.yml registers CorrelationId and CorrelationIdRepository
(with @request_stack); logging.yml registers the Monolog processor.
Each HTTP leg resolves the correlation ID at the top of its handler so
every log entry emitted during that leg carries the correct ID:

  Leg 1 SSO        — mint() + resolve() in SingleSignOn (WAYF path)
                     mint() + link() + resolve() in ProxyServer (direct path)
  Leg 2 ContinueToIdp — resolve() so debug log lines carry the ID;
                     ProxyServer also calls link() to associate the IdP
                     request ID with the SP request ID
  Leg 3 ACS        — resolve() via InResponseTo (IdP request ID)
  Leg 4 Consent    — resolve() via SP request ID in ProvideConsent and
                     ProcessConsent

DiContainer exposes getCorrelationIdRepository() as the bridge from
legacy Corto code to the Symfony service.

Includes a Behat feature covering the WAYF path, the direct (no-WAYF)
path, and concurrent flows; and a unit test for
AuthnRequestSessionRepository.
@kayjoosten kayjoosten force-pushed the feature/authn-request-session-symfony branch from a0096cf to 9a4aa7c Compare May 5, 2026 09:12
@johanib johanib force-pushed the feature/issue-1971-correlation-id-logging branch from 3557fe0 to 464f9e4 Compare May 7, 2026 06:31
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.

1 participant