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

Add user update endpoint #1011

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Add user update endpoint #1011

wants to merge 7 commits into from

Conversation

cikzh
Copy link
Contributor

@cikzh cikzh commented Feb 10, 2025

Closes #873

Adds endpoint to update a user. Also adds the needs_password_change flag and sets it to true when the user is newly created, or when a temporary password is set. The handling of the flag is out of scope for this PR.

In draft until I've implemented a test for the needs_password_change flag

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 88.09524% with 10 lines in your changes missing coverage. Please review.

Project coverage is 89.72%. Comparing base (ce5b730) to head (19916ec).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
backend/src/authentication/user.rs 81.81% 9 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1011      +/-   ##
==========================================
- Coverage   89.77%   89.72%   -0.05%     
==========================================
  Files         248      248              
  Lines       12995    13078      +83     
  Branches     1318     1320       +2     
==========================================
+ Hits        11666    11734      +68     
- Misses       1235     1249      +14     
- Partials       94       95       +1     

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

Copy link

github-actions bot commented Feb 10, 2025

Sigrid maintainability feedback

✅ You wrote maintainable code and achieved your objective of 3.5 stars

Show details

Sigrid compared your code against the baseline of 2025-02-11.

👍 What went well?

You fixed or improved 0 refactoring candidates.

👎 What could be better?

Unfortunately, 12 refactoring candidates were introduced or got worse.

Risk System property Location
🔴 Duplication
(Introduced)
backend/src/authentication/user.rs (lines 263-275)
backend/src/authentication/user.rs (lines 288-300)
🔴 Duplication
(Introduced)
backend/src/authentication/user.rs (lines 160-170)
backend/src/authentication/user.rs (lines 201-211)
🔴 Duplication
(Introduced)
backend/src/authentication/user.rs (lines 161-169)
backend/src/authentication/user.rs (lines 202-210)
backend/src/authentication/user.rs (lines 315-323)
🔴 Unit Size
(Worsened)
backend/src/lib.rs
router(SqlitePool)
🟠 Unit Interfacing
(Introduced)
backend/src/authentication/api.rs
user_update(any,any,any,any,any,any)
🟡 Unit Size
(Worsened)
backend/src/authentication/user.rs
Users.get_by_id(u32)
🟡 Unit Size
(Introduced)
backend/src/authentication/user.rs
Users.update(u32,Option,Option)
🟡 Unit Size
(Worsened)
backend/src/authentication/user.rs
Users.get_by_username(str)
⚫️ + 4 more

📚 Remaining technical debt

3 refactoring candidates didn't get better or worse, but are still present in the code you touched.

View this system in Sigrid** to explore your technical debt

⭐️ Sigrid ratings

System property System on 2025-02-11 Before changes New/changed code
Volume 5.2 N/A N/A
Duplication 4.3 4.0 3.6
Unit Size 2.4 2.1 2.2
Unit Complexity 3.4 5.5 5.5
Unit Interfacing 3.0 1.9 1.4
Module Coupling 4.0 5.5 5.5
Component Independence 2.8 N/A N/A
Component Entanglement 3.7 N/A N/A
Maintainability 3.6 4.2 4.1

💬 Did you find this feedback helpful?

We would like to know your thoughts to make Sigrid better.
Your username will remain confidential throughout the process.


View this system in Sigrid

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.

Update user in backend
1 participant