Add Provider trait
This commit is contained in:
parent
76dcc305f3
commit
af0b8bfe43
|
@ -4,3 +4,4 @@ extern crate rustc_serialize;
|
|||
extern crate url;
|
||||
|
||||
pub mod token;
|
||||
pub mod provider;
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
//! Providers.
|
||||
|
||||
use token::{Token, Lifetime};
|
||||
|
||||
/// OAuth 2.0 providers.
|
||||
pub trait Provider {
|
||||
/// The lifetime of tokens issued by the provider.
|
||||
type Lifetime: Lifetime;
|
||||
|
||||
/// The type of token issued by the provider.
|
||||
type Token: Token<Self::Lifetime>;
|
||||
|
||||
/// The authorization endpoint URI.
|
||||
///
|
||||
/// See [RFC 6749, section 3.1](http://tools.ietf.org/html/rfc6749#section-3.1).
|
||||
fn auth_uri() -> &'static str;
|
||||
|
||||
/// The token endpoint URI.
|
||||
///
|
||||
/// See [RFC 6749, section 3.2](http://tools.ietf.org/html/rfc6749#section-3.2).
|
||||
fn token_uri() -> &'static str;
|
||||
}
|
Loading…
Reference in New Issue