Skip to content
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

Feature 1557/micronaut 3 upgrade #1717

Merged
merged 17 commits into from
Jun 23, 2022
Merged

Conversation

devaughns
Copy link
Collaborator

@devaughns devaughns commented Jun 14, 2022

Solves: #1557
Closes: #1468

Upgrades the entire check-ins application to Micronaut 3.4.3.
Items changed with the upgrade:

  • reactive items replaced with project reactor references
  • UserDetails replaced with Authentication
  • Reference to javax annotations are replaced with jakarta annotations

Implements a background refresh token so the user does not have to refresh the page in order to stay logged in.

paulrdurham and others added 11 commits March 30, 2022 08:55
Refresh token implementation

Initial MN 3 update

Removing timeout exception as it no longer exists

MailJet Reactor and Authentication

RequestLoggingInterceptor reactor and Authentication refactor

LocalLoginController Reactor and Authentication refactor

CheckinsOpenIdAuthenticationMapper Reactor and Authentication refactor

CustomRefreshTokenPersistence Reactor and Authentication refactor

LocalUserPasswordAuthProvider Reactor and Authentication refactor

CustomJWTClaimsSetGenerator Authentication refactor

AgendaItemController Reactor and Authentication refactor

CheckinDocumentController Reactor and Authentication refactor

CheckInController Reactor and Authentication refactor

DemographicsController Reactor and Authentication refactor

Mono.just to Mono.fromCallable

EmployeeHoursController Reactor and Authentication refactor

FeedbackController Reactor and Authentication refactor

FeedbackSuggestionsController Reactor and Authentication refactor

FeedbackAnswerController Reactor and Authentication refactor

CheckServicesController Reactor and Authentication refactor

QuestionAndAnswerController Reactor and Authentication refactor

FeedbackRequestController Reactor and Authentication refactor

FeedbackTemplateController Reactor and Authentication refactor

TemplateQuestionController Reactor and Authentication refactor

FileController Reactor and Authentication refactor

GuildController Reactor and Authentication refactor

AnniversaryReportController Reactor and Authentication refactor

BirthDayController Reactor and Authentication refactor

MemberPhotoController Reactor and Authentication refactor

MemberProfileController Reactor and Authentication refactor

RetentionReportController Reactor and Authentication refactor

MemberSkillController Reactor and Authentication refactor

SkillsReportController Reactor and Authentication refactor

OpportunitiesController Reactor and Authentication refactor

PermissionController Reactor and Authentication refactor

PrivateNoteController Reactor and Authentication refactor

PulseResponseController Reactor and Authentication refactor

QuestionController Reactor and Authentication refactor

QuestionCategoryController Reactor and Authentication refactor

RoleController Reactor and Authentication refactor

RolePermissionController Reactor and Authentication refactor

SettingsController Reactor and Authentication refactor

CombineSkillController Reactor and Authentication refactor

SkillController Reactor and Authentication refactor

SurveyController Reactor and Authentication refactor

EntityTagController Reactor and Authentication refactor

TagController Reactor and Authentication refactor

TeamController Reactor and Authentication refactor

Updating tests to pass with updated Flyway

Fixing tests for LocalLoginController

Fixing tests for ActionItemController

Fixing tests for AgendaItemController

Fixing tests for CheckinDocumentController

Fixing tests for CheckInController

Fixing tests for CheckinNoteController

Manually tested LocalLoginController

Fixing tests for DemographicsController

Fixing tests for FeedbackController

Fixing tests for FeedbackRequestController

Fixing tests for FeedbackTemplateController

Fixing tests for TemplateQuestionController

Fixing tests for GuildController

Fixing tests for GuildMemberController

Fixing tests for AnniversaryReportController

Fixing tests for BirthDayController

Fixing tests for MemberProfileController

Fixing tests for RetentionReportController

Fixing tests for MemberSkillController

Fixing tests for OpportunitiesController

Fixing tests for PermissionController

Fixing tests for PrivateNoteController

Fixing tests for PulseResponseController

Fixing tests for QuestionCategoryController

Fixing tests for QuestionController

Fixing tests for RolePermissionController

Fixing tests for RoleController

Fixing tests for SettingsController

Fixing tests for CombineSkillsController

Fixing tests for SurveyController

Fixing tests for EntityTagController

Fixing tests for TagController

Fixing tests for TeamMemberController

Fixing tests for TeamControllerTest

Removing TODOs after manually testing

Adding more fields to RefreshToken for more granular control

Enabling silent refreshing of an access-token

Fixing test
Refresh token implementation

Initial MN 3 update

Removing timeout exception as it no longer exists

MailJet Reactor and Authentication

RequestLoggingInterceptor reactor and Authentication refactor

LocalLoginController Reactor and Authentication refactor

CheckinsOpenIdAuthenticationMapper Reactor and Authentication refactor

CustomRefreshTokenPersistence Reactor and Authentication refactor

LocalUserPasswordAuthProvider Reactor and Authentication refactor

CustomJWTClaimsSetGenerator Authentication refactor

AgendaItemController Reactor and Authentication refactor

CheckinDocumentController Reactor and Authentication refactor

CheckInController Reactor and Authentication refactor

DemographicsController Reactor and Authentication refactor

Mono.just to Mono.fromCallable

EmployeeHoursController Reactor and Authentication refactor

FeedbackController Reactor and Authentication refactor

FeedbackSuggestionsController Reactor and Authentication refactor

FeedbackAnswerController Reactor and Authentication refactor

CheckServicesController Reactor and Authentication refactor

QuestionAndAnswerController Reactor and Authentication refactor

FeedbackRequestController Reactor and Authentication refactor

FeedbackTemplateController Reactor and Authentication refactor

TemplateQuestionController Reactor and Authentication refactor

FileController Reactor and Authentication refactor

GuildController Reactor and Authentication refactor

AnniversaryReportController Reactor and Authentication refactor

BirthDayController Reactor and Authentication refactor

MemberPhotoController Reactor and Authentication refactor

MemberProfileController Reactor and Authentication refactor

RetentionReportController Reactor and Authentication refactor

MemberSkillController Reactor and Authentication refactor

SkillsReportController Reactor and Authentication refactor

OpportunitiesController Reactor and Authentication refactor

PermissionController Reactor and Authentication refactor

PrivateNoteController Reactor and Authentication refactor

PulseResponseController Reactor and Authentication refactor

QuestionController Reactor and Authentication refactor

QuestionCategoryController Reactor and Authentication refactor

RoleController Reactor and Authentication refactor

RolePermissionController Reactor and Authentication refactor

SettingsController Reactor and Authentication refactor

CombineSkillController Reactor and Authentication refactor

SkillController Reactor and Authentication refactor

SurveyController Reactor and Authentication refactor

EntityTagController Reactor and Authentication refactor

TagController Reactor and Authentication refactor

TeamController Reactor and Authentication refactor

Updating tests to pass with updated Flyway

Fixing tests for LocalLoginController

Fixing tests for ActionItemController

Fixing tests for AgendaItemController

Fixing tests for CheckinDocumentController

Fixing tests for CheckInController

Fixing tests for CheckinNoteController

Manually tested LocalLoginController

Fixing tests for DemographicsController

Fixing tests for FeedbackController

Fixing tests for FeedbackRequestController

Fixing tests for FeedbackTemplateController

Fixing tests for TemplateQuestionController

Fixing tests for GuildController

Fixing tests for GuildMemberController

Fixing tests for AnniversaryReportController

Fixing tests for BirthDayController

Fixing tests for MemberProfileController

Fixing tests for RetentionReportController

Fixing tests for MemberSkillController

Fixing tests for OpportunitiesController

Fixing tests for PermissionController

Fixing tests for PrivateNoteController

Fixing tests for PulseResponseController

Fixing tests for QuestionCategoryController

Fixing tests for QuestionController

Fixing tests for RolePermissionController

Fixing tests for RoleController

Fixing tests for SettingsController

Fixing tests for CombineSkillsController

Fixing tests for SurveyController

Fixing tests for EntityTagController

Fixing tests for TagController

Fixing tests for TeamMemberController

Fixing tests for TeamControllerTest

Removing TODOs after manually testing

Adding more fields to RefreshToken for more granular control

Enabling silent refreshing of an access-token

Fixing test
…' into feature-1557/micronaut-3-upgrade

# Conflicts:
#	server/build.gradle
#	server/src/main/java/com/objectcomputing/checkins/notifications/email/MailJetSender.java
#	server/src/main/java/com/objectcomputing/checkins/services/agenda_item/AgendaItemController.java
#	server/src/main/java/com/objectcomputing/checkins/services/feedback_answer/question_and_answer/QuestionAndAnswerServicesImpl.java
#	server/src/main/java/com/objectcomputing/checkins/services/feedback_template/template_question/TemplateQuestionController.java
#	server/src/main/java/com/objectcomputing/checkins/services/questions/Question.java
Removing lowered exp time for testing
Comment on lines +34 to +44
return axios.get('/oauth/access_token', {
baseURL: BASE_API_URL,
withCredentials: true,
timeout: 30000
})
.then(() => {
// retry original request
return myAxios(err.config);
})
.catch(() => {
return Promise.reject(err);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main logic for getting a refresh token. Axios will intercept the HTTP 401 errors and attempt to retrieve an access token with the refresh token stored in the browser's cookies. Upon completion of the refresh token request, the original request will trigger.

user_name varchar,
date_created timestamp,
revoked boolean
);
Copy link
Collaborator Author

@devaughns devaughns Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a persistable refresh token. Included within this table is the revoked field. This is not yet implemented but could be useful in the future to revoke a refresh token if an employee should no longer have access but their browser still has an access token.

refresh-token:
enabled: true
path: /oauth/access_token
secret: ${ OAUTH_REFRESH_TOKEN_SECRET:'pleaseChangeThisSecretForANewOne' }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds an optional secret to be set within the Cloud Run instance.

@devaughns devaughns marked this pull request as ready for review June 14, 2022 20:42
@mkimberlin
Copy link
Member

Hey @devaughns any clue on the failing test in this?

@devaughns
Copy link
Collaborator Author

There seems to be an issue with using @ColumnTransformer on content in Feedback. It performs as expected with inserts and selects, but it is failing on updates. This seems to be a Micronaut issue. I'll need to hunt down whether it's implemented incorrectly, or if there is a bug in the version of Micronaut we're using.

@mkimberlin mkimberlin merged commit ec27c91 into develop Jun 23, 2022
@mkimberlin mkimberlin deleted the feature-1557/micronaut-3-upgrade branch June 23, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants