1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! A collection of primites useful for more than one authorization method.
//!
//! A primitive is the smallest independent unit of policy used in OAuth related endpoints. For
//! example, an `authorizer` generates and verifies Authorization Codes. There only is, as you
//! might have noticed, only the OAuth2 code grant method. But abstracting away the underlying
//! primitives makes it possible to provide –e.g.– a independent database based implementation.
//!
//! These should be used to build or instantiate an `Endpoint`, for example [`Generic`] or your
//! own.
//!
//! ```
//! # extern crate oxide_auth;
//! # use oxide_auth::frontends::simple::endpoint::Vacant;
//! use oxide_auth::frontends::simple::endpoint::Generic;
//! use oxide_auth::primitives::{
//! authorizer::AuthMap,
//! generator::RandomGenerator,
//! issuer::TokenMap,
//! registrar::ClientMap,
//! };
//!
//! Generic {
//! authorizer: AuthMap::new(RandomGenerator::new(16)),
//! registrar: ClientMap::new(),
//! issuer: TokenMap::new(RandomGenerator::new(16)),
//! // ...
//! # scopes: Vacant,
//! # solicitor: Vacant,
//! # response: Vacant,
//! };
//! ```
//!
//! [`Generic`]: ../frontends/simple/endpoint/struct.Generic.html
use DateTime;
use Utc;
use Url;
type Time = ;
/// Commonly used primitives for frontends and backends.