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

[ELY-2548] BasicAuthenticationMechanism should return FORBIDDEN inste… #1899

Closed
wants to merge 1 commit into from

Conversation

keshav-725
Copy link

@keshav-725 keshav-725 commented Apr 25, 2023

Copy link
Contributor

@Skyllarr Skyllarr left a comment

Choose a reason for hiding this comment

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

Hi @keshav-725 , looks good, can you please add a simple test for it in this PR? I know you have tests with your HttpClient implementation but it would be good to have a test related to this change in this PR as well.

The test you add here can have a hard coded value in the Authorization header and you can update the callbackhandler in AbstractBaseHttpTest class to handle an unauthorized user. Thanks!

@@ -170,7 +171,7 @@ public void evaluateRequest(final HttpServerRequest request) throws HttpAuthenti
httpBasic.debugf("User %s authorization failed.", username);
fail();

request.authenticationFailed(httpBasic.authorizationFailed(username), response -> prepareResponse(request, displayRealmName, response));
request.authenticationFailed(httpBasic.authorizationFailed(username), httpResponse -> httpResponse.setStatusCode(HttpConstants.FORBIDDEN));
Copy link
Contributor

Choose a reason for hiding this comment

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

hi @keshav-725 , just a nitpick, but just to be consistent with the lines below (line 182) and above in this class I would rename to response :

response -> response.setStatusCode(HttpConstants.FORBIDDEN));

@Skyllarr
Copy link
Contributor

Skyllarr commented May 3, 2023

@keshav-725 Please squash the commits into 1, otherwise this LGTM, thanks!

@keshav-725
Copy link
Author

@keshav-725 Please squash the commits into 1, otherwise this LGTM, thanks!

Hi @Skyllarr ,squashed the commit.Thanks!

@Skyllarr
Copy link
Contributor

Skyllarr commented May 5, 2023

@keshav-725 Thanks!

@darranl
Copy link
Contributor

darranl commented Mar 14, 2024

Superseded by #2108

@darranl darranl closed this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants