Skip to content

feat: add Cross App Access support to connection and client (EA only)#1658

Open
bkiran6398 wants to merge 6 commits into
mainfrom
DXCDT-1696/xaa-resource-app-authorization-server
Open

feat: add Cross App Access support to connection and client (EA only)#1658
bkiran6398 wants to merge 6 commits into
mainfrom
DXCDT-1696/xaa-resource-app-authorization-server

Conversation

@bkiran6398

@bkiran6398 bkiran6398 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🔧 Changes

Adds Cross App Access (XAA) support across auth0_connection and auth0_client. XAA lets a connection act as a resource application and lets a client exchange ID-JAGs for access tokens. Early Access (EA) only.

auth0_client

  • New identity_assertion_authorization_grant block with a required active boolean, marking whether the client can exchange ID-JAGs (Identity Assertion Authorization Grants) for access tokens.
  • Removing the block actively clears it on the server via a raw PATCH {"identity_assertion_authorization_grant": null}, so deleting it from config removes it rather than leaving a stale value.

auth0_connection

  • New cross_app_access_resource_app block with a required status of enabled or disabled, marking the connection as an XAA resource application. Supported on okta, oidc, and samlp strategies (the API rejects others).
  • Removing the block actively clears it on the server via a raw PATCH {"cross_app_access_resource_app": null}.
  • New oidc_metadata connection option (the OIDC discovery document, as a JSON string). This was never exposed by the provider before, for any strategy. It is auto-populated by the API from discovery_url when omitted, or uploaded directly to skip discovery. discovery_url is now also honoured for samlp connections.

Both new blocks are Optional-only (not Computed) so removing them surfaces a diff and the removal call runs. oidc_metadata is Optional + Computed so the server-populated discovery document does not cause a perpetual diff.

📚 References

🔬 Testing

  • Acceptance tests cover create, toggle, and true removal (asserting the block is gone, not merely toggled) for cross_app_access_resource_app and identity_assertion_authorization_grant, plus a samlp + oidc_metadata round-trip. Recorded cassettes prove the raw null PATCH goes out on removal.
  • A flatten unit test covers oidc_metadata mapping to state.
  • API behaviour was validated end to end against a live tenant before coding: full CRUD and edge-case matrix on both resources, reconciled against the Confluence XAA EA spec.
  • Reviewers can exercise it against an XAA-EA-enabled tenant by setting each block on a supported connection/client, then removing it and confirming the plan shows the block gone and the next refresh is clean.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

- Move go-auth0 from v1.45.0 to v1.45.1-0.20260723144816-9d11f57d3d2e,
  which includes the XAA (Cross App Access) SDK types the provider needs.
- Replaces the temporary local replace directive used during development,
  so the module now resolves the SDK from a published commit.
- Add the identity_assertion_authorization_grant nested block to the
  auth0_client resource and client data sources, exposing the ID-JAG
  exchange used for Cross App Access (XAA, EA only).
- Wire expand/flatten for the block and its required active sub-field.
- Actively remove the block when dropped from config by sending a raw
  PATCH {"identity_assertion_authorization_grant": null} via
  fetchNullableFields; the attribute is Optional-only (not Computed) so
  the removal diff surfaces and the typed omitempty update cannot silently
  swallow it.
- Add unit and acceptance tests (create, toggle active, true removal) with
  the recorded HTTP cassette, plus regenerated docs.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.57%. Comparing base (d19822f) to head (5b63e32).
⚠️ Report is 62 commits behind head on main.

❌ Your changes status has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1658      +/-   ##
==========================================
- Coverage   86.98%   86.57%   -0.41%     
==========================================
  Files         186      193       +7     
  Lines       27001    28712    +1711     
==========================================
+ Hits        23486    24858    +1372     
- Misses       2649     2947     +298     
- Partials      866      907      +41     
Files with missing lines Coverage Δ
internal/auth0/client/expand.go 91.04% <100.00%> (+0.22%) ⬆️
internal/auth0/client/flatten.go 91.80% <100.00%> (-1.36%) ⬇️
internal/auth0/client/resource.go 98.33% <100.00%> (+0.06%) ⬆️

... and 21 files with indirect coverage changes

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

@bkiran6398 bkiran6398 changed the title Dxcdt 1696/xaa resource app authorization server xaa resource app authorization server Jul 24, 2026
- Add the cross_app_access_resource_app block so a connection can act as a
  Cross App Access (XAA) resource application, with a required status of
  enabled or disabled. Kept Optional-only (not Computed) so removing the
  block surfaces a diff.
- Actively remove the block on update by sending a raw
  PATCH {"cross_app_access_resource_app": null} before the typed update,
  since the omitempty field is otherwise dropped from the typed request.
- Add the oidc_metadata option (Optional + Computed) across the oidc, okta,
  and samlp option paths, exposing the OIDC discovery document that the
  provider never surfaced before. Computed absorbs the server-populated
  value from discovery_url without a perpetual diff.
- Wire expand and flatten for both fields and cover create, toggle, and
  true removal in acceptance tests plus a flatten unit test.
- Regenerate connection resource and data-source docs.
- Reword the raw-PATCH comment in updateConnection to start with a
  capital letter, satisfying the godot linter.
- Realign the oidc_metadata struct field in optionsSchema so gofmt
  passes.
@bkiran6398 bkiran6398 changed the title xaa resource app authorization server feat: add Cross App Access support to connection and client (EA only) Jul 24, 2026
- Update github.com/auth0/go-auth0 to v1.45.1-0.20260724090452-213cca328f5c
  to pick up the latest Cross App Access SDK changes.
@bkiran6398
bkiran6398 marked this pull request as ready for review July 24, 2026 10:22
@bkiran6398
bkiran6398 requested a review from a team as a code owner July 24, 2026 10:22
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.

2 participants