Skip to content

Commit

Permalink
Add jwks endpoint to libiam api
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Jul 10, 2024
1 parent 907701e commit 79a750d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions libiam/src/api/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod app;
pub mod user;
pub mod well_known;

use reqwest::{header::AUTHORIZATION, Client, Method, Url};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
Expand Down
14 changes: 14 additions & 0 deletions libiam/src/api/well_known.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use super::Api;
use anyhow::Result;
use reqwest::Method;

pub mod jwks {
use jsonwebtoken::jwk::JwkSet;

pub type Response = JwkSet;
}

pub async fn jwks(api: &Api) -> Result<jwks::Response> {
api.request(Method::GET, "/.well-known/jwks.json", None::<&()>)
.await
}

0 comments on commit 79a750d

Please sign in to comment.