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

Two factor refactoring. #86

Open
wants to merge 7 commits into
base: 7.next-cake4
Choose a base branch
from

Conversation

skie
Copy link
Member

@skie skie commented Feb 8, 2024

Extract two factor logic into separate classes processing each type of 2fa.

@skie skie assigned skie and steinkel and unassigned skie Feb 8, 2024
@skie skie requested a review from steinkel February 8, 2024 22:14
@skie skie self-assigned this Feb 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2024

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (9e126f8) 90.32% compared to head (91fede5) 89.98%.
Report is 13 commits behind head on 7.next-cake4.

Files Patch % Lines
...Authentication/TwoFactorProcessor/U2FProcessor.php 72.72% 6 Missing ⚠️
...rc/Authentication/TwoFactorProcessorCollection.php 72.22% 5 Missing ⚠️
...cation/TwoFactorProcessor/Webauthn2faProcessor.php 84.21% 3 Missing ⚠️
...on/TwoFactorProcessor/OneTimePasswordProcessor.php 89.47% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                Coverage Diff                 @@
##             7.next-cake4      #86      +/-   ##
==================================================
- Coverage           90.32%   89.98%   -0.34%     
- Complexity            318      344      +26     
==================================================
  Files                  47       52       +5     
  Lines                 775      949     +174     
==================================================
+ Hits                  700      854     +154     
- Misses                 75       95      +20     

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

Copy link
Member

@steinkel steinkel left a comment

Choose a reason for hiding this comment

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

Also, please add some docs to cover the changes in configuration and usage

strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1']
php-version: ['7.4', '8.0', '8.1']
Copy link
Member

Choose a reason for hiding this comment

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

add 8.2 and 8.3

*
* @return bool
*/
public function enabled(): bool;
Copy link
Member

Choose a reason for hiding this comment

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

would it be better to use isEnabled to match with the other methods

*/
public function build()
{
$className = Configure::read('Webauthn2fa.checker');
$interfaces = class_implements($className);
$required = Webauthn2FAuthenticationCheckerInterface::class;
$required = Webauthn2fAuthenticationCheckerInterface::class;
Copy link
Member

Choose a reason for hiding this comment

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

why this change?

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