openvibers/openvibe.network Commits

Network: Space and Watch may record usage with Billing (#182)

OP OpenVibers committed 30 days ago · 4ab6fd7fcc · 1 file, +4 −0

Plan T5 step 14: Space and Watch record usage with OpenVibe.Billing, as AI, Events and Media already do.

- `space` gets `billing.usage.record` (audience `openvibe.billing`) for its daily gb-month readings per Network project (Space#43).
- `watch` gets the same for one reading per completed check (Watch#54).
- Usage only: neither holds a money capability.

**Tests:** `principals` passes.

Changes

ddiff --git a/server/identity/principals.js b/server/identity/principals.js
iindex 9941dcc0..094e96c8 100644
---- a/server/identity/principals.js
++++ b/server/identity/principals.js
@@@ -393,6 +393,10 @@ const DEFAULT_GRANTS = [
['ai', 'billing.usage.record', 'openvibe.billing', []],
['events', 'billing.usage.record', 'openvibe.billing', []],
['media', 'billing.usage.record', 'openvibe.billing', []],
++ // The same for Space (gb-month of a Network project's deploy bytes, Space#43) and Watch (one reading per completed
++ // check, Watch#54). Recording usage only.
++ ['space', 'billing.usage.record', 'openvibe.billing', []],
++ ['watch', 'billing.usage.record', 'openvibe.billing', []],
];
// Grants withdrawn by decision; applied at every boot so an old default can't come back.