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

Merged
merged 2 commits into from
Oct 3, 2024
Merged

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
Copy link
Contributor

@hf hf left a comment

Choose a reason for hiding this comment

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

Looks great.

@J0 J0 merged commit 410b8ac into master Oct 3, 2024
2 checks passed
@J0 J0 deleted the j0/adjust_mfa_status_codes branch October 3, 2024 15:46
J0 pushed a commit that referenced this pull request Oct 5, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.162.2](v2.162.1...v2.162.2)
(2024-10-05)


### Bug Fixes

* refactor mfa validation into functions
([#1780](#1780))
([410b8ac](410b8ac))
* upgrade ci Go version
([#1782](#1782))
([97a48f6](97a48f6))
* validateEmail should normalise emails
([#1790](#1790))
([2e9b144](2e9b144))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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