Skip to content

Commit

Permalink
Refactor: Removed an unnecessary comment and renamed PrestoAuthentica…
Browse files Browse the repository at this point in the history
…tor.java to CustomPrestoAuthenticator.java
  • Loading branch information
imsayari404 authored and sayarimukherjee committed Dec 13, 2024
1 parent 245eae2 commit c175051
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

import static java.util.Objects.requireNonNull;

public class PrestoAuthenticator
public class CustomPrestoAuthenticator
implements Authenticator
{
private PrestoAuthenticatorManager authenticatorManager;

@Inject
public PrestoAuthenticator(PrestoAuthenticatorManager authenticatorManager)
public CustomPrestoAuthenticator(PrestoAuthenticatorManager authenticatorManager)
{
this.authenticatorManager = requireNonNull(authenticatorManager, "authenticatorManager is null");
authenticatorManager.setRequired();
Expand All @@ -41,7 +41,6 @@ public Principal authenticate(HttpServletRequest request)
throws AuthenticationException
{
try {
//wrapped the original HttpServletRequest in a RestrictedHttpServletRequest
ReadOnlyHttpServletRequest restrictedRequest = new ReadOnlyHttpServletRequest(request);
return authenticatorManager.getAuthenticator().createAuthenticatedPrincipal(restrictedRequest);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ else if (authType == JWT) {
authBinder.addBinding().to(JsonWebTokenAuthenticator.class).in(Scopes.SINGLETON);
}
else if (authType == CUSTOM) {
authBinder.addBinding().to(PrestoAuthenticator.class).in(Scopes.SINGLETON);
authBinder.addBinding().to(CustomPrestoAuthenticator.class).in(Scopes.SINGLETON);
}
else {
throw new AssertionError("Unhandled auth type: " + authType);
Expand Down

0 comments on commit c175051

Please sign in to comment.