Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special message for OAuth token #4374

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/core/kqp/host/kqp_gateway_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,7 @@ class TKqpGatewayProxy : public IKikimrGateway {
params.SetDatabase(*database);
}
if (const auto& token = settings.Settings.OAuthToken) {
params.SetOAuthToken(*token);
params.MutableOAuthToken()->SetToken(*token);
}
if (const auto& creds = settings.Settings.StaticCredentials) {
params.MutableStaticCredentials()->SetUser(creds->UserName);
Expand Down
6 changes: 5 additions & 1 deletion ydb/core/protos/replication.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ message TStaticCredentials {
optional string Password = 2 [(Ydb.sensitive) = true];
}

message TOAuthToken {
optional string Token = 1 [(Ydb.sensitive) = true];
}

message TConnectionParams {
optional string Endpoint = 1;
optional string Database = 2;
// credentials
oneof Credentials {
TStaticCredentials StaticCredentials = 3;
string OAuthToken = 4 [(Ydb.sensitive) = true];
TOAuthToken OAuthToken = 4;
}
}

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/replication/controller/replication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class TReplication::TImpl {
ydbProxy.Reset(CreateYdbProxy(params.GetEndpoint(), params.GetDatabase(), params.GetStaticCredentials()));
break;
case NKikimrReplication::TConnectionParams::kOAuthToken:
ydbProxy.Reset(CreateYdbProxy(params.GetEndpoint(), params.GetDatabase(), params.GetOAuthToken()));
ydbProxy.Reset(CreateYdbProxy(params.GetEndpoint(), params.GetDatabase(), params.GetOAuthToken().GetToken()));
break;
default:
if (!(State == EState::Removing && !Targets)) {
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/replication/service/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct TCredentialsKey: std::tuple<TString, TString, TString> {
case NKikimrReplication::TConnectionParams::kStaticCredentials:
return TCredentialsKey(params.GetEndpoint(), params.GetDatabase(), params.GetStaticCredentials().GetUser());
case NKikimrReplication::TConnectionParams::kOAuthToken:
return TCredentialsKey(params.GetEndpoint(), params.GetDatabase(), params.GetOAuthToken() /* TODO */);
return TCredentialsKey(params.GetEndpoint(), params.GetDatabase(), params.GetOAuthToken().GetToken() /* TODO */);
default:
Y_ABORT("Unexpected credentials");
}
Expand Down Expand Up @@ -187,7 +187,7 @@ class TReplicationService: public TActorBootstrapped<TReplicationService> {
ydbProxy = GetOrCreateYdbProxy(TCredentialsKey::FromParams(params), params.GetStaticCredentials());
break;
case NKikimrReplication::TConnectionParams::kOAuthToken:
ydbProxy = GetOrCreateYdbProxy(TCredentialsKey::FromParams(params), params.GetOAuthToken());
ydbProxy = GetOrCreateYdbProxy(TCredentialsKey::FromParams(params), params.GetOAuthToken().GetToken());
break;
default:
Y_ABORT("Unexpected credentials");
Expand Down
Loading