Sign OPA bundle
opa_bundle_signSigns an OPA bundle directory in place by writing .signatures.json, so the bundle can later be verified with OPA.
Instructions
Sign a bundle directory with opa sign. A directory is signed in place: .signatures.json is written into it. OPA 1.23 and later name the files relative to the bundle root, the folder holding .manifest, so the directory can be moved or renamed; earlier versions name them <directory name>/<file>, so it must keep its name. Either way it verifies with opa_bundle_verify, or with opa build or opa run --bundle <name> from its parent, under an OPA on the same side of 1.23 as the one that signed it. A directory whose .manifest sits in a subfolder is refused under OPA 1.23 and later, which roots the bundle there. An archive is refused: OPA reads the signature from inside it, so a signed archive comes from opa_bundle_build with signingKey. The key is a PEM private key (RSA or ECDSA); for HMAC algorithms pass a file holding the secret. Extra claims such as keyid and scope come from claimsFile. Returns the path written, the algorithm, and the number of files covered.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"bundle": "<bundle>",
"signingKey": "<signingKey>"
},
"name": "opa_bundle_sign"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bundle | Yes | Path to a bundle directory. Must be inside an allowed root. An archive is refused, since OPA reads the signature from inside it; build a signed archive with `opa_bundle_build` and `signingKey`. | |
| claimsFile | No | Path to a JSON file of extra claims to sign, such as {"keyid": "...", "scope": "..."}. Must be inside an allowed root. | |
| signingAlg | No | Signing algorithm: RS256 (default), RS384, RS512, PS256, PS384, PS512, ES256, ES384, ES512, HS256, HS384, HS512. | |
| signingKey | Yes | Path to the PEM private key (RSA or ECDSA), or for HMAC algorithms a file holding the secret. Must be inside an allowed root. |