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

refactor(general): better encapsulate user profile implementation #3910

Closed
wants to merge 5 commits into from

Conversation

julio-lopez
Copy link
Collaborator

@julio-lopez julio-lopez commented Jun 10, 2024

Motivation: better encapsulate the implementation details for user profiles, in particular with respect to password hashing schemes.

  • Pass hash version to computePasswordHash to encapsulate the internal representation of hashing schemes in user profiles.
  • Add user.GetNewProfile helper to initialize a user.Profile in the user package. This avoids exposing hashing versions outside of the user package.

@julio-lopez julio-lopez changed the title User new profile refactor(general): add user.GetNewProfile helper Jun 10, 2024
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Project coverage is 77.20%. Comparing base (cb455c6) to head (2061edf).
Report is 160 commits behind head on master.

Files Patch % Lines
internal/user/user_manager.go 75.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3910      +/-   ##
==========================================
+ Coverage   75.86%   77.20%   +1.33%     
==========================================
  Files         470      482      +12     
  Lines       37301    28803    -8498     
==========================================
- Hits        28299    22237    -6062     
+ Misses       7071     4660    -2411     
+ Partials     1931     1906      -25     

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

@julio-lopez julio-lopez changed the title refactor(general): add user.GetNewProfile helper refactor(general): encapsulate hashing details in user profile Jun 11, 2024
@julio-lopez julio-lopez changed the title refactor(general): encapsulate hashing details in user profile refactor(general): better encapsulate user profile implementation Jun 11, 2024
This helper encapsulates how a user profile is initialized.
This way, internals of the user package do not need to be exposed.
@julio-lopez julio-lopez deleted the user-new-profile branch July 12, 2024 01:18
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.

1 participant