Add integration tests for CIMD embedded auth server support#5379
Draft
amirejaz wants to merge 2 commits into
Draft
Add integration tests for CIMD embedded auth server support#5379amirejaz wants to merge 2 commits into
amirejaz wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## cimd-phase2-pr6-cimd-validation #5379 +/- ##
===================================================================
- Coverage 68.79% 68.79% -0.01%
===================================================================
Files 627 627
Lines 63668 63672 +4
===================================================================
Hits 43801 43801
- Misses 16612 16614 +2
- Partials 3255 3257 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
91b1244 to
d27bbf5
Compare
d27bbf5 to
bc4cb59
Compare
bc4cb59 to
9cc0ec9
Compare
9cc0ec9 to
2d834ed
Compare
C3 - Thread ScopesSupported into NewCIMDStorageDecorator so CIMD scope
handling is consistent with DCR. Uses registration.ValidateScopes
(same function as the DCR handler) to validate declared scopes
against the AS allowlist and compute the effective scope list.
When ScopesSupported is unset, the document's declared scopes are
used directly; omitted scopes default to DefaultScopes.
C4 - Reject CIMD documents that declare grant_types or response_types
the embedded AS does not support for public clients
(authorization_code + refresh_token; code). Consistent with DCR
which returns invalid_client_metadata for the same cases.
buildFositeClient now receives pre-computed scopes from fetch() rather
than re-parsing doc.Scope, matching the DCR handler pattern where scope
computation and validation happen before client construction.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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>
2d834ed to
f9e761d
Compare
8e68d45 to
36b5e97
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/integration/authserver/that exercise the CIMD feature end-to-end against a realEmbeddedAuthServerinstance — no mocks, no binary required:client_id_metadata_document_supported: trueappears in both/.well-known/oauth-authorization-serverand/.well-known/openid-configurationwhen CIMD is enabled; absent when disabled/oauth/authorizewith a CIMD URL asclient_idredirects to the upstream IDP without prior DCR registration/oauth/register, proving on-the-fly client resolution worksAlso adds
WithCIMDfunctional option to the integration test helper intest/integration/authserver/helpers/authserver.go.Type of change
Test plan
go test ./test/integration/authserver/...passestask lint-fixcleanGenerated with Claude Code