Health and readiness
GET /health reports liveness. GET /readyz runs the checks below. It answers 503 when a check other than src_mq reports down or degraded, and while the service shuts down. The src_mq check makes /readyz answer 503 only when Lerian SRC refuses the IBM MQ configuration. The pod stays in rotation while IBM MQ is unavailable, and consultations stay pending.
GET /version returns the build version of the service.
While Lerian SRC waits for the license server to answer for LICENSE_KEY, it answers /health with 200, and every other route with 503. /readyz then reports the license check as down. A key that the license server refuses stops the boot.
IBM MQ
Lerian SRC connects to your institution’s own IBM MQ queue manager. That queue manager reaches BACEN over the RSFN. Set
SRC_MQ_HOST, SRC_MQ_PORT, SRC_MQ_CHANNEL, and SRC_MQ_QUEUE_MANAGER. Lerian SRC applies no default for the port and the channel, so ask your IBM MQ team for them.
Lerian SRC derives the queue names from SRC_CNPJ_BASE8:
- Send queue:
QR.REQ.<CNPJ base>.00038166.03. - Receive queue:
QL.RSP.00038166.<CNPJ base>.03.
SRC_MQ_SEND_QUEUE and SRC_MQ_RECEIVE_QUEUE only when your queue manager uses other names.
While SRC_MQ_BACKOUT_THRESHOLD is above 0, a message that fails delivery that many times becomes an orphan_response operator case. The default threshold is 5.
Lerian SRC keeps the message in the case, and then takes it off the receive queue. If it cannot keep the message, the message stays at the head of the receive queue. After you fix the cause, for example a replaced BACEN certificate, replay the case. See Operator cases.
When no IBM MQ call completes for SRC_MQ_STALE_AFTER, 30 seconds by default, the src_mq check reports degraded.
The Lerian SRC image runs on linux/amd64.
Credentials and keys
Lerian SRC signs each message it sends to BACEN with your institution’s private key. It uses BACEN’s certificate to protect each message for BACEN. Lerian SRC uses the private key through PKCS#11 or KMIP. When you configure both, it uses PKCS#11. Set
SRC_LOCAL_CERT_FILE to your institution’s certificate for that key, and SRC_BACEN_CERT_FILE to BACEN’s certificate. After you replace BACEN’s certificate, restart Lerian SRC.
With KMIP, Lerian SRC proves both keys when it opens the connection. It signs a test value with the signing key, and it checks that the decryption key can decrypt. When a key fails either check, Lerian SRC starts without the key device. It sends no consultation to BACEN, and the custody check reports down.
GET /v1/src/credentials returns the status of the credential.
Personal data
Reads of consultations, lists, and searches return the CPF or CNPJ in clear, in
document. The evidence trail returns the full record, including the document. The accepted event carries the masked document, in documentMasked. Lerian SRC records each read of the evidence trail in the same transaction as the read. If it cannot record the read, the read fails.
A consultation search with a document filter also records who searched, a keyed index of the document, and the period, in the same transaction as the search. If Lerian SRC cannot record it, the search fails. A consultation list, or a consultation search without a document, records nothing.
Operator cases
GET /v1/src/operator/cases lists the open cases, newest first. Send status=closed for the closed cases, or status=all for both. How Lerian SRC works explains the legs.
Close a case with the operation of its leg:
A
budget_exhausted case has closable set to false. A closure of a case that is not open returns 404 with code SRC-0301.
An orphan_response case can also hold a message that Lerian SRC parked after repeated failures. To process that message again, send POST /v1/src/operator/orphan-responses/{caseId}/replay. It needs the operator close permission.
- Lerian SRC sends the message through the same path as a message from BACEN, and records the answer at the time the message first arrived.
- The case closes only when Lerian SRC processed the message.
- A message that is refused again returns
422with codeSRC-0002. The case stays open, andsummary.errorin the list shows the reason. - A case that is not open returns the closure on record, and Lerian SRC processes nothing. An unknown case returns
404with codeSRC-0301. - A deployment with no inbound path returns
503with codeSRC-1002.
invalid_outbound case closes by itself when BACEN answers an attempt that Lerian SRC sent before it refused a retry. The case then shows SRC0001R1 in resolvedBy. If BACEN rejects that attempt, the case stays open, and the listing shows the BACEN code in bacenRejectionCode.
Watch two numbers on GET /v1/src/dashboard/consultations:
openOperatorCases: the operator cases that are open now.pendingBeyondExpected: the consultations that staypendinglonger thansrc.pending.alert_threshold, 15 minutes by default.
Runtime configuration (Systemplane)
Lerian SRC serves two runtime configuration admin APIs.
/v1/system serves the namespace runtime_config. /v1/client-system serves the namespace client_policy, which holds the settings of your institution. Authentication and permissions names the permissions they need. Each admin API accepts 30 requests per minute from each client IP address.
A change takes effect without a restart. The tables list the keys that tune consultations, retries, rate limits, and retention. See System plane.
Namespace client_policy, at /v1/client-system
Namespace
runtime_config, at /v1/system
Storage, outbox and retention
Lerian SRC stores its state in PostgreSQL. Events leave through an outbox table, in the same transaction as the change they report. With no broker, the events stay pending in the outbox. When the broker refuses an event, Lerian SRC retries it for 7 days. The retention sweep deletes idempotency keys older than
src.retention.transient_purge_age, 24 hours by default.
Lerian SRC does not apply its own database schema. The br-src-migrations image applies it. Run that image before you start the br-src image.
Metrics and tracing
Set
ENABLE_TELEMETRY=true to export traces and metrics over OTLP to OTEL_EXPORTER_OTLP_ENDPOINT. Lerian SRC has no /metrics endpoint. See Observability for the platform view.
Deployment posture
DEPLOYMENT_MODE takes local, byoc, or saas. One deployment serves one institution.
Lerian SRC does not start when its PostgreSQL role is a superuser, or is or belongs to the role that owns the evidence tables, the database, or their schema. Run the br-src-migrations image as the owner, and run Lerian SRC as a login role that is a member of br_src_app, the role that the migrations grant. This check applies when ENV_NAME is not development, develop, or local, and always when DEPLOYMENT_MODE is saas. An unset ENV_NAME also triggers it.
Environment variables defines a production deployment and marks each setting that it requires. A missing required setting stops the boot.
