refactor: extract the RPC guarded(permission, action) helper into @octant/authentication #51

Closed
opened 2026-07-04 12:11:46 +00:00 by momsse · 0 comments
Owner

Migré depuis viziertronic/octant#115 — ouvert le 2026-06-27 par @momsse.

The guarded(permission, action) helper — pipe(action, Policy.withPolicy(Policy.permission(permission))) — is now duplicated verbatim across RPC handler layers:

  • packages/domain/authorization/src/interface-adapters/rpcs/authorization.rpc.layer.ts
  • packages/domain/reconciliation/src/interface-adapters/rpcs/reconciliation.rpc.layer.ts

Each new permission-guarded RPC group copies it again. Extract it once into @octant/authentication (next to Policy) and have every RPC layer import it.

Surfaced in the #41 review (PR #114).

> _Migré depuis [viziertronic/octant#115](https://github.com/viziertronic/octant/issues/115) — ouvert le 2026-06-27 par @momsse._ The `guarded(permission, action)` helper — `pipe(action, Policy.withPolicy(Policy.permission(permission)))` — is now duplicated verbatim across RPC handler layers: - `packages/domain/authorization/src/interface-adapters/rpcs/authorization.rpc.layer.ts` - `packages/domain/reconciliation/src/interface-adapters/rpcs/reconciliation.rpc.layer.ts` Each new permission-guarded RPC group copies it again. Extract it once into `@octant/authentication` (next to `Policy`) and have every RPC layer import it. Surfaced in the #41 review (PR #114).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
momsse/octant#51
No description provided.