about summary refs log tree commit diff
path: root/src/errors.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-08T20·36+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-08T20·36+0200
commit249f17b60a0313a66443a5c67403794986430e34 (patch)
treecd73f56fcb822125de967b8486b74f0887256043 /src/errors.rs
parentda33786939979350b58a09145b56913963380c92 (diff)
feat(oidc): Implement initial OIDC actor
Implements an actor that can perform OAuth2 logins (not really
OIDC-compliant yet because Rust doesn't have an easy to use JWT
library that supports JWKS, and I don't have time for that right now).

Currently this hardcodes some Office365-specific stuff.
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 3cbda5f4e55d..d07d19cd3790 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -11,6 +11,7 @@ use actix_web::http::StatusCode;
 use actix;
 use diesel;
 use r2d2;
+use reqwest;
 use tera;
 
 pub type Result<T> = result::Result<T, ConverseError>;
@@ -64,6 +65,14 @@ impl From<actix::MailboxError> for ConverseError {
     }
 }
 
+impl From<reqwest::Error> for ConverseError {
+    fn from(error: reqwest::Error) -> ConverseError {
+        ConverseError::InternalError {
+            reason: format!("Failed to make HTTP request: {}", error),
+        }
+    }
+}
+
 // Support conversion of error type into HTTP error responses:
 
 impl ResponseError for ConverseError {