Skip to content

Add integration tests for CIMD embedded auth server support#5379

Draft
amirejaz wants to merge 1 commit into
cimd-phase2-pr3-wiringfrom
cimd-phase2-pr4-integration-tests
Draft

Add integration tests for CIMD embedded auth server support#5379
amirejaz wants to merge 1 commit into
cimd-phase2-pr3-wiringfrom
cimd-phase2-pr4-integration-tests

Conversation

@amirejaz
Copy link
Copy Markdown
Contributor

Summary

  • Stacked on Wire CIMD config through embedded AS and enable storage decorator #5348 (wire CIMD config through embedded AS). Merge that first.
  • Adds four integration tests in test/integration/authserver/ that exercise the CIMD feature end-to-end against a real EmbeddedAuthServer instance — no mocks, no binary required:
    1. Discoveryclient_id_metadata_document_supported: true appears in both /.well-known/oauth-authorization-server and /.well-known/openid-configuration when CIMD is enabled; absent when disabled
    2. Authorize accepts CIMD URL/oauth/authorize with a CIMD URL as client_id redirects to the upstream IDP without prior DCR registration
    3. Authorize rejects CIMD URL when disabled — same request fails when CIMD is off
    4. No DCR required — flow completes without any call to /oauth/register, proving on-the-fly client resolution works

Also adds WithCIMD functional option to the integration test helper in test/integration/authserver/helpers/authserver.go.

Type of change

  • Test coverage (no production code change)

Test plan

  • go test ./test/integration/authserver/... passes
  • task lint-fix clean

Generated with Claude Code

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

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.80%. Comparing base (1d2c18c) to head (d27bbf5).

Additional details and impacted files
@@                    Coverage Diff                     @@
##           cimd-phase2-pr3-wiring    #5379      +/-   ##
==========================================================
+ Coverage                   68.77%   68.80%   +0.03%     
==========================================================
  Files                         627      627              
  Lines                       63625    63629       +4     
==========================================================
+ Hits                        43759    43783      +24     
+ Misses                      16612    16593      -19     
+ Partials                     3254     3253       -1     

☔ View full report in Codecov by Sentry.
📢 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.

Four integration tests that exercise the CIMD flow end-to-end against
a real EmbeddedAuthServer instance:

- Discovery advertises client_id_metadata_document_supported when CIMD
  is enabled, and omits the flag when disabled
- Authorize accepts a CIMD URL as client_id and redirects to the
  upstream IDP without any prior DCR registration call
- Authorize rejects a CIMD URL when CIMD is disabled
- No DCR call is required — CIMD resolves the client on the fly

Also adds a WithCIMD functional option to the integration test helper.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant