summaryrefslogtreecommitdiff
path: root/src/auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/auth.rs')
-rw-r--r--src/auth.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/auth.rs b/src/auth.rs
index f56c5e2..304ab0f 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -11,17 +11,16 @@ use rocket::{request, Data, Ignite, Phase, Rocket, Sentinel};
use serde::Deserialize;
use serde_json::error::Category;
-use crate::crypto::SecretBytes;
use crate::db::DbConn;
use crate::types::oauth::ScopeSet;
-use crate::types::{OauthToken, UserID};
+use crate::types::{HawkKey, OauthToken, UserID};
use crate::Config;
#[rocket::async_trait]
pub(crate) trait AuthSource {
type ID: FromStr + Send + Sync + Clone;
type Context: Send + Sync;
- async fn hawk(r: &Request<'_>, id: &Self::ID) -> Result<(SecretBytes<32>, Self::Context)>;
+ async fn hawk(r: &Request<'_>, id: &Self::ID) -> Result<(HawkKey, Self::Context)>;
async fn bearer_token(r: &Request<'_>, id: &OauthToken) -> Result<(Self::ID, Self::Context)>;
}
@@ -227,7 +226,7 @@ pub(crate) struct WithBearer;
impl crate::auth::AuthSource for WithBearer {
type ID = UserID;
type Context = ScopeSet;
- async fn hawk(_r: &Request<'_>, _id: &Self::ID) -> Result<(SecretBytes<32>, Self::Context)> {
+ async fn hawk(_r: &Request<'_>, _id: &Self::ID) -> Result<(HawkKey, Self::Context)> {
bail!("hawk signatures not allowed here")
}
async fn bearer_token(