Skip to content

Golden-reference parity

The emulator’s fidelity is tracked mechanically against canonical references, not by eyeballing docs. Three golden references — one per protocol surface — are committed under e2e/golden/, and the parity tests in internal/server/golden_parity_test.go boot the emulator in-process and assert its live responses conform. They run in the normal go test ./... job, so drift fails CI.

ReferenceSurfaceSource of truth
oidc-discovery.golden.jsonOIDC/OAuth discovery documentThe real Entra discovery doc — login.microsoftonline.com/common/v2.0/.well-known/openid-configuration
graph-resources.golden.jsonMicrosoft Graph v1.0 resource shapesThe official Graph OpenAPI — microsoftgraph/msgraph-metadata openapi/v1.0
scim-schemas.golden.jsonSCIM 2.0 schemas & messagesRFC 7643 (Core Schema) + RFC 7644 (Protocol)

Each carries a source and captured date; refresh instructions are in e2e/golden/README.md.

The emulator is a deliberate localhost subset of Entra, not a byte-identical clone — so the tests assert contract conformance, and the honest status is a matrix of matches / subset / localhost-variant / out-of-scope, never a false “100% identical.”

SurfaceAssertionStatus
OIDC — required fieldsall 14 client-critical fields advertised✅ matches
OIDCsubject_typesequals ["pairwise"]✅ matches
OIDCid_token_signing_algincludes RS256✅ matches
OIDCresponse_types⊆ Entra’s set (emulator: ["code"])◑ subset (code flow only)
OIDCresponse_modes{query, fragment, form_post}✅ matches
OIDCscopes / claimsincludes the OIDC/Entra core✅ matches
OIDC — endpointssame fields, localhost URLs◑ localhost-variant
OIDCkerberos_endpoint, mtls_*, cloud_*, …not emulated○ out-of-scope (reported)
Graph — user/group/application/servicePrincipalemitted property set exactly equals the golden set (canonical Graph names, no drift)✅ no drift
Graph — full entity coverageonly the emulated property subset◑ subset
SCIM — schema URNsexact RFC 7643/7644 URNs✅ matches
SCIMListResponse / User / Grouprequired attributes + meta.resourceType present✅ matches

Legend: ✅ full parity · ◑ intentional subset/variant · ○ out-of-scope (surfaced, not silently dropped).

  • OIDC (TestGoldenParityOIDCDiscovery) — fetches the discovery document and checks required fields, then that each protocol enum is a compatible subset of Entra’s (never a value Entra doesn’t support). Entra-only fields the emulator omits are logged as documented divergences, not failed.
  • Graph (TestGoldenParityGraph) — for each resource, asserts the live property set exactly equals the golden set. Add, rename, or drop a property and the test fails until the golden is reconciled — a hard drift guard against inventing non-Graph fields.
  • SCIM (TestGoldenParitySCIM) — asserts responses carry the verbatim RFC schema URNs and the required attributes (schemas, id, userName/displayName, meta.resourceType, ListResponse envelope).

The full Graph OpenAPI is tens of megabytes and the discovery doc is host-specific — vendoring them whole would be noise, not signal. Instead each reference captures the contract the emulator commits to (the fields, enums, and URNs clients actually depend on), which is small, reviewable, and refreshable in one commit. When Entra adds a field or you emulate a new property, you update the golden reference and the diff shows exactly what parity changed.