Skip to content

Integration

1. Sister Services

SisterDirectionSurfaceAuthFailure ModeIdempotency
All VerifierApplication (sale, inventory, commerce, finance, payment, signal, etc.) (sister pulls)HTTP GET /jw-certsnone (public JWKS)retry; cache previous JWKS until reachableJWKS rotation aware via kid
All sisters (sister calls)HTTP — PolicyDefinitionService lookup endpointsJWTsister caches in Redisper (role, action, subject)
@nx/sale (Customer queries) (sale reads)HTTP — CustomerController CRUD via cross-package repositoryJWT or BASICretrymerchant-scoped
@nx/signalWebSocket emission via ApplicationWebSocketComponentbest-effortbroadcast

Identity does not directly call sister services. The pull-based JWKS model is the trust foundation.

2. External Systems

SystemDirectionSurfaceAuthFailure Mode
SMTP (Gmail / merchant SMTP)NodemailerComponentSMTP credentials from envretry via internal queue executor
VN Pay SMSMQSMSComponentprovider config from Configuration tableper-merchant config; queue retries
RedisOTP state, BullMQ (mail/SMS queue), auth cachepassword from envservice starts without it (auth cache disabled); OTP requires Redis

3. Critical Cross-Service Flows

3.1 Sister boot — JWKS bootstrap

Sister caches indefinitely; refreshes only when a JWT carries an unknown kid.

3.2 Authenticated request flow (sister side)

3.3 Permission check (cross-service)

In current BANA setup, the PolicyDefinition table is shared (single DB), so sisters typically read directly via PolicyDefinitionRepository rather than HTTP-calling identity. Identity owns the write path for policy mutations.

3.4 Sign-up → default role assignment

4. Contract Stability

SurfaceStabilityVersioning
GET /jw-certsstableRFC 7517 JWKS format
JWT payload { userId, roles, organizers, merchants }stableadditive only
HTTP /v1/api/identity/*stableURL prefix /v1/
Configuration table (mail/SMS/OTP)stableadditive (new codes)
PolicyDefinition tablestableadditive

5. Crosscutting concerns

ConcernHandling
TrustAll sister services trust the /jw-certs issuer; key rotation handled by kid
Single key vs per-merchantSingle signing key today; multi-tenant key isolation is out of scope (see purpose & scope)
Service-to-serviceBASIC auth strategy supported for cross-package calls
Snapshot fieldsJWT payload roles/orgs/merchants are a snapshot at issue time — clients should refresh on permission changes

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