Skip to main content

Module auth_params

Module auth_params 

Source
Expand description

MACRO-12 — the auth activation’s parameters, as types.

Every parameter of super::auth_activation’s methods is one of these instead of a bare String, and the activation is compiled with #[plexus_macros::activation(typed_params)], so a bare string cannot come back. Each type:

  • is validated once, at the wire: Deserialize goes through TryFrom<String>, so a bad value is InvalidParams naming the parameter (role: a.b is not a role name …) before the method runs;
  • serializes as the same plain string it always was (#[serde(transparent)]), so the JSON on the wire does not change by a byte;
  • is $defs/<Name> { type: string } behind a $ref in the schema (the shape ACCESS-6 / ACCESS-43 found synapse and hub-codegen read);
  • has Display, as_str(), and no public field.

The names are the parameters’ own. They live in this module, not at plexus_core::plexus::*, because MethodPath, RoleName and Principal already name the identity layer’s types there; reach them as plexus_core::plexus::auth_params::RoleName and so on.

Structs§

GrantName
One entry of a role’s grants: a grant (tickets.get) or a role whose grants it includes (viewer). No @, no whitespace.
MethodPath
A method, as <activation>.<method> — tickets.set_status. Two or more dot-separated segments, none empty, no whitespace.
Principal
A Plexus principal: key:<hex>, oidc:<issuer>/<subject>, idp:<subject>, … — the identity layer’s grammar, checked here; Principal::principal is the parsed value.
ProviderName
A sign-in provider’s name, as auth.providers lists it (workos, plexus-idp). One word.
RoleName
A role’s name — editor. One word: no . (that is a grant), no @ (that is a ceiling entry), no whitespace.
ScopeName
Where a role is held: a scope name (MENGER) or *, everywhere. What a name means is the service’s; it is not blank.