pub trait Auth:
Send
+ Sync
+ 'static {
// Required methods
fn providers(&self) -> BoxStream<'static, AuthEvent>;
fn login(&self, flow: LoginFlow) -> BoxStream<'static, AuthEvent>;
fn signup(&self, via: Option<ProviderName>) -> BoxStream<'static, AuthEvent>;
fn whoami(&self) -> BoxStream<'static, AuthEvent>;
fn logout(&self) -> BoxStream<'static, AuthEvent>;
fn requires(&self, method: MethodPath) -> BoxStream<'static, AuthEvent>;
fn roles(&self) -> BoxStream<'static, AuthEvent>;
fn role_set(
&self,
role: RoleName,
grants: Vec<GrantName>,
) -> BoxStream<'static, AuthEvent>;
fn grant(
&self,
principal: Principal,
role: RoleName,
scope: ScopeName,
) -> BoxStream<'static, AuthEvent>;
fn revoke(
&self,
principal: Principal,
role: Option<RoleName>,
scope: ScopeName,
) -> BoxStream<'static, AuthEvent>;
fn waiting(&self) -> BoxStream<'static, AuthEvent>;
}Expand description
Sign in, who am I, what does this need
Emitted by #[plexus_macros::activation] (MACRO-13) from the
activation’s wire methods: implemented by the activation and by its
client, so anything that implements it can be served and anything
served can be called through it.
Required Methods§
Sourcefn login(&self, flow: LoginFlow) -> BoxStream<'static, AuthEvent>
fn login(&self, flow: LoginFlow) -> BoxStream<'static, AuthEvent>
Sign in — a person through the browser, an agent with its key
Sourcefn signup(&self, via: Option<ProviderName>) -> BoxStream<'static, AuthEvent>
fn signup(&self, via: Option<ProviderName>) -> BoxStream<'static, AuthEvent>
Create an account, or ask for access
Sourcefn whoami(&self) -> BoxStream<'static, AuthEvent>
fn whoami(&self) -> BoxStream<'static, AuthEvent>
Who you are: principal, roles held where, ceiling
Sourcefn requires(&self, method: MethodPath) -> BoxStream<'static, AuthEvent>
fn requires(&self, method: MethodPath) -> BoxStream<'static, AuthEvent>
What a method needs: its grant, target, and the roles that list it
Sourcefn role_set(
&self,
role: RoleName,
grants: Vec<GrantName>,
) -> BoxStream<'static, AuthEvent>
fn role_set( &self, role: RoleName, grants: Vec<GrantName>, ) -> BoxStream<'static, AuthEvent>
Set a role’s grants (admin on *)
Sourcefn grant(
&self,
principal: Principal,
role: RoleName,
scope: ScopeName,
) -> BoxStream<'static, AuthEvent>
fn grant( &self, principal: Principal, role: RoleName, scope: ScopeName, ) -> BoxStream<'static, AuthEvent>
Give a principal a role on a scope
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".