mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Rename AuthenticationInterceptor => TokenAuthInterceptor
This commit is contained in:
parent
24c245c2ea
commit
ca0658229b
@ -28,7 +28,7 @@ public class BisqCallCredentials extends CallCredentials {
|
||||
appExecutor.execute(() -> {
|
||||
try {
|
||||
Metadata headers = new Metadata();
|
||||
Key<String> creds = Key.of("bisqd-creds", ASCII_STRING_MARSHALLER);
|
||||
Key<String> creds = Key.of("bisq-api-token", ASCII_STRING_MARSHALLER);
|
||||
headers.put(creds, encodeCredentials());
|
||||
metadataApplier.apply(headers);
|
||||
} catch (Throwable ex) {
|
||||
|
@ -217,7 +217,7 @@ public class BisqGrpcServer {
|
||||
.addService(new GetPaymentAccountsImpl())
|
||||
.addService(new PlaceOfferImpl())
|
||||
.addService(new StopServerImpl())
|
||||
.intercept(new AuthenticationInterceptor(rpcUser, rpcPassword))
|
||||
.intercept(new TokenAuthInterceptor(rpcUser, rpcPassword))
|
||||
.build()
|
||||
.start();
|
||||
|
||||
|
@ -16,12 +16,12 @@ import static io.grpc.Status.UNAUTHENTICATED;
|
||||
* Simple authentication interceptor to validate a cleartext token in username:password format.
|
||||
*/
|
||||
@Slf4j
|
||||
public class AuthenticationInterceptor implements ServerInterceptor {
|
||||
public class TokenAuthInterceptor implements ServerInterceptor {
|
||||
|
||||
private final String rpcUser;
|
||||
private final String rpcPassword;
|
||||
|
||||
public AuthenticationInterceptor(String rpcUser, String rpcPassword) {
|
||||
public TokenAuthInterceptor(String rpcUser, String rpcPassword) {
|
||||
this.rpcUser = rpcUser;
|
||||
this.rpcPassword = rpcPassword;
|
||||
}
|
||||
@ -29,7 +29,7 @@ public class AuthenticationInterceptor implements ServerInterceptor {
|
||||
@Override
|
||||
public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> serverCall, Metadata metadata,
|
||||
ServerCallHandler<ReqT, RespT> serverCallHandler) {
|
||||
authenticate(metadata.get(Key.of("bisqd-creds", ASCII_STRING_MARSHALLER)));
|
||||
authenticate(metadata.get(Key.of("bisq-api-token", ASCII_STRING_MARSHALLER)));
|
||||
return serverCallHandler.startCall(serverCall, metadata);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user