SecretUseResult network.secret-use-result@1
Generated at from
openvibe-contracts v0.177.0 and
openvibe-sdk v0.44.0.
- Version
- 1.0.0
- Owner
- network
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-056
- Schema
https://openvibe.network/contracts/network/secret-use-result.v1.json
network.secret-use-result@1 (ADR-056): POST /internal/secrets/use's answer — the secret's name and version with the HMAC-SHA256 signature (sign) or the value (reveal). Sent with Cache-Control: no-store; a caller keeps a revealed value only as long as the request it is for.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
name | string | yes |
| |
version | integer | yes |
| |
purpose | enum | yes |
| |
signature | string | sign: the lowercase hex HMAC-SHA256 of the message under the secret. |
| |
value | string | reveal: the value. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: signature
{
"name": "webhook-signing",
"version": 2,
"purpose": "sign",
"signature": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}Valid: value
{
"name": "api_token",
"version": 1,
"purpose": "reveal",
"value": "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"
}Rejected: short-signature
{
"name": "webhook-signing",
"version": 2,
"purpose": "sign",
"signature": "abc"
}Rejected: sign-with-value
{
"name": "webhook-signing",
"version": 2,
"purpose": "sign",
"signature": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"value": "x"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('network.secret-use-result@1', value); // { valid, errors: [{ path, message }] }