Decrypt a payload
Requires the decrypt action on this configuration. The inverse of
encrypt, with the same two modes and the same forwarding behaviour.
Reading data already protected is always served, whatever the license
says.
An envelope is refused unless it was produced in the configuration it is
presented to, independently of the authentication tag, and unless the
caller holds the clearance the record carries. Envelopes in the earlier
qanapi: format are refused as a format error rather than attempted and
failed.
X-Qanapi-Classification has no effect here: a record’s classification
is read from the record.
Authorizations
A machine credential, qk_ followed by its secret. Only a hash of the
secret is stored, so a key is displayed exactly once, when it is created
or rotated. A key reaches only the configurations it is linked to.
It may also be sent as Authorization: Bearer qk_..., which is
recognised by the prefix.
Headers
Comma-separated dot paths to encrypt or decrypt, for example
ssn,user.address.postcode. Absent in whole-body mode. A path that
matches nothing is skipped unless X-Qanapi-Require-Fields is set.
A numeric segment indexes one element of an array, so items.0.card
reaches exactly that element. A segment that is not a number, applied to
an array, is mapped over every element instead: items.card reaches the
card of each object in items, and each one counts separately towards
X-Qanapi-Action-Count.
Naming an array itself encrypts it whole, as one value, rather than element by element.
"ssn,user.dob,items.card"
Treat the whole body as one payload. Any of true, 1, yes or on
turns it on; anything else, or the header's absence, leaves field mode
in effect.
"true"
Alternative spelling of whole-body mode. Either spelling of the value selects it; any other value leaves field mode in effect.
full_body, full-body Fail the request when a named field path matched nothing, rather than
returning the document unchanged. Off by default, and turned on by any
of true, 1, yes or on.
Worth setting in any caller that would rather hear about a typo than
store plaintext: without it, a mistyped path returns the original body
with a success status, and only X-Qanapi-Action-Count: 0 tells the two
apart. Nothing is changed when the request fails this way.
"true"
Forward the processed payload to this absolute URL and relay the answer
back, with its own status, body and headers. Must be http or https.
Every request header travels except x-qanapi-*, authorization and
the hop-by-hop set. Restricted by an allowlist where the installation
sets one.
"https://payments.internal/charge"
Path Parameters
The configuration's proxy slug. Sixteen random lowercase letters and digits unless one was pinned at creation.
"952zpx6vyig3sdyp"
Body
A JSON object to decrypt fields on. A maximum depth of 32 is allowed.
Response
The plaintext, in the shape it was encrypted from. In field mode the
document is returned as JSON. In whole-body mode the original bytes
are returned under a content type inferred from them:
application/json, application/xml, text/plain or
application/octet-stream.
The response is of type object.