use of io.pravega.shared.rest.security.RESTAuthHelper in project pravega by pravega.
the class RESTAuthHelperTest method testAuthIsEnabledWhenPravegaAuthManagerIsNonNull.
@Test
public void testAuthIsEnabledWhenPravegaAuthManagerIsNonNull() {
RESTAuthHelper sut = new RESTAuthHelper(new AuthHandlerManager(null));
assertTrue(sut.isAuthEnabled());
}
use of io.pravega.shared.rest.security.RESTAuthHelper in project pravega by pravega.
the class RESTAuthHelperTest method testAuthIsDisabledWhenPravegaAuthManagerIsNull.
@Test
public void testAuthIsDisabledWhenPravegaAuthManagerIsNull() {
RESTAuthHelper sut = new RESTAuthHelper(null);
assertFalse(sut.isAuthEnabled());
}
use of io.pravega.shared.rest.security.RESTAuthHelper in project pravega by pravega.
the class RESTAuthHelperTest method testAuthOkWhenAuthMgrIsNull.
@Test
public void testAuthOkWhenAuthMgrIsNull() throws AuthException {
RESTAuthHelper authHelper = new RESTAuthHelper(null);
assertTrue(authHelper.isAuthorized(null, null, null, null));
authHelper.authenticate(null);
authHelper.authorize(null, null, null, null);
authHelper.authenticateAuthorize(null, null, null);
}
use of io.pravega.shared.rest.security.RESTAuthHelper in project pravega by pravega.
the class RESTAuthHelperTest method init.
@Before
public void init() {
RESTServerConfig config = RESTServerConfigImpl.builder().host("localhost").port(TestUtils.getAvailableListenPort()).authorizationEnabled(true).userPasswordFile("passwd").tlsEnabled(false).build();
AuthHandlerManager authManager = new AuthHandlerManager(config);
authManager.registerHandler(new FakeAuthHandler());
authHelper = new RESTAuthHelper(authManager);
}
Aggregations