openvibers/openvibe.network Commits

Network: Watch may use project secrets (network.secret.use default grant) (#198)

OP OpenVibers committed 29 days ago · 4c61779b64 · 1 file, +3 −0

**Watch may use project secrets (ADR-056, Contracts 0.179.0).**

One default grant: `watch` → `network.secret.use` (audience openvibe.network). Watch reveals a source credential to its source URL's origin, and signs a webhook action, with the project secret a watch names (`secret_ref`). The capability is only the door: each secret's project grant decides which secret, for which purpose and for which origin, as for Actor.

The grant tests (t18, services resource grants, internal projects, project secrets) pass.

Changes

ddiff --git a/server/identity/principals.js b/server/identity/principals.js
iindex ca248d3d..eb0a0fd7 100644
---- a/server/identity/principals.js
++++ b/server/identity/principals.js
@@@ -443,6 +443,9 @@ const DEFAULT_GRANTS = [
// Project secrets (ADR-056): Actor signs a task's webhook deliveries with the project secret its secret_ref names,
// when the project granted that secret to actor for sign. The capability is the door; each secret's grant decides.
['actor', 'network.secret.use', SELF_AUDIENCE, []],
++ // Watch reveals a source credential to its source's origin, and signs a webhook action, with a project secret its
++ // watch names (Contracts 0.179.0); each secret's project grant decides.
++ ['watch', 'network.secret.use', SELF_AUDIENCE, []],
];
// Grants withdrawn by decision; applied at every boot so an old default can't come back.