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

fix: refactor mfa validation into functions #1780

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

J0
Copy link
Contributor

@J0 J0 commented Sep 28, 2024

What kind of change does this PR introduce?

We make the following changes:

  • Move all checks for factor validation into a single function. This ensures that we can re-use it across methods so we don't miss checks
  • Removes un-used functions
  • For MFA (TOTP) changes the duplicate friendly name from one that is done at the database level to one that is done at the application level. This aligns with MFA (Phone)

@J0 J0 mentioned this pull request Sep 28, 2024
@coveralls
Copy link

coveralls commented Sep 30, 2024

Pull Request Test Coverage Report for Build 11113434198

Details

  • 30 of 41 (73.17%) changed or added relevant lines in 1 file are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.001%) to 57.967%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/mfa.go 30 41 73.17%
Files with Coverage Reduction New Missed Lines %
internal/utilities/postgres.go 4 75.68%
internal/api/mfa.go 5 65.84%
Totals Coverage Status
Change from base Build 11077276448: 0.001%
Covered Lines: 9342
Relevant Lines: 16116

💛 - Coveralls

@J0 J0 marked this pull request as ready for review September 30, 2024 20:05
@J0 J0 requested a review from a team as a code owner September 30, 2024 20:05
@J0 J0 force-pushed the j0/adjust_mfa_status_codes branch from 1578d18 to 0245a3b Compare September 30, 2024 20:07
@J0 J0 force-pushed the j0/adjust_mfa_status_codes branch from 0245a3b to 22e230f Compare September 30, 2024 20:08
@@ -269,10 +269,6 @@ func (f *Factor) DowngradeSessionsToAAL1(tx *storage.Connection) error {
return updateFactorAssociatedSessions(tx, f.UserID, f.ID, AAL1.String())
}

func (f *Factor) IsOwnedBy(user *User) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unused

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.

2 participants