Expand description
MSC4512: forwarding the paths an appservice claims.
A request no route matched is checked against the appservicesβ claims; a claimed one is authenticated as a native route would be and sent on, and any other stays the plain 404.
Re-exportsΒ§
use std::any::TypeId;πuse axum::RequestExt;πuse axum::body::Body;πuse axum::extract::Path;πuse axum::response::IntoResponse;πuse axum::response::Response;πuse bytes::Bytes;πuse http::HeaderMap;πuse http::HeaderName;πuse http::Method;πuse http::Request as HttpRequest;πuse http::Response as HttpResponse;πuse http::StatusCode;πuse http::Uri;πuse http::header::ACCEPT;πuse http::header::ACCEPT_LANGUAGE;πuse http::header::CONNECTION;πuse http::header::CONTENT_TYPE;πuse itertools::Itertools;πuse reqwest::Body as ReqwestBody;πuse reqwest::Response as ReqwestResponse;πuse ruma::CanonicalJsonValue;πuse ruma::api::auth_scheme::AccessToken;πuse ruma::api::error::ErrorKind;πuse ruma::api::federation::authentication::ServerSignatures;πuse tuwunel_core::Err;πuse tuwunel_core::Error;πuse tuwunel_core::Result;πuse tuwunel_core::err;πuse tuwunel_core::utils::BoolExt;πuse tuwunel_core::utils::url::is_plain_path;πuse tuwunel_service::Services;πuse tuwunel_service::appservice::RegistrationInfo;πuse tuwunel_service::appservice::proxy::Root;πuse tuwunel_service::appservice::proxy::split_path;πuse url::form_urlencoded::parse as parse_query;πuse super::args::parse_json;πuse super::args::record_auth_context;πuse super::args::serialize_body;πuse super::auth::Auth;πuse super::auth::AuthDispatch;πuse super::auth::Scheme;πuse super::auth::auth;πuse super::request::PathParams;πuse super::request::Request;πuse super::request::from_parts;π
StructsΒ§
- Proxied π
- Marks a proxied request in the authentication checks keyed by route.
ConstantsΒ§
- DROPPED_
HEADERS π - Response headers never relayed from the appservice.
- FORWARDED_
HEADERS π - Request headers passed to the appservice.
- ORIGIN π
- USER_
IDENTIFIER π
FunctionsΒ§
- authenticate π
- Authenticates a proxied request as the claimed APIβs native routes do.
- authenticated π
- claim π
- The API and registration a request is proxied to.
- downstream_
response π - The appserviceβs response, relayed with its body streaming.
- is_
access_ πtoken - is_
dropped π - listed_
in_ πconnection - Whether a messageβs
Connectionheader namesname. - not_
found π - The 404 every unmatched and unclaimed request receives.
- proxy
- Answers a request no route matched.
- relayed_
headers π - The response headers this server relays.
- upstream_
path π - The raw path and query, without any query pair carrying an access token.
- upstream_
request π - The request sent on to the appservice, before its credentials are added.