use of io.pravega.client.control.impl.PravegaCredentialsWrapper in project pravega by pravega.
the class ControllerGrpcAuthFocusedTest method prepareBlockingCallStubStrict.
private ControllerServiceBlockingStub prepareBlockingCallStubStrict(String username, String password) {
Exceptions.checkNotNullOrEmpty(username, "username");
Exceptions.checkNotNullOrEmpty(password, "password");
ControllerServiceBlockingStub stub = ControllerServiceGrpc.newBlockingStub(inProcessChannelStrict);
// Set call credentials
Credentials credentials = new DefaultCredentials(password, username);
if (credentials != null) {
PravegaCredentialsWrapper wrapper = new PravegaCredentialsWrapper(credentials);
stub = stub.withCallCredentials(MoreCallCredentials.from(wrapper));
}
return stub;
}
use of io.pravega.client.control.impl.PravegaCredentialsWrapper in project pravega by pravega.
the class ControllerGrpcAuthFocusedTest method prepareBlockingCallStub.
private ControllerServiceBlockingStub prepareBlockingCallStub(String username, String password) {
Exceptions.checkNotNullOrEmpty(username, "username");
Exceptions.checkNotNullOrEmpty(password, "password");
ControllerServiceBlockingStub stub = ControllerServiceGrpc.newBlockingStub(inProcessChannel);
// Set call credentials
Credentials credentials = new DefaultCredentials(password, username);
if (credentials != null) {
PravegaCredentialsWrapper wrapper = new PravegaCredentialsWrapper(credentials);
stub = stub.withCallCredentials(MoreCallCredentials.from(wrapper));
}
return stub;
}
use of io.pravega.client.control.impl.PravegaCredentialsWrapper in project pravega by pravega.
the class ControllerGrpcAuthFocusedTest method prepareNonBlockingCallStub.
private ControllerServiceStub prepareNonBlockingCallStub(String username, String password) {
Exceptions.checkNotNullOrEmpty(username, "username");
Exceptions.checkNotNullOrEmpty(password, "password");
ControllerServiceGrpc.ControllerServiceStub stub = ControllerServiceGrpc.newStub(inProcessChannel);
// Set call credentials
Credentials credentials = new DefaultCredentials(password, username);
if (credentials != null) {
PravegaCredentialsWrapper wrapper = new PravegaCredentialsWrapper(credentials);
stub = stub.withCallCredentials(MoreCallCredentials.from(wrapper));
}
return stub;
}
Aggregations