Skip to content

Add integration tests for CIMD embedded auth server support - #5379

Merged
ChrisJBurns merged 1 commit into
mainfrom
cimd-phase2-pr4-integration-tests
Nov 25, 2026
Merged

ChrisJBurns merged 1 commit into
mainfrom
cimd-phase2-pr4-integration-tests

Conversation

@amirejaz

@amirejaz amirejaz commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Why: CIMD support in the embedded auth server is covered today only by handler/decorator unit tests with mocks and by a client-side e2e (thv run as a CIMD client). Nothing exercises a real EmbeddedAuthServer, built from a RunConfig, resolving a live client metadata document end to end.
  • What: Adds TestEmbeddedAuthServer_CIMD in test/integration/authserver/, table-driven over CIMD enabled/disabled, against a real embedded AS and a real CIMD document server:
    • Both /.well-known/oauth-authorization-server and /.well-known/openid-configuration advertise client_id_metadata_document_supported: true only when CIMD is enabled.
    • With CIMD enabled, /oauth/authorize accepts the CIMD URL as client_id with no prior DCR call, reaches consent, and approval redirects to the upstream IDP.
    • With CIMD disabled, the same request fails with a 4xx and never reaches the upstream.
  • Adds a WithCIMD option to the integration test helper.

Originally stacked on #5348 (merged). Rebased onto current main and updated for the browser consent step added since; the previous "accepts CIMD client_id" and "no DCR required" tests asserted the same path and are folded into one case.

Type of change

  • Test coverage (no production code change)

Test plan

  • go test -race -count=3 -run CIMD ./test/integration/authserver/ passes
  • go vet / gofmt clean on the changed package (local task lint-fix hits a golangci-lint/staticcheck panic under the go1.27 toolchain unrelated to this change; relying on CI lint)

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size/M Medium PR: 300-599 lines changed label May 25, 2026
@codecov

codecov Bot commented May 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.10%. Comparing base (504241a) to head (cf7adaf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5379   +/-   ##
=======================================
  Coverage   82.10%   82.10%           
=======================================
  Files         931      931           
  Lines       94306    94309    +3     
=======================================
+ Hits        77434    77437    +3     
  Misses      16867    16867           
  Partials        5        5           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amirejaz
amirejaz force-pushed the cimd-phase2-pr4-integration-tests branch from 91b1244 to d27bbf5 Compare May 25, 2026 21:23
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 25, 2026
@amirejaz
amirejaz force-pushed the cimd-phase2-pr4-integration-tests branch from d27bbf5 to bc4cb59 Compare May 26, 2026 13:48
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 26, 2026
@amirejaz
amirejaz force-pushed the cimd-phase2-pr4-integration-tests branch from bc4cb59 to 9cc0ec9 Compare May 26, 2026 14:47
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 26, 2026
@amirejaz
amirejaz force-pushed the cimd-phase2-pr4-integration-tests branch from 9cc0ec9 to 2d834ed Compare May 26, 2026 17:41
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 26, 2026
Base automatically changed from cimd-phase2-pr3-wiring to main May 26, 2026 20:12
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 26, 2026
@amirejaz
amirejaz force-pushed the cimd-phase2-pr4-integration-tests branch from 2d834ed to f9e761d Compare May 26, 2026 21:11
@amirejaz
amirejaz changed the base branch from main to cimd-phase2-pr6-cimd-validation May 26, 2026 21:11
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/L Large PR: 600-999 lines changed size/M Medium PR: 300-599 lines changed labels May 26, 2026
@amirejaz
amirejaz force-pushed the cimd-phase2-pr6-cimd-validation branch 3 times, most recently from 8e68d45 to 36b5e97 Compare May 26, 2026 21:40
Base automatically changed from cimd-phase2-pr6-cimd-validation to main June 2, 2026 14:28
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Jun 4, 2026
Exercise a real EmbeddedAuthServer built from a RunConfig with CIMD
on and off: discovery advertises support only when enabled, and a
CIMD URL is accepted as client_id at /oauth/authorize without prior
DCR registration, reaching consent and then the upstream IDP.

Based on #5379, rebased onto main and updated for the consent step.

Co-authored-by: amirejaz <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ChrisJBurns
ChrisJBurns force-pushed the cimd-phase2-pr4-integration-tests branch from 8fd52a4 to cf7adaf Compare November 25, 2026 22:37
@ChrisJBurns
ChrisJBurns marked this pull request as ready for review November 25, 2026 22:38
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/M Medium PR: 300-599 lines changed labels Nov 25, 2026
@ChrisJBurns
ChrisJBurns merged commit b7c9909 into main Nov 25, 2026
44 of 45 checks passed
@ChrisJBurns
ChrisJBurns deleted the cimd-phase2-pr4-integration-tests branch November 25, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Small PR: 100-299 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants