1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-23 11:02:35 +03:00

Propagate parent trace context

This commit is contained in:
Quentin Gliech
2021-10-14 17:39:49 +02:00
parent f9036aecd4
commit e630279b54
5 changed files with 117 additions and 16 deletions

View File

@@ -14,6 +14,7 @@
use std::collections::HashSet;
use hyper::Method;
use oauth2_types::{
oidc::Metadata,
pkce::CodeChallengeMethod,
@@ -86,10 +87,15 @@ pub(super) fn filter(
code_challenge_methods_supported,
};
let cors = warp::cors().allow_any_origin();
// TODO: get the headers list from the global opentelemetry propagators
let cors = warp::cors()
.allow_method(Method::GET)
.allow_any_origin()
.allow_headers(["traceparent"]);
warp::path!(".well-known" / "openid-configuration")
.and(warp::get())
.map(move || warp::reply::json(&metadata))
.with(cors)
warp::path!(".well-known" / "openid-configuration").and(
warp::get()
.map(move || warp::reply::json(&metadata))
.with(cors),
)
}