Skip to content

Commit

Permalink
[Authorization Service] Remove unused authenticate method (apache#12951)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljmarshall authored Nov 29, 2021
1 parent 056ed2b commit 7bffdb2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ public AuthenticationService(ServiceConfiguration conf) throws PulsarServerExcep
}
}

public String authenticate(AuthenticationDataSource authData, String authMethodName)
throws AuthenticationException {
AuthenticationProvider provider = providers.get(authMethodName);
if (provider != null) {
return provider.authenticate(authData);
} else {
if (StringUtils.isNotBlank(anonymousUserRole)) {
return anonymousUserRole;
}
throw new AuthenticationException("Unsupported authentication mode: " + authMethodName);
}
}

public String authenticateHttpRequest(HttpServletRequest request) throws AuthenticationException {
AuthenticationException authenticationException = null;
AuthenticationDataSource authData = new AuthenticationDataHttps(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ public class AuthenticationServiceTest {

private static final String s_authentication_success = "authenticated";

@Test(timeOut = 10000)
public void testAuthentication() throws Exception {
ServiceConfiguration config = new ServiceConfiguration();
Set<String> providersClassNames = Sets.newHashSet(MockAuthenticationProvider.class.getName());
config.setAuthenticationProviders(providersClassNames);
config.setAuthenticationEnabled(true);
AuthenticationService service = new AuthenticationService(config);
String result = service.authenticate(null, "auth");
assertEquals(result, s_authentication_success);
service.close();
}

@Test(timeOut = 10000)
public void testAuthenticationHttp() throws Exception {
ServiceConfiguration config = new ServiceConfiguration();
Expand Down

0 comments on commit 7bffdb2

Please sign in to comment.