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 LoginMethod & AuthSettings #241

Merged
merged 10 commits into from
Oct 3, 2023
Merged

Refactor LoginMethod & AuthSettings #241

merged 10 commits into from
Oct 3, 2023

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Sep 18, 2023

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Refactor LoginMethod to contain details from AuthSettings. I believe this more accurately represents the available state for Service Accounts, Organization keys and other login methods like TDE where KDF aren't applicable.

To facilitate these the following changes were made:

  • request_prelogin is now directly called instead of implicitly in determine_password_hash.
  • Since AuthSettings is removed, the helper for derive_user_password_hash is gone, and the master key needs to be manually created. I believe this moves us in a direction where we avoid re-building it constantly.

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)

@Hinton Hinton requested a review from dani-garcia September 18, 2023 10:06
@bitwarden-bot
Copy link

bitwarden-bot commented Sep 18, 2023

Logo
Checkmarx One – Scan Summary & Details98f21d99-5595-4616-81bc-fc9e3135a5b2

No New Or Fixed Issues Found

@Hinton Hinton marked this pull request as ready for review September 18, 2023 11:06
crates/bitwarden/src/auth/login/api_key.rs Outdated Show resolved Hide resolved
crates/bitwarden/src/auth/login/two_factor.rs Outdated Show resolved Hide resolved
crates/bitwarden/src/mobile/kdf.rs Show resolved Hide resolved
crates/bitwarden/src/client/encryption_settings.rs Outdated Show resolved Hide resolved
dani-garcia
dani-garcia previously approved these changes Sep 25, 2023
@Hinton Hinton merged commit db2236c into master Oct 3, 2023
45 checks passed
@Hinton Hinton deleted the ps/login-type branch October 3, 2023 21:57
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