-
Notifications
You must be signed in to change notification settings - Fork 5
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
[ALS-6103] Architectural changes to support multiple auth providers #183
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
2485173 | Triggered | Generic Password | d02a3e8 | scripts/fence-deployment/docker-compose.yml | View secret |
2485174 | Triggered | Generic High Entropy Secret | d02a3e8 | scripts/fence-deployment/docker-compose.yml | View secret |
2485174 | Triggered | Generic High Entropy Secret | d02a3e8 | scripts/fence-deployment/docker-compose.yml | View secret |
2485175 | Triggered | Generic High Entropy Secret | d02a3e8 | scripts/fence-deployment/docker-compose.yml | View secret |
2485176 | Triggered | Generic High Entropy Secret | d02a3e8 | scripts/fence-deployment/docker-compose.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
- Removed `OpenAuthenticationController`, `OktaAuthenticationController`, and `AuthController`. - Created the `AuthenticationService` interface. All authentication service classes **MUST** implement this interface. This interface contains three methods: `authenticate`, `getProvider()`, and `isEnabled()`. - `authenticate`: Implements the specific authentication logic for each authentication service. - `getProvider`: Returns the name of the provider, e.g., `fence`, `open`, `auth0`, etc. These values must correspond to the `idpProvider` value in the authentication controller path `/auth/authentication/{idpProvider}`. This value is used to look up the correct authentication service in the `AuthenticationServiceRegistry` class. - `isEnabled`: Returns `true` or `false` based on the corresponding `application.properties` value. - Created the `AuthenticationServiceRegistry`. This service registry maintains a map of all enabled `AuthenticationService` services and provides a `getAuthenticationService` method that returns an `AuthenticationService` based on the provider string. - Created the `AuthenticationController`. This controller uses the `AuthenticationServiceRegistry` to dynamically delegate authentication to the correct `AuthenticationService` based on the `{idpProvider}` path variable.
The AccessRuleService was relocated from the authorization package and the references in AccessRuleController and AccessRuleServiceTest were updated accordingly. This step simplifies the structure of the service layer by reducing unnecessary package hierarchy.
The FENCEAuthenticationService is no longer responsible for making Roles, Privileges, and AccessRules. The functionality has been moved to related services. Additionally, migrated the word "FENCE" to "MANAGED" as refactor our psama application we want a more generic naming convention. Roles, Privileges, and AccessRules are now either MANUAL or MANAGED.
The commit modifies several SQL update statements in our database script. It changes naming convention from 'FENCE' to 'MANAGED' throughout role, privilege, and access rule tables.
The commit involves renaming of two SQL migration scripts. Added additional '_' to match wildfly naming convention
Updated RestClientUtil to include a method that creates a RequestConfig with a custom timeout. Adapted the implementation in FENCEAuthenticationService and Auth0AuthenticationService to utilize this new method. This change is created to offer more flexibility and control during REST client calls.
Additionally, I have removed the unused code.
A log has been added to the FENCEAuthenticationService to record the user profile information returned by the FENCE authentication server. This will assist in debugging any issues involving user profile retrieval.
# Conflicts: # pic-sure-auth-services/src/main/resources/application.properties
Some logger.info() calls in the authorization service were changed to logger.debug(). This was done to reduce the noise in the logs in normal operation, and only log these events at debug level for troubleshooting purposes.
A timer has been added to the 'isAuthorized' method in the 'AuthorizationService' class. It calculates the time taken for the login process and logs the result, providing useful information for performance evaluation and potential optimization.
Performance has been improved for privilege accumulation in the User entity. This was achieved by replacing standard forEach loops with parallelStreams, increasing efficiency particularly with large sets of user roles and privileges.
Introduced a caching mechanism to the access rule processing in the AuthorizationService, where access rules are now stored in a cache for each user. The caching system significantly reduces the time to process access rules, particularly for users with large numbers of privileges. Extra methods were also added to the AccessRuleService to handle cache evictions when a user's privileges are updated.
This commit introduces CustomKeyGenerator to generate the caching key based on the user's email. The caching workflow in services like UserService and AccessRuleService has been updated to use this CustomKeyGenerator. The cache eviction logic now uses the user's email, improving maintainability and supporting future scalability. Some unnecessary logs and time calculations have also been removed.
Fixed missing space between MANAGED and other values.
Removed
OpenAuthenticationController
,OktaAuthenticationController
, andAuthController
.Created the
AuthenticationService
interface. All authentication service classes MUST implement this interface. This interface contains three methods:authenticate
,getProvider()
, andisEnabled()
.authenticate
: Implements the specific authentication logic for each authentication service.getProvider
: Returns the name of the provider, e.g.,fence
,open
,auth0
, etc. These values must correspond to theidpProvider
value in the authentication controller path/auth/authentication/{idpProvider}
. This value is used to look up the correct authentication service in theAuthenticationServiceRegistry
class.isEnabled
: Returnstrue
orfalse
based on the correspondingapplication.properties
value.Created the
AuthenticationServiceRegistry
. This service registry maintains a map of all enabledAuthenticationService
services and provides agetAuthenticationService
method that returns anAuthenticationService
based on the provider string.Created the
AuthenticationController
. This controller uses theAuthenticationServiceRegistry
to dynamically delegate authentication to the correctAuthenticationService
based on the{idpProvider}
path variable.