Agora

You're viewing the docs for Crypto 0.x. The latest is 1.x (rc). Go to the 1.x (rc) docs

Diagnostics events

What crypto publishes on the @adonis-agora/diagnostics bus, and from which process.

With @adonis-agora/diagnostics installed, crypto publishes every key operation on agora:crypto:<event>. Telescope records them as diagnostic entries tagged lib:crypto and app:<partition>, and you can listen with onDiagnostic('crypto', …). Without diagnostics, nothing is published.

start/diagnostics.ts
import { onDiagnostic } from '@adonis-agora/diagnostics'

onDiagnostic('crypto', 'denied', (event) => {
  logger.warn({ app: event.app, ...event.payload }, 'crypto call refused')
})

Events

EventPayload
encrypt, decrypt, rewrap, datakey, sign, verify, hmacapp, key, version?, outcome (ok/error), errorCode?, actor, clientId?, durationMs, bytes?
keys.create, keys.rotate, keys.policy, keys.delete, keys.exportthe same
deniedapp, op (the event it would have been), key?, capability, errorCode: 'forbidden', actor, clientId?
subjects.forgetapp?, key (the subject key), outcome, errorCode?, dataKeys?, durationMs
subjects.cacheapp?, key, op (encrypt/decrypt), outcome: 'miss'

bytes is the size of the plaintext (or the signed message). A payload never carries plaintext, ciphertext, key material, AAD or the audit context, and an error is reported by its code only. Reads (keys.list, keys.get, public keys, the audit) publish nothing.

Which process publishes

The process that runs the operation publishes it, with app on the envelope set to the partition it acted on:

  • standalone: the app itself, with its own app.
  • control plane: the server, with app = the tenant named by the verified token (or the app picked in the console).
  • tenant: nothing for the operations it sends to the server (the server publishes those). It publishes only what the server cannot see: subjects.cache when a subject data key was not in its cache and had to come from the server (cache hits are not published), and subjects.forget for the data keys it removes from its own database.

On this page

Partner

Your product as the official integration for Crypto, right here.

Become a partner →