Repository navigation
feat(mgmtapi): refresh the Auth0 Management API skeleton to the current spec - #97
Merged
Merged
Conversation
OpenAPI 3.1 lets a description sit beside a $ref. kin-openapi keeps that sibling in an unexported field, so stripUpstreamProse never saw it and 36 Auth0 descriptions would have reached the vendored skeleton. Drop them from the raw JSON before loading, so NOTICE's no-prose claim holds.
…nt spec
Re-vendored from Auth0's published openapi.json with make refresh-spec:
221 -> 261 paths, 406 -> 485 operations. 81 operations are new (among them
experimentation, agents, client-profiles, rate-limit-policies, org clients
and groups, effective roles and permissions, network ACLs, and /search on
clients, client-grants, organizations and resource-servers). Auth0 dropped
the two /users/{id}/federated-connections-tokensets operations.
Event and stream ids are now 22 characters after evt_/est_ (were 16), so
test fixtures and the README example are padded to match.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
+ Coverage 85.18% 85.65% +0.47%
==========================================
Files 81 81
Lines 5062 5082 +20
==========================================
+ Hits 4312 4353 +41
+ Misses 532 511 -21
Partials 218 218
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
The generated-spec diffs were not supplied for compatibility review, and the public ID helpers remain incompatible with the refreshed schemas.
1 open issue
What changed in this PR
This PR refreshes the spec-driven Management API coverage and updates event fixtures for Auth0’s stricter ID requirements.
Changes:
- Documents expanded coverage of approximately 480 Management API operations.
- Removes descriptions beside
$refbefore loading the upstream spec, with a regression test. - Updates event and stream ID examples and fixtures to use 22-character suffixes.
| File | Description |
|---|---|
| README.md | Updates operation counts and event ID examples. |
| pkg/auth0mock/events_test.go | Updates client event payload fixtures. |
| internal/spec/validator_test.go | Updates the valid event validation fixture. |
| internal/mgmtapi/mount_test.go | Updates the event-header matching fixture. |
| internal/admin0/events_test.go | Updates the valid admin event fixture. |
| features/Events.feature | Updates event and stream IDs across scenarios. |
| docs/ARCHITECTURE.md | Updates the documented operation count. |
| CONTRIBUTING.md | Updates the generic handler’s documented coverage. |
| cmd/genopenapi/main.go | Strips $ref sibling descriptions before loading. |
| cmd/genopenapi/main_test.go | Adds coverage for stripping sibling descriptions. |
Review effort: Balanced
Auth0's current spec requires evt_ and est_ ids with 22 characters after the prefix. NewEventID and NewStreamID still produced 16, so events built with them were rejected by /admin0/events.
Pins the list branch of dropRefSiblingDescriptions with a oneOf entry, and checks that runStrip reports a missing raw file, a raw file that isn't JSON, and an output path it can't write.
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
The vendored Management API skeleton was last refreshed in May. Auth0's spec has grown since then, so
/api/v2was missing 81 operations that real tenants serve. Requests to them got a 404 from the mock, and their request bodies weren't validated. This PR re-vendors the skeleton from Auth0's currentopenapi.jsonwithmake refresh-spec(downloaded by hand, asCONTRIBUTING.mdasks).Paths: 221 → 261. Operations: 406 → 485.
New operations (81):
/experimentation/*(experiments, feature flags and variations, segments)/organizations/{id}/clients, org groups and group roles, member effective roles, role members/users/{id}/consent-signing-keys,effective-permissions,effective-roles/agents,/client-profiles,/rate-limit-policies(full CRUD each)/guardian/settings,/guardian/factors/{email,phone}/settings/groups/{id}/roles,/roles/{id}/groups/keys/network-aclsGET …/searchon clients, client-grants, organizations and resource-servers/attack-protection/phone-provider-protection/connections/{id}/directory-provisioning/synchronized-groupsRemoved:
GET /users/{id}/federated-connections-tokensetsandDELETE …/{tokenset_id}. Auth0 no longer lists them.Stripper fix. OpenAPI 3.1 lets a
descriptionsit next to a$ref. kin-openapi keeps that in a field the stripper couldn't reach, so 36 Auth0 descriptions would have been committed.genopenapinow drops them before loading, and a new test covers it. The skeleton has no descriptions,externalDocsorx-fields; summaries are kept on purpose, as before.Docs: endpoint counts in README,
CONTRIBUTING.mdanddocs/ARCHITECTURE.mdgo from ~400 to ~480.evt_/est_. They used to be 16. That's Auth0's new schema, andPOST /admin0/eventsvalidates against it, so a test that pushes a 16-character id now gets 400invalid_event. Fixtures and the README example are padded to 22.no_match, with the usual near-miss hint.patternconstraints, mostly on the new endpoints. WithSPEC_VALIDATION_STRICT=true(the default), a body that Auth0 would now reject is rejected by the mock too.🏷 Type of change
🔗 Related issues
No issue. This came from the gap analysis of the mock: the skeleton had drifted from Auth0's spec.
✅ How to verify
make lint make test make test-featuresTo reproduce the refresh, download
https://auth0.com/docs/api/management/openapi.jsontoapi/auth0-management-api.raw.json(gitignored), then runmake refresh-spec.git diffshould be empty.📋 Checklist
features/*.feature)docs/COOKBOOK.md,docs/ARCHITECTURE.md, or godoc)CHANGELOG.mdfrom it; don't hand-edit the changelog)make lint,make test,make test-featurespass locally🤖 Generated with Claude Code