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

perf: face mfa filter #1588

Merged
merged 1 commit into from
Nov 20, 2024
Merged

perf: face mfa filter #1588

merged 1 commit into from
Nov 20, 2024

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Nov 20, 2024

perf: face mfa filter

@fit2bot fit2bot requested a review from a team November 20, 2024 06:41
@@ -37,6 +37,7 @@ func (u *UserAuthClient) Authenticate(ctx context.Context) (user model.User, aut
return
}
unsupportedMfaTypes := map[string]bool{
"face": true,
"FACE": true,
}
if resp.Err != "" {

Choose a reason for hiding this comment

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

To provide comprehensive recommendations:

Firstly, ensure the implementation matches the interface correctly; if unsupportedMfaTypes is intended to contain string boolean types, then use them properly. Secondly, consider using consistent indentation and spacing within the function blocks.

Potential issues or irregularities found:

  • The docstring seems unnecessary since it's not related to the current functionality of the Authenticate method which takes a channel argument instead of returning an error as shown in the original code snippet.

Optimization Suggestions:

None immediately evident from reviewing the sample provided.

For full review:

func (u *UserAuthClient) Authenticate(ctx context.Context, ch <-chan user.MFAInfoMessage) (user model.User, auto bool)

// ...
if resp.Err != "" {
    panic(err.Error())
}

return u.user(), true // Assuming 'true' should match with the expected result

This version fixes any apparent errors while suggesting better practices that could enhance readability and efficiency over the given code.

Copy link

sonarcloud bot commented Nov 20, 2024

@LeeEirc LeeEirc merged commit 6db670f into dev Nov 20, 2024
5 of 6 checks passed
@LeeEirc LeeEirc deleted the pr@dev@perf_mfa branch November 20, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants