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
// Copyright 2018 Uptime Ventures, Ltd. All rights reserved. // // Released under a 3-Clause BSD License. See the LICENSE file // at the top of this source tree. Alternatively, visit // https://opensource.org/licenses/BSD-3-Clause to acquire a copy. //! Ensures that only requests with valid JSON Web Tokens //! included in the HTTP `Authorization` header are allowed //! to pass. //! //! Requests that lack a token are returned with the //! Status Code `400: Bad Request`. Tokens that fail //! validation cause the middleware to return Status Code //! `401: Unauthorized`. #![warn(missing_docs, deprecated)] extern crate futures; extern crate gotham; #[macro_use] extern crate gotham_derive; extern crate hyper; extern crate jsonwebtoken; extern crate serde; #[macro_use] extern crate log; #[cfg(test)] #[macro_use] extern crate serde_derive; mod middleware; mod state_data; pub use self::middleware::JWTMiddleware; pub use self::state_data::AuthorizationToken;