SecretUseRequest network.secret-use-request@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-request.v1.json
network.secret-use-request@1 (ADR-056): what a first-party service sends to POST /internal/secrets/use with network.secret.use. sign asks for HMAC-SHA256 of message under the secret (the value never leaves Network); reveal asks for the value, to send to origin. Either needs a grant of that secret to the calling service for that purpose (and origin).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
project_id | string | yes |
| |
environment | enum | yes |
| |
name | string | yes |
| |
purpose | enum | yes |
| |
message | string | sign: the exact text to sign (for a webhook delivery, "<timestamp>.<raw body>"). Not allowed with reveal. |
| |
origin | string | reveal: the https origin the value will be sent to; the grant must list it. Not allowed with sign. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: reveal
{
"project_id": "prj_01M4XE52PGJDVR1KZ1AG9VYW3Q",
"environment": "sandbox",
"name": "api_token",
"purpose": "reveal",
"origin": "https://api.example.com"
}Valid: sign
{
"project_id": "prj_01M4XE52PGJDVR1KZ1AG9VYW3Q",
"environment": "production",
"name": "webhook-signing",
"purpose": "sign",
"message": "1760504400.{\"state\":\"succeeded\"}"
}Rejected: reveal-with-message
{
"project_id": "prj_01M4XE52PGJDVR1KZ1AG9VYW3Q",
"environment": "production",
"name": "api_token",
"purpose": "reveal",
"origin": "https://api.example.com",
"message": "x"
}Rejected: reveal-without-origin
{
"project_id": "prj_01M4XE52PGJDVR1KZ1AG9VYW3Q",
"environment": "production",
"name": "api_token",
"purpose": "reveal"
}Rejected: sign-without-message
{
"project_id": "prj_01M4XE52PGJDVR1KZ1AG9VYW3Q",
"environment": "production",
"name": "webhook-signing",
"purpose": "sign"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('network.secret-use-request@1', value); // { valid, errors: [{ path, message }] }