-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from project-kessel/RHCLOUD-34624-Removed-comm…
…on-code RHCLOUD-34624 Replace common client code with common library
- Loading branch information
Showing
25 changed files
with
103 additions
and
1,456 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,6 @@ Thumbs.db | |
|
||
# Maven generated artifacts | ||
target/ | ||
|
||
# Intellij | ||
*.iml |
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
34 changes: 34 additions & 0 deletions
34
src/main/java/org/project_kessel/relations/client/AuthnConfigConverter.java
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,34 @@ | ||
package org.project_kessel.relations.client; | ||
|
||
import org.project_kessel.clients.authn.AuthenticationConfig; | ||
import org.project_kessel.clients.authn.oidc.client.OIDCClientCredentialsAuthenticationConfig; | ||
import org.project_kessel.clients.authn.oidc.client.OIDCClientCredentialsAuthenticationConfig.OIDCClientCredentialsConfig; | ||
|
||
public class AuthnConfigConverter { | ||
|
||
public static AuthenticationConfig convert(Config.AuthenticationConfig authnConfig) { | ||
if(authnConfig == null) { | ||
return null; | ||
} | ||
AuthenticationConfig convertedAuthnConfig; | ||
if(authnConfig.clientCredentialsConfig().isPresent()) { | ||
Config.OIDCClientCredentialsConfig oidcClientCredentialsConfig = authnConfig.clientCredentialsConfig().get(); | ||
|
||
convertedAuthnConfig = new OIDCClientCredentialsAuthenticationConfig(); | ||
var convertedOidcClientCredentialsConfig = new OIDCClientCredentialsConfig(); | ||
convertedOidcClientCredentialsConfig.setIssuer(oidcClientCredentialsConfig.issuer()); | ||
convertedOidcClientCredentialsConfig.setClientId(oidcClientCredentialsConfig.clientId()); | ||
convertedOidcClientCredentialsConfig.setClientSecret(oidcClientCredentialsConfig.clientSecret()); | ||
convertedOidcClientCredentialsConfig.setScope(oidcClientCredentialsConfig.scope()); | ||
convertedOidcClientCredentialsConfig.setOidcClientCredentialsMinterImplementation(oidcClientCredentialsConfig.oidcClientCredentialsMinterImplementation()); | ||
|
||
((OIDCClientCredentialsAuthenticationConfig)convertedAuthnConfig).setCredentialsConfig(convertedOidcClientCredentialsConfig); | ||
} else { | ||
convertedAuthnConfig = new AuthenticationConfig(); | ||
} | ||
|
||
convertedAuthnConfig.setMode(authnConfig.mode()); | ||
|
||
return convertedAuthnConfig; | ||
} | ||
} |
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
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
39 changes: 0 additions & 39 deletions
39
src/main/java/org/project_kessel/relations/client/authn/CallCredentialsFactory.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.