Dominevo
ReferenceHTTP API

certificates

The certificates router: 5 hand-written core methods, with tier, input and output.

A core router of the hub (not a capability), source server/backend/src/api/core/certificates.router.ts. Its methods are called at /trpc/certificates.<method>. A core method checks only the tier: a scoped token that is signed in reaches every protected method here, unless the method itself refuses it. See How to call and Authorization.

Inputs and outputs are the validation schemas as written in the source.

MethodKindTier
listHttpsCertificatesqueryadmin
renewHttpsOnNodemutationadmin
getMeshCertificatesqueryadmin
renewMeshOnNodemutationadmin
revokeMeshOnNodemutationadmin

certificates.listHttpsCertificates

  • Kind: query — GET /trpc/certificates.listHttpsCertificates
  • Tier: admin — an administrator only
  • Source: server/backend/src/api/core/certificates.router.ts:299
  • Try it: open /system/api-explorer?method=certificates.listHttpsCertificates on your hub

Input

z.void()

Output

z.array(NodeHttpsSchema)

certificates.renewHttpsOnNode

  • Kind: mutation — POST /trpc/certificates.renewHttpsOnNode
  • Tier: admin — an administrator only
  • Source: server/backend/src/api/core/certificates.router.ts:391
  • Try it: open /system/api-explorer?method=certificates.renewHttpsOnNode on your hub

Input

z.object({ nodeId: z.string().min(1), reason: z.string().max(200).optional() })

Output

TlsStatusRowSchema = z.object({ mode: z.enum(['generated', 'uploaded', 'disabled']), leafFingerprintSha256: z.string().nullable(), caFingerprintSha256: z.string().nullable(), validTo: z.string().nullable(), sans: z.array(z.string()), reissueError: z.string().nullable(), restartRequired: z.boolean() })

certificates.getMeshCertificates

  • Kind: query — GET /trpc/certificates.getMeshCertificates
  • Tier: admin — an administrator only
  • Source: server/backend/src/api/core/certificates.router.ts:466
  • Try it: open /system/api-explorer?method=certificates.getMeshCertificates on your hub

Input

z.void()

Output

MeshInventorySchema = z.object({ ca: z.discriminatedUnion('state', [ z.object({ state: z.literal('ready'), subject: z.string(), fingerprintSha256: z.string(), validTo: z.string() }), z.object({ state: z.literal('unavailable'), reason: z.string() }) ]), revokedSerials: z.array(z.string()), registryAvailable: z.boolean(), listener: z.discriminatedUnion('state', [ z.object({ state: z.literal('open') }), z.object({ state: z.literal('closed'), reason: z.string(), since: z.number() }), z.object({ state: z.literal('not-started') }) ]), nodes: z.array(MeshNodeSchema) })

certificates.renewMeshOnNode

  • Kind: mutation — POST /trpc/certificates.renewMeshOnNode
  • Tier: admin — an administrator only
  • Source: server/backend/src/api/core/certificates.router.ts:531
  • Try it: open /system/api-explorer?method=certificates.renewMeshOnNode on your hub

Input

z.object({ nodeId: z.string().min(1) })

Output

MeshRenewResultSchema = z.discriminatedUnion('ok', [ z.object({ ok: z.literal(true), nodeId: z.string(), oldSerial: z.string().nullable(), newSerial: z.string(), newNotAfter: z.number() }), z.object({ ok: z.literal(false), nodeId: z.string(), stage: z.enum(['prepare', 'issue', 'install', 'reconnect', 'confirm']), reason: z.string(), keptPreviousLeaf: z.boolean() }) ])

certificates.revokeMeshOnNode

  • Kind: mutation — POST /trpc/certificates.revokeMeshOnNode
  • Tier: admin — an administrator only
  • Source: server/backend/src/api/core/certificates.router.ts:570
  • Try it: open /system/api-explorer?method=certificates.revokeMeshOnNode on your hub

Input

z.object({ nodeId: z.string().min(1) })

Output

MeshRevokeResultSchema = z.object({ nodeId: z.string(), revokedSerials: z.array(z.string()), disconnected: z.number().int(), next: z.string() })