pub async fn key_set(ctx: &mut Context) -> HandlerResult {
    let reply = ctx.app.key_manager.send(GetPublicJwks).await;
    let mut res = json_response(&json!({ "keys": reply.jwks }));
    if let Some(expires) = reply.expires {
        res.typed_header(CacheControl::new().with_public());
        res.typed_header(Expires::from(expires));
    } else {
        res.typed_header(
            CacheControl::new()
                .with_public()
                .with_max_age(ctx.app.keys_ttl)
                .with_s_max_age(Duration::from_secs(0)),
        );
    }
    Ok(res)
}
/// Request handler for the JSON Web Key Set document.
///
/// Respond with the JWK key set containing all of the configured keys.
///
/// Relying Parties will need to fetch this data to be able to verify identity
/// tokens issued by this daemon instance.
Request handler for the JSON Web Key Set document.
Respond with the JWK key set containing all of the configured keys.

Relying Parties will need to fetch this data to be able to verify identity
tokens issued by this daemon instance.
Request handler for the JSON Web Key Set document . Respond with the JWK key set containing all of the configured keys . Relying Parties will need to fetch this data to be able to verify identity tokens issued by this daemon instance .
pub async fn key_set(ctx: &mut Context) -> HandlerResult {
    let reply = ctx.app.key_manager.send(GetPublicJwks).await;
    let mut res = json_response(&json!({ "keys": reply.jwks }));
    if let Some(expires) = reply.expires {
        res.typed_header(CacheControl::new().with_public());
        res.typed_header(Expires::from(expires));
    } else {
        res.typed_header(
            CacheControl::new()
                .with_public()
                .with_max_age(ctx.app.keys_ttl)
                .with_s_max_age(Duration::from_secs(0)),
        );
    }
    Ok(res)
}
pub async fn key_set ( ctx : & mut Context ) -> HandlerResult { let reply = ctx . app . key_manager . send ( GetPublicJwks ) . await ; let mut res = json_response ( & json ! ( { " " reply jwks } ) ) ; if let Some ( expires ) = reply . expires { res . typed_header ( CacheControl :: new ( ) . with_public ( ) ) ; res . typed_header ( Expires :: from ( expires ) ) ; } else { res . typed_header ( CacheControl :: new ( ) . with_public ( ) . with_max_age ( ctx . app . keys_ttl ) . with_s_max_age ( Duration :: from_secs ( 0 ) ) , ) ; } Ok ( res ) }
Request handler for the JSON Web Key Set document.
Request handler for the JSON Web Key Set document .
ctx
&mut Context
ctx
&mut Context