Skip to main content

coqui_access/
lib.rs

1//! Kinds and models for authentication, identity lookup, authorization and account
2//! management, on [Guatiao](https://github.com/Boriken-Dev/guatiao).
3//!
4//! A host and every provider library compile against this crate and against nothing else
5//! of each other. Providers name `guatiao` through [`guatiao`] (re-exported here), so the
6//! two sides cannot drift to different versions.
7//!
8//! | Kind | Name | Answers |
9//! | --- | --- | --- |
10//! | [`Authenticator`] | `coqui_authenticator` | Are these credentials valid, and which [`Lookup`] do they name? |
11//! | [`Directory`] | `coqui_directory` | Who is the [`Person`] behind a [`Lookup`]? |
12//! | [`Authorizer`] | `coqui_authorizer` | May this [`Person`] do this action on this resource? |
13//! | [`Accounts`] | `coqui_accounts` | Optional: list, put and remove accounts, list unaccepted peers. |
14//! | [`SignInPolicy`] | `coqui_sign_in_policy` | Which methods may this sign-in use, and what does it still need? |
15//! | [`Challenger`] | `coqui_challenger` | Optional: the challenge a method's answer is bound to (a passkey's). |
16//!
17//! Every method is synchronous; a host calls a provider from a blocking thread. Kind names
18//! and their floor hashes are an ABI, pinned by this crate's contract test: a provider built
19//! against one hash is refused by a host built against another. The hash covers every method
20//! of a kind, optional ones included, so a kind that exists is never appended to: it is
21//! extended by a new kind, and a model by an `Option` field.
22
23#![forbid(unsafe_code)]
24#![warn(missing_docs)]
25#![warn(missing_debug_implementations)]
26
27pub use guatiao;
28
29pub mod error;
30mod kind;
31mod limit;
32pub mod methods;
33mod model;
34mod subject;
35
36pub use kind::{
37    Accounts, AccountsVtable, Authenticator, AuthenticatorVtable, Authorizer, AuthorizerVtable,
38    Challenger, ChallengerVtable, Directory, DirectoryVtable, SignInPolicy, SignInPolicyVtable,
39};
40pub use limit::Limit;
41pub use model::{
42    AccountInfo, AccountPut, Attempt, AuthorizationDecision, AuthorizationRequest, Challenge,
43    ChallengeRequest, Claims, CredentialInfo, Description, Factor, Lookup, Offer, Person,
44    PutOutcome, SignInContext, SignInDecision, Verdict, Waiting, attributes, clients, purposes,
45    takes,
46};
47pub use subject::{Subject, SubjectError};
48
49/// The prefix of every kind name in this crate. A host scanning a directory keeps the
50/// libraries that declare a kind beginning with it.
51pub const KIND_PREFIX: &str = "coqui_";