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

feat: Add Authenticator Checks unit tests #45

Merged
merged 11 commits into from
Mar 18, 2024

Conversation

ZeynabRezaei
Copy link
Member

No description provided.

@navidnabavi
Copy link
Contributor

Screenshot 2024-03-03 at 12 49 33 Can you cover these branches?

@ZeynabRezaei
Copy link
Member Author

@navidnabavi Sure, I will add them.

@navidnabavi
Copy link
Contributor

Updates?

Copy link
Contributor

@pedy4000 pedy4000 left a comment

Choose a reason for hiding this comment

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

🥇 @ZeynabRezaei

we have to handle "CerberusReasonUpstreamAuthFailed", "CerberusReasonUpstreamAuthTimeout" errors in next steps, and write test for them.

@pedy4000
Copy link
Contributor

Screenshot 2024-03-03 at 12 49 33 Can you cover these branches?

thanks to @ZeynabRezaei 🔥
this tests added to, coverage change from 66.4% to 77.8%.

Copy link
Contributor

@pedy4000 pedy4000 left a comment

Choose a reason for hiding this comment

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

Welldone 👍🏼

@pedy4000 pedy4000 merged commit 3b000c4 into main Mar 18, 2024
2 checks passed
@@ -187,7 +187,7 @@ func (a *Authenticator) Check(ctx context.Context, request *Request) (finalRespo
reason, cerberusExtraHeaders = a.TestAccess(request, wsvcCacheEntry)

extraHeaders = toExtraHeaders(cerberusExtraHeaders)
if reason == CerberusReasonOK && hasUpstreamAuth(wsvcCacheEntry) {
if reason == "" && hasUpstreamAuth(wsvcCacheEntry) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not using constants?

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