Expand description
Who may read and who may change a file’s share set.
Lives in cloudillo-core because it gates two crates: the share-entry endpoints in
cloudillo-file and the ref (share-link) endpoints in cloudillo-ref. A refId is a bearer
credential, so minting, listing or revoking one is share management and must pass the same gate
as POST /api/files/{id}/shares.
Every require_* entry point refuses any scoped token, share-link delegation or API-key
capability scope alike: a delegated link must never widen or mutate the grant that admitted it
(confused-deputy), and share management is never delegable.
§Handler ordering convention
Every share-entry and ref handler runs its checks in this order, so both crates answer the same request shape the same way:
- The caller-shape check (
reject_scoped, or the scope refusal insiderequire_unscoped_file_access) before anything, body validation included: a scoped caller must not learn even whether their request was well formed. - Resource authorization as soon as the resource id is known.
- Body validation last — except where a gate needs a parsed value, such as
ensure_grant_withinneeding the validated permission char.
Structs§
- Share
Authority - A caller’s resolved authority over one file’s share set.
Enums§
- Share
Standing - A caller’s standing over one file’s share set. Ordered:
ManagerimpliesReader.
Functions§
- ensure_
grant_ within - A share manager may not hand out more access than
ShareAuthority::grant_ceilingallows. - ensure_
standing - Enforce a minimum standing, with the denial log every call site wants.
- require_
share_ manager - Authorize share management (create/update/delete share entries, mint/revoke share links).
- require_
share_ reader - Authorize listing a file’s share entries or share links.
- require_
unscoped_ file_ access - Refuse any scoped token, then resolve the caller’s unscoped access to
file_id. - share_
standing - Resolve the caller’s standing over
file_id’s share set in one pass. - share_
standing_ for_ actor - Resolve share standing for a server-side actor named only by
id_tag— no token, hence noAuthCtxto hand in. Used by the FSHR native hook, where the actor is the action’s issuer and the write it guards (create_share_entry) is the same onePOST /api/files/{id}/sharesmakes.