Skip to content

API Events

Licensing has no asynchronous messaging surface. Application.configureComponents() registers only a Redis cache (useCacheRedis). There is no Kafka producer/consumer, no BullMQ queue, and no WebSocket emitter. The @platformatic/kafka and bullmq dependencies in package.json are unused.

1. Inbound - Kafka

TopicProducerHandlerIdempotency KeyFailure Mode
None----

2. Outbound - Kafka

TopicTriggerConsumersPayload Schema
None---

3. Inbound - BullMQ

QueueJob TypeProducerHandlerConcurrency
None----

4. Outbound - BullMQ

QueueJob TypeTriggerConsumer Service
None---

5. WebSocket Emissions

TopicRoomTriggerAction Enum
None---

6. Payload Schemas

The only cross-service payload is the license certificate written to Redis. It is not a message-bus event - it is a key the consumer pulls on demand via @nx/core's LicenseMiddleware.

Redis certificate channel

AspectValue
ProducerLicensingBaseService.publishCertificate() - redis.client.set(key, cert, 'EX', certTtl)
Consumer@nx/core LicenseProvider (a.k.a. LicenseMiddleware) - redis.client.get(key)
Keylic:certs:<entityType>:<entityId> (e.g. lic:certs:Merchant:123)
ValueBase64 string envelope (AES-256-GCM payload + Ed25519 signature)
TTLAPP_ENV_LICENSING_CERT_TTL_SECONDS (default 86400)
ts
// Decrypted certificate payload - ILicenseCertificatePayload (@nx/core)
export interface ILicenseCertificatePayload<FeaturesType = Record<string, unknown>> {
  license: { id: string; key: string };
  entity: { type: string; id: string };
  status: string;             // LicenseStatuses
  tier: string;               // policy.type (PolicyTypes)
  features: FeaturesType;      // resolved PolicyFeature map (with override merge)
  activation: { limit: number } | null;
  expiresAt: string | null;
  issuedAt: string;
  certExpiresAt: string;       // independent of license.expiresAt - drives Redis EX
}
ts
// On-the-wire envelope - ICertificateEnvelope (@nx/core)
export interface ICertificateEnvelope {
  enc: string;  // AES-256-GCM ciphertext of JSON payload
  sig: string;  // Ed25519 signature (base64url) over "MESSAGE_PREFIX:enc"
  alg: string;  // "aes-256-gcm+ed25519"
}

7. Idempotency & Ordering

SurfaceDeliveryOrderingRecovery
Redis certificatelast-write-wins (single key per entity)n/a (latest state only)Re-published on every lifecycle mutation; expires after TTL → consumer sees null (fail-open) until re-issued

When the cert is missing or fails verification, LicenseMiddleware is fail-open: it sets the license context to null (treated as "unknown", not "unlicensed").

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