Skip to content

Integration

Licensing is unusually decoupled: it makes no outbound HTTP calls to sister services and consumes no events. Its entire cross-service contract is the signed certificate it writes to Redis, which @nx/core's LicenseMiddleware (running inside every other service) reads.

1. Sister Services

Direction: calls / called by / bidir.

SisterDirectionSurfaceContractAuthFailure ModeIdempotency
@nx/identityJWKS endpoint (APP_ENV_JWKS_REST_PATH)JWT verification (VerifierApplication)— (public keys)request fails 401 if JWKS unreachablen/a
@nx/coreIn-process library — schemas, repositories, LicenseCertSignerHelper (sign), LicenseMiddleware (verify)compile-time dependencyn/an/a
All verifier services (sale, commerce, inventory, …)Redis key lic:certs:<type>:<id>cert envelopeEd25519 signature + AES secretfail-open → null license contextlast-write-wins

There is no licensing client SDK called by sisters at runtime. APP_ENV_LICENSING_SERVICE_BASE_URL exists in core's env registry but the runtime licensing checks are done from the cached certificate, not by calling licensing.

2. External Systems

SystemDirectionSurfaceAuthFailure Mode
Redis (write) / (read by consumers)SET/GET lic:certs:*Redis passwordwrite failure logged; cert still stored on License.certificate row
PostgreSQLlicensing schema via DrizzleDB credentialstransactional; rollback on error

3. Critical Cross-Service Flows

3.1 License state change propagates to all consumers

StepDetail
1–2Suspend transaction commits, then publishCertificate() re-signs with the new status
3New cert overwrites the Redis key (last-write-wins)
4–6Next consumer request pulls the fresh cert; no call to licensing needed

Propagation lag = up to the existing cert's remaining TTL only if re-publish is skipped (e.g. keys not configured). With keys configured, propagation is immediate on the next consumer request.

4. Contract Stability

SurfaceStabilityVersioning
REST /v1/api/licensing/*stableURL /v1/
Redis cert key lic:certs:<type>:<id>stable— (key shape fixed in both signer + middleware)
Cert envelope alg fieldstableaes-256-gcm+ed25519; verifier rejects unknown alg
Cert payload ILicenseCertificatePayloadstableadditive only (no version field — coordinate changes across @nx/core)

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.