chore: make AppState extractable by deriving FromRef

This commit is contained in:
transcaffeine 2024-09-15 13:12:59 +02:00
parent 2fc6caad1c
commit b49a4724a8
Signed by: transcaffeine
GPG Key ID: 03624C433676E465

View File

@ -4,6 +4,7 @@ use std::sync::{Arc};
use tokio::sync::Mutex; use tokio::sync::Mutex;
use axum::Router; use axum::Router;
use axum::extract::FromRef;
use axum::routing::{get, post}; use axum::routing::{get, post};
use openidconnect::{ use openidconnect::{
IntrospectionUrl, IntrospectionUrl,
@ -18,7 +19,7 @@ mod util;
use crate::util::powerdns::PowerDnsApi; use crate::util::powerdns::PowerDnsApi;
#[derive(Clone)] #[derive(Clone, FromRef)]
pub struct AppState { pub struct AppState {
oidc_client: CoreClient, oidc_client: CoreClient,
pdns_client: PowerDnsApi, pdns_client: PowerDnsApi,