Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/java 21 Merge Fence Branch #166

Merged
merged 9 commits into from
Jun 21, 2024
Merged

Conversation

Gcolon021
Copy link
Contributor

@Gcolon021 Gcolon021 commented May 3, 2024

Build

  • Created Jenkinsfile.fence, which is used by Jenkins to build and upload this application to S3.

AccessRule

Merged both AccessRule entities.

  • Added two AccessRule.TypeNaming constants: ALL_CONTAINS_OR_EMPTY and ALL_CONTAINS_OR_EMPTY_IGNORE_CASE.
  • Migrated subAccessRule and subAccessRuleParent to a single subAccessRule property that uses a @JoinTable to represent the same relationship.
  • Added a new migration script to update existing AccessRule tables to use the new JoinTable.

AccessRuleService

Merged both AccessRuleService classes.

  • Updated all logic to account for the two new AccessRule.TypeNaming constants.
  • Refactored the AccessRule cache in the FENCE branch to use Spring's @Cacheable and @CacheEvict.

AuthorizationService

Merged both AuthorizationService classes.

  • Introduced a new property named strictConnections, which is assigned a comma-separated list of connection labels. These connections will be evaluated using a more strict authentication flow, requiring the user to have associated access rules and privileges. For non-strict connections, the user only needs associated privileges.
    • This approach may be revisited later. Standardizing on one approach is advisable.

FenceAuthenticationService

  • Removed the existing FenceAuthenticationService and replaced it with the version from the Fence-specific branch.
  • Incorporated the most recent changes to Role, Privilege, AccessRule, and Fence Mapping into the FenceAuthenticationService, including the FenceMappingUtility class.

Additional Authentication Services

  • Added Okta0AuthAuthenticationService, OpenAuthenticationService, and StudyAccessService to the merged branch. These services previously existed only in the Fence branch.

Controllers

  • Refactored all service classes migrated from the Fence-specific branch to have associated Controller classes.

Java 21 & Spring

  • Refactored all classes migrated from the Fence-specific branch to accommodate Java 21, Spring Boot 3, and Spring 6.

Unit Test

  • Merged all unit tests from the Fence branch into related test classes or added them to the project. Ensured that no test changes were logically altered, providing confidence when merging and refactoring classes. The goal was to ensure no currently available test cases failed.

@Gcolon021 Gcolon021 self-assigned this May 3, 2024
@Gcolon021 Gcolon021 added the enhancement New feature or request label May 6, 2024
@Gcolon021 Gcolon021 changed the base branch from feature/java-21 to release June 7, 2024 15:54
@Gcolon021 Gcolon021 force-pushed the feature/java-21-Merge-Fence branch 3 times, most recently from 0fa2a1f to 21326d0 Compare June 14, 2024 19:46
@Gcolon021 Gcolon021 changed the title WIP: Feature/java 21 Merge Fence Branch Feature/java 21 Merge Fence Branch Jun 14, 2024
### Build
- Created `Jenkinsfile.fence`, which is used by Jenkins to build and upload this application to S3.

### AccessRule
Merged both `AccessRule` entities.
- Added two `AccessRule.TypeNaming` constants: `ALL_CONTAINS_OR_EMPTY` and `ALL_CONTAINS_OR_EMPTY_IGNORE_CASE`.
- Migrated `subAccessRule` and `subAccessRuleParent` to a single `subAccessRule` property that uses a `@JoinTable` to represent the same relationship.
- Added a new migration script to update existing `AccessRule` tables to use the new `JoinTable`.

### AccessRuleService
Merged both `AccessRuleService` classes.
- Updated all logic to account for the two new `AccessRule.TypeNaming` constants.
- Refactored the AccessRule cache in the FENCE branch to use Spring's `@Cacheable` and `@CacheEvict`.

### AuthorizationService
Merged both `AuthorizationService` classes.
- Introduced a new property named `strictConnections`, which is assigned a comma-separated list of connection labels. These connections will be evaluated using a more strict authentication flow, requiring the user to have associated access rules and privileges. For non-strict connections, the user only needs associated privileges.
    - This approach may be revisited later. Standardizing on one approach is advisable.

### FenceAuthenticationService
- Removed the existing `FenceAuthenticationService` and replaced it with the version from the Fence-specific branch.
- Incorporated the most recent changes to Role, Privilege, AccessRule, and Fence Mapping into the `FenceAuthenticationService`, including the `FenceMappingUtility` class.

### Additional Authentication Services
- Added `Okta0AuthAuthenticationService`, `OpenAuthenticationService`, and `StudyAccessService` to the merged branch. These services previously existed only in the Fence branch.

### Controllers
- Refactored all service classes migrated from the Fence-specific branch to have associated `Controller` classes.

### Java 21 & Spring
- Refactored all classes migrated from the Fence-specific branch to accommodate Java 21, Spring Boot 3, and Spring 6.

### Unit Test
- Merged all unit tests from the Fence branch into related test classes or added them to the project. Ensured that no test changes were logically altered, providing confidence when merging and refactoring classes. The goal was to ensure no currently available test cases failed.
@Gcolon021 Gcolon021 force-pushed the feature/java-21-Merge-Fence branch from 21326d0 to 332e12c Compare June 14, 2024 20:15
@Gcolon021 Gcolon021 added the dependencies Pull requests that update a dependency file label Jun 14, 2024
The logging level in both the TokenService and AuthorizationService has been changed from info to debug. This change helps to manage the verbosity of logs, ensuring that only crucial information is logged at the info level.
@JamesPeck JamesPeck removed the dependencies Pull requests that update a dependency file label Jun 21, 2024
Added three new model classes: BioDataCatalyst, StudyMetaData and IsHarmonizedDeserializer. These classes are used when parsing fence_mapping.json.
Updated the FenceMappingUtility.java and associated test cases to use new model classes: BioDataCatalyst and StudyMetaData. Additionally, roles are now created after the application Context is initialized.
…factoring

The code has been modified to include an additional check in FENCEAuthenticationService to ensure that FENCEMapping is not empty before creating access rules. This will prevent unnecessary errors and exception handling.
The persistAll method in RoleService.java has been revised to return a list of Role objects after saving them. This change is also reflected in FENCEAuthenticationService.java where the returned list of new roles is now properly assigned to newRoles.
@Gcolon021 Gcolon021 merged commit 8db8910 into release Jun 21, 2024
2 checks passed
@Gcolon021 Gcolon021 deleted the feature/java-21-Merge-Fence branch June 21, 2024 16:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants