Expand description
Standard SiLA authentication and authorization, over a backend the application supplies.
Part C defines AuthenticationService and AuthorizationService but not what a credential, a
token, or a permission is — deliberately, because those belong to the deployment. This crate
draws the line in the same place: Siloxide owns the Feature Definitions, their wire mapping,
their errors, and where in a call the authorization question is asked; the application owns
identity, credentials, tokens, permissions, and whatever service it consults.
let server = Server::builder(config)
.add_feature(authentication_service::default_feature(directory))?
.add_feature(authorization_service::default_feature(policy, server_uuid))?
.add_feature(balance::feature(Scale)?)?
.build()?;Registering the second one protects every eligible call on the server, Balance included, and
freezes that list at build. SiLAService is never protected — Part A p.57 forbids client
metadata on it — and AuthenticationService is excluded, because a client that needs a token to
call Login can never obtain one.
Neither adapter implements AuthorizationProviderService or
AuthorizationConfigurationService. Selecting a remote provider, persisting a configuration,
and verifying a token against another server are separate behavior, and a default that pretended
otherwise would be advertising something it does not do.
Re-exports§
pub use authentication::AccessGrant;pub use authentication::AuthenticationBackend;pub use authentication::LoginRejection;pub use authentication::LoginRequest;pub use authentication::LogoutRejection;pub use authorization::AuthorizationBackend;pub use authorization::AuthorizationDecision;pub use authorization::AuthorizationRequest;pub use secret::AccessToken;pub use secret::Password;
Modules§
- authentication
- What an application supplies so this server can issue access tokens.
- authentication_
service - The standard
AuthenticationService, answered by a user-supplied backend. - authorization
- What an application supplies so this server can decide who may call what.
- authorization_
service - The standard
AuthorizationService, decided by a user-supplied backend. - secret
- The two secret-bearing values these Features carry.