athena_rs 3.26.3

Hyper performant polyglot Database driver
//! Client-list schema HTTP handlers.
//!
//! This module owns endpoints that expose configured Postgres-backed Athena
//! client names for schema tooling and caller-side client selection.

use actix_web::{HttpRequest, Responder, get, web::Data};

use crate::AppState;

use super::client_response::authorized_schema_clients_response;

/// Returns configured Postgres-backed Athena clients for caller-side client selection.
///
/// Requires static admin key (`ATHENA_KEY_12`) or a gateway API key with read access.
#[get("/schema/clients")]
pub(super) async fn schema_clients(req: HttpRequest, app_state: Data<AppState>) -> impl Responder {
    authorized_schema_clients_response(&req, app_state.get_ref()).await
}

/// Returns configured Postgres-backed Athena clients via the short `/clients` alias.
///
/// Requires static admin key or gateway API key with read access.
#[get("/clients")]
pub(super) async fn list_clients_protected(
    req: HttpRequest,
    app_state: Data<AppState>,
) -> impl Responder {
    authorized_schema_clients_response(&req, app_state.get_ref()).await
}