Skip to content

e2e characterization tests for /oauth2 #1221

Open

Description

@maximthomas

Part of #1075, the plan step "e2e characterization tests for /oauth2".

Problem

Before /oauth2 leaves Restlet, its HTTP contract has to be pinned by tests that run against master.
The plan moves the whole /oauth2/* to the OpenAM CHF servlet behind a Restlet fallback, then
migrates one endpoint family per PR. Each of those PRs proves parity with these tests.

OAuth2RouterProvider attaches 18 Restlet routes under /oauth2: authorize, access_token,
tokeninfo, introspect, connect/register, userinfo, idtokeninfo, connect/checkSession,
connect/endSession, connect/jwk_uri, resource_set (x3), .well-known/openid-configuration,
device/user, device/code, token/revoke and the realm route. Master's e2e covers few of them,
in 14 tests:

The never-merged features/restlet-migration branch of the maximthomas/OpenAM fork (tip
b02024a4f0) has five /oauth2 specs with 121 tests:

  • Three specs (100 tests) were recorded against the branch's Restlet code before bccbc9c4d9 moved
    /oauth2 to CHF. That commit also rewrote them toward CHF, so they are taken at bccbc9c4d9^.
    At the tip, oauth2-test.spec.mjs does not even load: a merge left two const CONSENT_CLIENT_ID
    declarations.
  • realms-test.spec.mjs and display-test.spec.mjs (21 tests) were written after the flip, against
    CHF.

Scope

Port these specs from the branch:

Spec Tests Taken at Note
e2e/oauth2/oauth2-test.spec.mjs 37 bccbc9c4d9^ two of them are master's auth code and userinfo tests, so the merged file has 40
e2e/oauth2/oauth2-endpoints-test.spec.mjs 43 bccbc9c4d9^
e2e/oauth2/oidc-test.spec.mjs 20 bccbc9c4d9^ predates GHSA-6f8c, so it may assert the old connect/endSession and connect/checkSession behaviour
e2e/oauth2/realms-test.spec.mjs 10 b02024a4f0 written against CHF
e2e/oauth2/display-test.spec.mjs 11 b02024a4f0 written against CHF

Fixtures: #1211 took from e2e/common/oauth2-fixtures.mjs only what the /uma spec needs.

  • Missing exports: authorizationCodeTokens, CLIENT_SESSION_URI, deleteClient,
    deviceCodeForConsent, ensureDeviceConsentClient, ensureNoSessionUriOidcClient,
    ensureOidcClient, OIDC_CLIENT_SECRET, pkce, POST_LOGOUT_REDIRECT_URI,
    POST_LOGOUT_REDIRECT_URI_WITH_QUERY, sessionContext.
  • Shared members differ too. On the branch, REQUIRED_SCOPES adds openid and profile, and
    ensureOAuth2Provider sets codeVerifierEnforced: true, but only when it creates the provider.
    On master, oauth2-test and device-flow-test configure the provider with their own helpers, and
    Playwright runs spec files in parallel. The settings the specs need must hold whichever spec runs
    first, or the specs must not depend on them.

Also:

  • All 14 master tests stay.
  • Tests only: no production change and no workflow change. build-docker already runs every spec
    under e2e/.
  • The step may split into several PRs when it is planned.

How the ported tests change

The specs pin what master answers today, on Restlet:

The branch has the live-Restlet captures of its pre-flip run, at b02024a4f0:
docs/migration/restlet/artefacts/e2e-transcript-pre-flip.txt and e2e-oracle-pre-flip.txt. They
help to tell branch refactoring from master changes.

Out of scope

Done when

  • The five specs are on master, with what they import from oauth2-fixtures.mjs and the provider
    settings they need. The 14 tests of oauth2-test.spec.mjs (5) and device-flow-test.spec.mjs (9)
    are kept.
  • build-docker runs them green against master, with no test.fail().
  • Every changed expectation is listed in the PR description.

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. added
    javascriptPull requests that update Javascript code
    oauth2OAuth2 / OpenID Connect
    testsTest suite: coverage, fixtures, or test infrastructure
    on Nov 5, 2026
  3. added 2 commits that reference this issue on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementjavascriptPull requests that update Javascript codeoauth2OAuth2 / OpenID ConnecttestsTest suite: coverage, fixtures, or test infrastructure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions