Skip to content

Commit

Permalink
Only support bearer auth (#2248)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 authored Feb 11, 2025
1 parent 03fda01 commit e76ba2b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions crates/client-api/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,9 @@ impl SpacetimeCreds {
fn from_request_parts(parts: &request::Parts) -> Result<Option<Self>, headers::Error> {
let header = parts
.headers
.typed_try_get::<headers::Authorization<authorization::Bearer>>()
.map(|x| x.map(|auth| auth.token().to_owned()))
.or_else(|_| {
Ok(parts
.headers
.typed_try_get::<headers::Authorization<Self>>()?
.map(|auth| auth.0.token))
})?;
if let Some(token) = header {
.typed_try_get::<headers::Authorization<authorization::Bearer>>()?;
if let Some(headers::Authorization(bearer)) = header {
let token = bearer.token().to_owned();
return Ok(Some(SpacetimeCreds { token }));
}
if let Ok(Query(creds)) = Query::<Self>::try_from_uri(&parts.uri) {
Expand Down

2 comments on commit e76ba2b

@github-actions
Copy link

@github-actions github-actions bot commented on e76ba2b Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Criterion benchmark results

Error when comparing benchmarks: Couldn't find AWS credentials in environment, credentials file, or IAM role.

Caused by:
Couldn't find AWS credentials in environment, credentials file, or IAM role.

@github-actions
Copy link

@github-actions github-actions bot commented on e76ba2b Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Callgrind benchmark results Error when comparing benchmarks: Couldn't find AWS credentials in environment, credentials file, or IAM role.

Caused by:
Couldn't find AWS credentials in environment, credentials file, or IAM role.

Please sign in to comment.