-
Notifications
You must be signed in to change notification settings - Fork 81
Refactor AbstractHttpSender to use CredentialFactory to authenticate requests. #8866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the authentication methods for OAuth to leverage CredentialFactory instead of directly referencing local credential fields, ensuring that both user and client aliases are handled properly.
- Updates tests to use getBasicCredentials() instead of getCredentials()
- Refactors multiple authentication classes to retrieve credentials from CredentialFactory
- Adjusts configuration and validation in AbstractHttpSession and related classes
Reviewed Changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
OAuthAccessTokenRequestTest.java | Updated tests to use getBasicCredentials() when creating requests |
OAuthAccessTokenKeycloakTest.java | Modified sender setup to properly configure OAuth authentication |
OAuthAccessTokenAuthenticatorTest.java | Adjusted tests to use new credential handling and ensure proper authenticator behavior |
HttpSenderAuthenticationTest.java | Added tests for client and auth alias based basic authentication |
ResourceOwnerPasswordCredentialsQueryParameters.java | Replaced direct session calls with new clientId/clientSecret fields |
ResourceOwnerPasswordCredentialsBasicAuth.java | Updated authorization header creation to use new fields |
ClientCredentialsQueryParameters.java | Refactored to use member variables instead of session variables |
ClientCredentialsBasicAuth.java | Similar update to use new credential fields in authorization header creation |
AbstractResourceOwnerPasswordCredentials.java | Introduced CredentialFactory to obtain both user and client credentials and updated configuration checks |
AbstractClientCredentials.java | Refactored to retrieve credentials via CredentialFactory and added configuration warnings for authAlias usage |
AbstractHttpSession.java | Updated credential handling to use CredentialFactory and modified methods to work with getBasicCredentials() |
Files not reviewed (2)
- core/src/test/resources/Management/securityItemsResponse.json: Language not supported
- core/src/test/resources/credentials.properties: Language not supported
core/src/main/java/org/frankframework/http/authentication/ClientCredentialsQueryParameters.java
Outdated
Show resolved
Hide resolved
...in/java/org/frankframework/http/authentication/AbstractResourceOwnerPasswordCredentials.java
Outdated
Show resolved
Hide resolved
...in/java/org/frankframework/http/authentication/AbstractResourceOwnerPasswordCredentials.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/frankframework/http/authentication/ClientCredentialsBasicAuth.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/frankframework/http/authentication/ClientCredentialsBasicAuth.java
Outdated
Show resolved
Hide resolved
…andling to throw aggregated exception
…dentials configuration
Refactor the authentication methods for OAuth to use the CredentialFactory instead of using the local clientId, clientSecret, username and password variables. This ensures that an alias can be used for both cases, since setting an alias does not fill in the local fields it represents.
Fixes: #8838