[][src]Struct rowdy::Configuration

pub struct Configuration<B> {
    pub token: Configuration,
    pub basic_authenticator: B,
}

Application configuration. Usually deserialized from JSON for use.

The type parameter B is the auth::AuthenticatorConfiguration and by its associated type, the Authenticator that is going to be used for HTTP Basic Authentication.

Examples

extern crate rowdy;
extern crate serde_json;

use rowdy::Configuration;
use rowdy::auth::NoOpConfiguration;

// We are using the `NoOp` authenticator
let json = r#"{
    "token" : {
        "issuer": "https://www.acme.com",
        "allowed_origins": { "Some": ["https://www.example.com", "https://www.foobar.com"] },
        "audience": ["https://www.example.com", "https://www.foobar.com"],
        "signature_algorithm": "RS256",
        "secret": {
                    "rsa_private": "test/fixtures/rsa_private_key.der",
                    "rsa_public": "test/fixtures/rsa_public_key.der"
                   },
        "expiry_duration": 86400
       },
       "basic_authenticator": {}
}"#;
let config: Configuration<NoOpConfiguration> = serde_json::from_str(json).unwrap();
let rocket = config.ignite().unwrap().mount("/", rowdy::routes());
// then `rocket.launch()`!

Fields

token: Configuration

Token configuration. See the type documentation for deserialization examples

basic_authenticator: B

The configuration for the authenticator that will handle HTTP Basic Authentication.

Methods

impl<B: AuthenticatorConfiguration<Basic>> Configuration<B>[src]

pub fn ignite(&self) -> Result<Rocket, Error>[src]

Ignites the rocket with various configuration objects, but does not mount any routes. Remember to mount routes and call launch on the returned Rocket object. See the struct documentation for an example.

Trait Implementations

impl<B: Clone> Clone for Configuration<B>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<B: Debug> Debug for Configuration<B>[src]

impl<B> Serialize for Configuration<B> where
    B: Serialize
[src]

impl<'de, B> Deserialize<'de> for Configuration<B> where
    B: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<B> Send for Configuration<B> where
    B: Send

impl<B> Sync for Configuration<B> where
    B: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> IntoCollection for T

impl<T, I> AsResult for T where
    I: Input, 

impl<T> Erased for T