···1919use std::time::Duration;
2020use std::{env, net::SocketAddr};
2121use tower_governor::GovernorLayer;
2222-use tower_governor::governor::{GovernorConfig, GovernorConfigBuilder};
2222+use tower_governor::governor::GovernorConfigBuilder;
2323use tower_http::compression::CompressionLayer;
2424use tower_http::cors::{Any, CorsLayer};
2525use tracing::log;
···9797 "Error loading pds.env file (ignore if you loaded your variables in the environment somehow else): {e}"
9898 );
9999 }
100100- let pds_root = env::var("PDS_DATA_DIRECTORY")?;
100100+101101+ let pds_root =
102102+ env::var("PDS_DATA_DIRECTORY").expect("PDS_DATA_DIRECTORY is not set in your pds.env file");
101103 let account_db_url = format!("{pds_root}/account.sqlite");
102104103105 let account_options = SqliteConnectOptions::new()
-2
src/middleware.rs
···11use crate::helpers::json_error_response;
22use axum::extract::Request;
33-use axum::http::header::AUTHORIZATION;
43use axum::http::{HeaderMap, StatusCode};
54use axum::middleware::Next;
65use axum::response::IntoResponse;
···7372 .expect("Error creating an error response");
7473 }
7574 let token = token.expect("Already checked for error,");
7676- // Not going to worry about expiration since it still goes to the PDS
7775 req.extensions_mut()
7876 .insert(Did(Some(token.claims().custom.sub.clone())));
7977 }
+2-2
src/xrpc/com_atproto_server.rs
···1010use axum::{Extension, Json, debug_handler, extract, extract::Request};
1111use serde::{Deserialize, Serialize};
1212use serde_json;
1313-use sqlx::Error;
1414-use sqlx::sqlite::SqliteQueryResult;
1513use tracing::log;
16141715#[derive(Serialize, Deserialize, Debug, Clone)]
···289287 State(state): State<AppState>,
290288 mut req: Request,
291289) -> Result<Response<Body>, StatusCode> {
290290+ //TODO if I add the block of only accounts authenticated just take the body as json here and grab the lxm token. No middle ware is needed
291291+292292 let uri = format!(
293293 "{}{}",
294294 state.pds_base_url, "/xrpc/com.atproto.server.createAccount"