Repository navigation
Add library-backed OAuth validation and managed interoperability tests - #80
Conversation
Use oauth4webapi for protocol requests and token processing behind the existing fetch API. Add strict policy checks, aligned fixtures, and managed WireMock/Keycloak tests with macOS CI Java selection. Clear superseded event reconnect timers and cover the regression exposed by the full suite.
Preserve the newly landed discovery regressions, supply the required authorization endpoint in the refresh fixture, and close all event-source fixtures during teardown.
Align recognized discovery endpoint validation, assert normalized token values and shared acquisition/refresh error categories, and cover provider startup and artifact failures. Record resolved dependency footprints and live backend verification.
|
Preserve refresh error classification for empty advisory descriptions and validate expiry before numeric rounding. Align shared fixtures, repair reviewed test lifecycle behavior, and document protocol compatibility and dependency boundaries.
|
|
Sonar follow-up: the nested authentication ternary and generic length assertion are fixed. The remaining Current-head validation: |



OAuth discovery and token responses previously permitted inconsistent parsing and contextual validation across runtimes. This change adds explicit validation, 123 wire fixtures and 34 matching HTTP classification fixtures, and managed interoperability tests while preserving existing public APIs and the public-client compatibility policy from #59 in sunday-kt.
oauth4webapi 3.8.8 constructs requests and processes token-success responses; Sunday retains explicit wire and contextual policy checks.
Native test infrastructure owns checksum/digest-pinned WireMock replay and Keycloak 26.2.5 live lifecycle. Replay is the default. On macOS CI, live tests select the official Java distribution without Docker discovery; other environments use the container. CI invokes standard test commands with replay for PRs and live on main.
Validation:
bun run checkpasses: lint, typecheck, 773 tests, and build. Managed replay and live Keycloak acquisition/refresh pass for public PKCE and confidential Basic/POST. Includes a regression fix that clears superseded event reconnect timers and closes test-owned event sources during teardown; the existing Husky 4 hook was broken locally, so checks were run directly before committing.Acceptance follow-up: all five transports now assert exact HTTP error categories during acquisition and refresh; accepted wire cases assert token values and absolute expiry. Recognized discovery endpoint validation is aligned across runtimes. Native harness tests cover startup failure, readiness timeout, process cleanup, corrupt caches, and rejected downloads. Dependency footprint and license measurements are recorded in the evaluation report.
Local replay/full checks and live Keycloak acquisition/refresh pass using both the Java distribution and pinned container. Kotlin additionally prevents OkHttp from automatically replaying single-use token requests on 408 or immediate-retry 503 responses. No live Auth0 tenant was tested; Auth0-shaped fixtures are deterministic only. Current-head hosted checks and review remain the merge gates. This PR does not publish a beta.
Error classification tolerates empty advisory descriptions as a documented interoperability exception while rejecting wrong types. Fractional expiry values are checked before numeric rounding, with matching precision-boundary fixtures across runtimes. JavaScript pins lossless-json 4.3.0 for numeric validation. Failed container cleanup is reported and can be retried. The intentionally deprecated oauth4webapi HTTP option remains guarded by the loopback-only endpoint policy.
Related implementation PRs: Kotlin #61, JavaScript #80, Python #7, Swift #73.