-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add uma2 discovery * Got all the parameters for requesting an RPT in * It compiles, yes? * Before clippy * Clippy is more or less happy * Delete a UMA2 resource * Search for UMA2 resources function * Create UMA2 permission ticket * Move UMA2 resources to their own file * Create,update and delete associated permission for UMA2 resource * Search for UMA2 resource permission * Try to pair down interface changes * Hide UMA2 behind a compile time flag * Start of uma2 module, dividing up the UMA2 mega file * UMA2 resource API calls into the resource module * UMA2 Protection API moved to the permission_association module * Rename uma2 module to rpt because it only has the rpt functionality in it * UMA2 off by default * Make sure that the build pipeline also build and tests the UMA2 code * Add default empty vectors for OpenID Config JSONs that doesn't feature on the Keycloak UMA2 inspection * Get the UMA2 config from the client * Add Client Credentials Grant flow - RFC 6749 4.4 * No field like description, but display_name * Resource owner and resource scope are a hash and not string when returned * Implemented the permission association return values * Fix used after move * Have only one config struct * Export auth method * Permission ticket can be a list of things requested * Searching for a resource returns a list of guids * Get the permission ticket response * Use UMA2 endpoint to interrogate OIDC when UMA2 is enabled * Do not include OIDC discover in build for UMA2 * added DiscoveredUma2 ConfigUma2 * cargo fmt Co-authored-by: Alexander Korolev <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,204 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/target | ||
**/*.rs.bk | ||
Cargo.lock | ||
*.iml | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
use crate::Userinfo; | ||
use base64; | ||
use biscuit::SingleOrMultiple; | ||
use url::Url; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::Config; | ||
|
||
pub trait Configurable { | ||
fn config(&self) -> &Config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use core::fmt; | ||
use serde::export::Formatter; | ||
|
||
/// UMA2 claim token format | ||
/// Either is an access token (urn:ietf:params:oauth:token-type:jwt) or an OIDC ID token | ||
pub enum Uma2ClaimTokenFormat { | ||
OAuthJwt, // urn:ietf:params:oauth:token-type:jwt | ||
OidcIdToken, // https://openid.net/specs/openid-connect-core-1_0.html#IDToken | ||
} | ||
|
||
impl fmt::Display for Uma2ClaimTokenFormat { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { | ||
write!( | ||
f, | ||
"{}", | ||
match *self { | ||
Uma2ClaimTokenFormat::OAuthJwt => "urn:ietf:params:oauth:token-type:jwt", | ||
Uma2ClaimTokenFormat::OidcIdToken => | ||
"https://openid.net/specs/openid-connect-core-1_0.html#IDToken", | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use crate::Config; | ||
use serde::{Deserialize, Serialize}; | ||
use url::Url; | ||
|
||
#[derive(Debug, Deserialize, Serialize)] | ||
pub struct Uma2Config { | ||
// UMA2 additions | ||
#[serde(default)] | ||
pub resource_registration_endpoint: Option<Url>, | ||
#[serde(default)] | ||
pub permission_endpoint: Option<Url>, | ||
#[serde(default)] | ||
pub policy_endpoint: Option<Url>, | ||
#[serde(default)] | ||
pub introspection_endpoint: Option<Url>, | ||
|
||
#[serde(flatten)] | ||
pub config: Config, | ||
} |
Oops, something went wrong.