Skip to content

The dip command ​

dip is a client for the DIP REST API, plus local tools for signing, normalizing, verifying and conformance testing. It never holds state: anything that changes state goes through the API.

Configuration ​

SettingFlagEnvironmentRequired for
Server base URL--urlDIP_URLserver commands
API key--api-keyDIP_API_KEYserver commands
Machine-readable output--jsonall commands

Commands ​

CommandNeeds serverPurpose
dip authority create <file>noValidate a declaration and print it canonically.
dip authority sign <file> --key <pem>noSign a declaration with an Ed25519 key.
dip authority inspect <id> [--version N]yesRead a published authority.
dip authority revoke <signed-revocation>yesPublish a signed revocation.
dip request normalize <file>noCanonicalize a request and compute its digest.
dip authorize <request>yesAuthorize. Prints ALLOW or DENY.
dip approval create <file>yesRequest an approval.
dip approval approve <decision> / rejectyesRecord an approver's signed decision.
dip approval inspect <id>yesRead an approval's state.
dip execute <{request, decision}>yesRun through the protected boundary.
dip evidence inspect <id>yesRead an evidence record.
dip verify <bundle> --trust <file>noVerify an exported bundle independently.
dip ledger inspect [--offset N] [--limit N]yes, admin keyList evidence.
dip ledger verify [--head H]yes, admin keyVerify the server's ledger.
dip conformance run <suite-dir>noRun the conformance fixtures against the reference implementation.

Exit codes ​

CodeMeaning
0Success, ALLOW, VALID, executed (or duplicate), all conformance cases pass
1DENY, INVALID, refused or failed execution, a conformance failure
2INCOMPLETE or UNVERIFIABLE
3Usage error, or input rejected (validation failed, unknown command, missing credentials)
4Server unreachable, or the server returned 5xx

Scripts should treat 1 as a business outcome and 3 or 4 as a fault.

Examples ​

bash
dip authority sign declaration.json --key issuer.pem > authority.json
dip request normalize request.json > normalized.json
DIP_URL=https://dip.example.com DIP_API_KEY="$KEY" dip authorize request.json
dip verify bundle.json --trust trust.json --json
dip conformance run conformance/

Backups ​

Backups must be taken from a stopped server. A running server holds the data directory open, and copying it while it writes can produce an inconsistent copy. A backup is refused if its evidence chain does not verify.

Verification uses a scratch copy in the system temporary directory, which is removed afterwards. To detect a truncated tail, pass the head recorded outside the system with --head. Without it, the manifest is trusted for its head.

Limits ​

  • Key files are read from disk. Keep them out of version control.
  • The CLI does not retry. A 5xx or unreachable server returns exit 4.

Released under the Apache License 2.0.