add option for serving jwt info

This commit is contained in:
Robin Appelman 2026-11-04 00:57:16 +01:00
commit c04a04ea29
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
8 changed files with 256 additions and 22 deletions

View file

@ -1,3 +1,4 @@
use secretfile::SecretError;
use std::path::PathBuf;
use std::str::FromStr;
use thiserror::Error;
@ -65,6 +66,8 @@ pub enum FetchError {
pub enum JwtError {
#[error("No JWT secret configured")]
NoSecret,
#[error("Error reading secret: {0}")]
Load(#[from] SecretError),
#[error("Error loading JWT secret: {0}")]
DecodeKey(#[from] jsonwebtoken::errors::Error),
}
@ -76,3 +79,11 @@ pub enum TriggerError {
#[error(transparent)]
Jwt(#[from] JwtError),
}
#[derive(Debug, Error)]
pub enum ServeJwtError {
#[error(transparent)]
Jwt(#[from] JwtError),
#[error(transparent)]
Io(#[from] std::io::Error),
}