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

TechDebt: Fix Patch System User SQL #1341

Merged
merged 3 commits into from
Aug 16, 2024
Merged

TechDebt: Fix Patch System User SQL #1341

merged 3 commits into from
Aug 16, 2024

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented Aug 13, 2024

Links to Jira Tickets

n/a

Description of Changes

  • Fix Patch System User SQL
  • Fix /self endpoint
    • The endpoint was rejecting any system user that had no user_guid, because the authorization check runs before the patch sql, and only uses the user_guid. It is safe to remove the authorization scheme because the endpoint already checks for a valid systemUserId, which can only exist if the connection is opened with the token successfully.
    • Rename endpoint function to getSelf for better readability.

Testing Notes

  • When a user logs in, everything should work as expected: (the patch is called, the user context is set, and the self endpoint is called).
  • If you manually set the user_guid column of your system_user record to null, and then log in, all of the calls should succeed, and your user_guid should be re-added to your system_user record.

Fix self endpoint rejecting users if they are missing a guid (because the patch has not had a chance to run yet).
@NickPhura NickPhura added the Ready For Review PR is ready for review label Aug 13, 2024
@NickPhura NickPhura requested a review from MacQSL August 13, 2024 23:35
Copy link

sonarcloud bot commented Aug 16, 2024

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (dev@27811fb). Learn more about missing BASE report.
Report is 1 commits behind head on dev.

Additional details and impacted files
@@          Coverage Diff           @@
##             dev    #1341   +/-   ##
======================================
  Coverage       ?   47.85%           
======================================
  Files          ?      728           
  Lines          ?    19890           
  Branches       ?     3130           
======================================
  Hits           ?     9518           
  Misses         ?     9775           
  Partials       ?      597           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mauberti-bc mauberti-bc left a comment

Choose a reason for hiding this comment

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

Tested locally by removing my GUID and it successfully patched my record 👍 Also added a missing key prop from an old PR

@mauberti-bc mauberti-bc merged commit c276f1b into dev Aug 16, 2024
22 checks passed
@mauberti-bc mauberti-bc deleted the npTechDebt_Patch_User branch August 16, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants