Skip to content

test: add regression coverage for OidcAdapterServiceOptions failure h… - #1193

Open
Peolite1 wants to merge 1 commit into
RevoraOrg:masterfrom
Peolite1:feature/backend-011-rate-limiter-tier-policies
Open

Peolite1 wants to merge 1 commit into
RevoraOrg:masterfrom
Peolite1:feature/backend-011-rate-limiter-tier-policies

Conversation

@Peolite1

Copy link
Copy Markdown

Title

test: add regression coverage for OidcAdapterServiceOptions failure handling and OIDC discovery

Description

Closes #975

This PR strengthens the test coverage for the OidcAdapterServiceOptions and OIDC discovery handling to ensure deterministic failure paths. It explicitly asserts on error contracts and verifies boundary inputs for issuer URLs and configuration overrides to prevent silent behavior changes in the future.

Changes Included:

  • Exact Error Matching: Refactored the getDiscovery tests to assert the exact failure string rather than a regex, preventing silent contract behavior changes for:
    • Non-200 discovery responses (OIDC discovery failed for...)
    • Missing required fields (OIDC discovery document missing required fields)
    • Issuer URL mismatches (OIDC issuer mismatch: expected...)
  • Issuer URL Boundary Coverage: Added targeted tests to verify boundary inputs around URL normalization, specifically combinations of trailing slashes on expected and provided issuer URLs.
  • OidcAdapterServiceOptions Fallbacks: Added a dedicated test suite to explicitly test caching TTL fallback paths, ensuring deterministic behavior when:
    • An explicit TTL override is successfully provided.
    • An invalid override falls back to the OIDC_DISCOVERY_TTL_MS environment variable.
    • Both override and environment variable are invalid, defaulting to the baseline fallback (1 hour).

Validation:

  • Successfully ran the focused test file (src/auth/oidc/oidc.test.ts) covering all successful and failing paths.
  • Ran the surrounding repository test suite to ensure no regressions in public contracts.
  • Tests executed without failure.

@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@Peolite1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add regression coverage for OidcAdapterServiceOptions failure handling

1 participant