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

SIMSBIOHUB-154: System user table updates #1060

Merged
merged 19 commits into from
Aug 10, 2023
Merged

SIMSBIOHUB-154: System user table updates #1060

merged 19 commits into from
Aug 10, 2023

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented Jul 27, 2023

Links to Jira Tickets

https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-154?

Description of Changes

  • Add migration to:
    • Add new system user permission tables
    • Add new fields to system_user table
    • Add new identity source type: UNVERIFIED
      • Used to classify a user with no IDIR/BCeID information (no verified credential)
  • Remove unused SYSTEM user identity source type (API/APP)
  • Update user seed
    • Account for new system_user fields
  • Update database readme

Testing Notes

  • Migration runs successfully
  • Application functions as normal (new tables should not impact current functionality)

@NickPhura NickPhura changed the title SIMSBIOHUB-154: Add migration to enhance system user tables SIMSBIOHUB-154: System user table updates Jul 27, 2023
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #1060 (42fe6ee) into dev (eb4d16d) will decrease coverage by 0.02%.
The diff coverage is 77.58%.

@@            Coverage Diff             @@
##              dev    #1060      +/-   ##
==========================================
- Coverage   67.57%   67.55%   -0.02%     
==========================================
  Files         403      403              
  Lines       12509    12570      +61     
  Branches     2088     2106      +18     
==========================================
+ Hits         8453     8492      +39     
- Misses       3522     3538      +16     
- Partials      534      540       +6     
Files Changed Coverage Δ
...c/paths/project/{projectId}/participants/create.ts 86.11% <ø> (ø)
api/src/paths/user/self.ts 96.00% <ø> (ø)
api/src/repositories/user-repository.ts 97.91% <ø> (ø)
app/src/features/admin/users/AccessRequestList.tsx 75.55% <ø> (ø)
app/src/features/admin/users/ActiveUsersList.tsx 30.76% <ø> (ø)
...pp/src/features/admin/users/AddSystemUsersForm.tsx 15.38% <0.00%> (-4.62%) ⬇️
...p/src/features/projects/list/ProjectsListTable.tsx 62.96% <ø> (ø)
...ojects/participants/AddProjectParticipantsForm.tsx 0.00% <0.00%> (ø)
app/src/hooks/useKeycloakWrapper.tsx 70.17% <ø> (ø)
app/src/pages/access/AccessRequestPage.tsx 69.38% <ø> (ø)
... and 10 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

* Remove unused `SYSTEM` user identity source type
* Update user seed
* Update database readme
@NickPhura NickPhura marked this pull request as ready for review July 31, 2023 20:21
al-rosenthal
al-rosenthal previously approved these changes Jul 31, 2023
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

👤

@al-rosenthal al-rosenthal self-requested a review August 1, 2023 00:28
al-rosenthal
al-rosenthal previously approved these changes Aug 1, 2023
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

ran this locally and it worked after editing the user name ⚡

* Add keycloak user information zod schemas
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

I also noticed an issue under manage users tabs:

  • reviewing a request fails
  • adding a user fails

api/src/services/user-service.ts Outdated Show resolved Hide resolved
api/src/repositories/user-repository.ts Outdated Show resolved Hide resolved
KjartanE
KjartanE previously approved these changes Aug 4, 2023
Copy link
Contributor

@KjartanE KjartanE left a comment

Choose a reason for hiding this comment

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

🐈

@curtisupshall curtisupshall self-assigned this Aug 8, 2023
api/src/paths/user/add.ts Show resolved Hide resolved
api/src/services/keycloak-service.ts Show resolved Hide resolved
api/src/services/keycloak-service.ts Show resolved Hide resolved
api/src/services/keycloak-service.ts Show resolved Hide resolved
api/src/utils/keycloak-utils.ts Show resolved Hide resolved
api/src/utils/keycloak-utils.ts Show resolved Hide resolved
api/src/utils/keycloak-utils.ts Show resolved Hide resolved
Copy link
Contributor

@curtisupshall curtisupshall left a comment

Choose a reason for hiding this comment

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

I added my alt BCeID Basic account (putting curtisupshalldev into the Username field), and the account was added as a System Administrator successfully. Then I logged into said account, but I was denied access. I then request access from my curtisupshalldev account, and approved it as a Data Administrator. So now there are two accounts with the same username - one that I explicitly added, and one that I approved.

image

curtisupshall
curtisupshall previously approved these changes Aug 9, 2023
Copy link
Contributor

@curtisupshall curtisupshall left a comment

Choose a reason for hiding this comment

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

Code looks good; tested adding a user and it locally and works as expected 👑

al-rosenthal
al-rosenthal previously approved these changes Aug 9, 2023
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

🕶️

al-rosenthal
al-rosenthal previously approved these changes Aug 9, 2023
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

🧄

Fix code smell.
@sonarcloud
Copy link

sonarcloud bot commented Aug 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

🧯

@NickPhura NickPhura merged commit ae70b16 into dev Aug 10, 2023
19 of 20 checks passed
@NickPhura NickPhura deleted the SIMSBIOHUB-154 branch August 10, 2023 19:28
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.

4 participants