diff --git a/parakeet/src/xrpc/app_bsky/ageassurance.rs b/parakeet/src/xrpc/app_bsky/ageassurance.rs new file mode 100644 index 00000000..59e6c733 --- /dev/null +++ b/parakeet/src/xrpc/app_bsky/ageassurance.rs @@ -0,0 +1,56 @@ +use axum::Json; +use serde::Serialize; + +// ======== getConfig ======== + +#[derive(Debug, Serialize)] +pub struct GetConfigResponse { + pub regions: Vec, +} + +/// Handler for the app.bsky.ageassurance.getConfig endpoint +/// Returns a static configuration response with an empty regions list +pub async fn get_config() -> Json { + Json(GetConfigResponse { + regions: Vec::new(), + }) +} + +// ======== getState ======== + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct StateInfo { + pub last_initiated_at: String, + pub status: String, + pub access: String, +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct MetadataInfo { + pub account_created_at: String, +} + +#[derive(Debug, Serialize)] +pub struct GetStateResponse { + pub state: StateInfo, + pub metadata: MetadataInfo, +} + +/// Handler for the app.bsky.ageassurance.getState endpoint +/// Returns a static response indicating the user has full access +pub async fn get_state() -> Json { + // Use a fixed timestamp + // Later, this might use actual account creation timestamps + Json(GetStateResponse { + state: StateInfo { + last_initiated_at: "2025-07-14T14:22:43.912Z".to_string(), + status: "assured".to_string(), + access: "full".to_string(), + }, + metadata: MetadataInfo { + account_created_at: "2022-11-17T00:35:16.391Z".to_string(), + }, + }) +} diff --git a/parakeet/src/xrpc/app_bsky/mod.rs b/parakeet/src/xrpc/app_bsky/mod.rs index c13249f8..bbb9fc1d 100644 --- a/parakeet/src/xrpc/app_bsky/mod.rs +++ b/parakeet/src/xrpc/app_bsky/mod.rs @@ -2,6 +2,7 @@ use axum::routing::{get, post}; use axum::Router; mod actor; +mod ageassurance; mod bookmark; mod feed; mod graph; @@ -19,6 +20,8 @@ pub fn routes() -> Router { .route("/app.bsky.actor.searchActors", get(actor::search_actors)) .route("/app.bsky.actor.searchActorsTypeahead", get(actor::search_actors_typeahead)) .route("/app.bsky.actor.getSuggestions", get(actor::get_suggestions)) + .route("/app.bsky.ageassurance.getConfig", get(ageassurance::get_config)) + .route("/app.bsky.ageassurance.getState", get(ageassurance::get_state)) .route("/app.bsky.bookmark.createBookmark", post(bookmark::create_bookmark)) .route("/app.bsky.bookmark.deleteBookmark", post(bookmark::delete_bookmark)) .route("/app.bsky.bookmark.getBookmarks", get(bookmark::get_bookmarks))