ezidam: well-known: wrap jwks in "keys" object
This commit is contained in:
parent
9af447d110
commit
d14c3da06a
1 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ use futures::future::join_all;
|
|||
use jwt::database::Key;
|
||||
use jwt::PublicKey;
|
||||
use rocket::get;
|
||||
use rocket::serde::json::serde_json::json;
|
||||
use rocket::serde::json::{Json, Value};
|
||||
use settings::Settings;
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ async fn openid_configuration(mut db: Connection<Database>) -> Result<Json<Value
|
|||
}
|
||||
|
||||
#[get("/.well-known/jwks.json")]
|
||||
async fn json_web_keys(mut db: Connection<Database>) -> Result<Json<Vec<Value>>> {
|
||||
async fn json_web_keys(mut db: Connection<Database>) -> Result<Value> {
|
||||
// Get keys
|
||||
let keys = Key::get_all(&mut *db, Some(false)).await?;
|
||||
|
||||
|
|
@ -53,7 +54,7 @@ async fn json_web_keys(mut db: Connection<Database>) -> Result<Json<Vec<Value>>>
|
|||
.collect::<std::result::Result<Vec<_>, _>>()?;
|
||||
|
||||
// HTTP response
|
||||
Ok(Json(json_web_keys))
|
||||
Ok(json!({ "keys": json_web_keys }))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue