Rust
Fetch JWT templates
fetch_jwt_templates
pub async fn fetch_jwt_templates() -> Result<JwtTemplateListResponse>
Result<JwtTemplateListResponse>
data
JwtTemplate
use wacht::api::settings::*; let templates = fetch_jwt_templates().await?; println!("Found {} JWT templates", templates.data.len()); for template in templates.data { println!("Template: {} ({})", template.name, template.id); println!(" Algorithm: {}", template.algorithm); println!(" Claims: {:?}", template.claims); }
match fetch_jwt_templates().await { Ok(response) => { println!("Successfully retrieved {} JWT templates", response.data.len()); for template in response.data { println!("- {} (expires in: {} seconds)", template.name, template.expires_in); } } Err(Error::Api { status, message, .. }) => { match status.as_u16() { 403 => println!("Access denied: {}", message), _ => println!("API error {}: {}", status, message), } } Err(e) => println!("Request failed: {}", e), }