Skip to content

Commit

Permalink
add token (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: wangminglang@kanzhun.com <wangminglang@kanzhun.com>
  • Loading branch information
1182640071 and wangminglang@kanzhun.com committed Aug 10, 2023
1 parent 017665b commit 75c2b2c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ private void registerOne(String serviceName) {
request.setNamespace(builder.getNamespace());
request.setService(serviceName);
request.setHost(host);
request.setToken(builder.getToken());
request.setVersion(builder.getVersion());
request.setProtocol("grpc");
request.setWeight(builder.getWeight());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public final class PolarisGrpcServerBuilder extends ServerBuilder<PolarisGrpcSer

private String host;

private String token;

private DelayRegister delayRegister;

private RegisterHook registerHook;
Expand Down Expand Up @@ -168,6 +170,17 @@ public PolarisGrpcServerBuilder host(String host) {
return this;
}

/**
* Set the token.
*
* @param token token
* @return PolarisGrpcServerBuilder
*/
public PolarisGrpcServerBuilder token(String token) {
this.token = token;
return this;
}

@Override
public PolarisGrpcServerBuilder directExecutor() {
return executor(MoreExecutors.directExecutor());
Expand Down Expand Up @@ -305,6 +318,10 @@ String getHost() {
return host;
}

String getToken() {
return token;
}

SDKContext getContext() {
return context;
}
Expand Down

0 comments on commit 75c2b2c

Please # to comment.