Rename crates.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-04-22 01:41:02 +00:00
parent 0024354345
commit 9b658d86b2
316 changed files with 1590 additions and 1593 deletions

View File

@@ -5,9 +5,6 @@ use axum::{
extract::{DefaultBodyLimit, MatchedPath},
};
use axum_client_ip::SecureClientIpSource;
use conduwuit::{Result, Server, debug, error};
use conduwuit_api::router::state::Guard;
use conduwuit_service::Services;
use http::{
HeaderValue, Method, StatusCode,
header::{self, HeaderName},
@@ -22,10 +19,13 @@ use tower_http::{
trace::{DefaultOnFailure, DefaultOnRequest, DefaultOnResponse, TraceLayer},
};
use tracing::Level;
use tuwunel_api::router::state::Guard;
use tuwunel_core::{Result, Server, debug, error};
use tuwunel_service::Services;
use crate::{request, router};
const CONDUWUIT_CSP: &[&str; 5] = &[
const TUWUNEL_CSP: &[&str; 5] = &[
"default-src 'none'",
"frame-ancestors 'none'",
"form-action 'none'",
@@ -33,7 +33,7 @@ const CONDUWUIT_CSP: &[&str; 5] = &[
"sandbox",
];
const CONDUWUIT_PERMISSIONS_POLICY: &[&str; 2] = &["interest-cohort=()", "browsing-topics=()"];
const TUWUNEL_PERMISSIONS_POLICY: &[&str; 2] = &["interest-cohort=()", "browsing-topics=()"];
pub(crate) fn build(services: &Arc<Services>) -> Result<(Router, Guard)> {
let server = &services.server;
@@ -86,11 +86,11 @@ pub(crate) fn build(services: &Arc<Services>) -> Result<(Router, Guard)> {
))
.layer(SetResponseHeaderLayer::if_not_present(
HeaderName::from_static("permissions-policy"),
HeaderValue::from_str(&CONDUWUIT_PERMISSIONS_POLICY.join(","))?,
HeaderValue::from_str(&TUWUNEL_PERMISSIONS_POLICY.join(","))?,
))
.layer(SetResponseHeaderLayer::if_not_present(
header::CONTENT_SECURITY_POLICY,
HeaderValue::from_str(&CONDUWUIT_CSP.join(";"))?,
HeaderValue::from_str(&TUWUNEL_CSP.join(";"))?,
))
.layer(cors_layer(server))
.layer(body_limit_layer(server))