Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: use proto options (#15402)

Danny Xuf7f4322f2c2d
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index 0b4c32557d..288c5fd897 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -142,13 +142,13 @@ func (s *InstanceService) CreateInstance(ctx context.Context, request *v1pb.Crea
if request.ValidateOnly {
for _, ds := range instanceMessage.DataSources {
err := func() error {
- driver, err := s.dbFactory.GetDataSourceDriver(ctx, instanceMessage, ds, "", false /* datashare */, ds.Type == api.RO, db.ConnectionContext{})
+ driver, err := s.dbFactory.GetDataSourceDriver(ctx, instanceMessage, ds, "", false /* datashare */, ds.Options.GetType() == storepb.DataSourceType_READ_ONLY, db.ConnectionContext{})
if err != nil {
return status.Errorf(codes.Internal, "failed to get database driver with error: %v", err.Error())
}
defer driver.Close(ctx)
if err := driver.Ping(ctx); err != nil {
- return status.Errorf(codes.InvalidArgument, "invalid datasource %s, error %s", ds.Type, err)
+ return status.Errorf(codes.InvalidArgument, "invalid datasource %s, error %s", ds.Options.GetType(), err)
}
return nil
}()
@@ -214,27 +214,27 @@ func (s *InstanceService) checkInstanceDataSources(instance *store.InstanceMessa
if err := s.checkDataSource(instance, ds); err != nil {
return err
}
- if dsIDMap[ds.ID] {
- return status.Errorf(codes.InvalidArgument, `duplicate data source id "%s"`, ds.ID)
+ if dsIDMap[ds.Options.GetId()] {
+ return status.Errorf(codes.InvalidArgument, `duplicate data source id "%s"`, ds.Options.GetId())
}
- dsIDMap[ds.ID] = true
+ dsIDMap[ds.Options.GetId()] = true
}
return nil
}
func (s *InstanceService) checkDataSource(instance *store.InstanceMessage, dataSource *store.DataSourceMessage) error {
- if dataSource.ID == "" {
+ if dataSource.Options.GetId() == "" {
return status.Errorf(codes.InvalidArgument, "data source id is required")
}
- password, err := common.Unobfuscate(dataSource.ObfuscatedPassword, s.secret)
+ password, err := common.Unobfuscate(dataSource.Options.GetObfuscatedPassword(), s.secret)
if err != nil {
return status.Error(codes.Internal, err.Error())
}
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureExternalSecretManager, instance); err != nil {
missingFeatureError := status.Error(codes.PermissionDenied, err.Error())
- if dataSource.ExternalSecret != nil {
+ if dataSource.Options.GetExternalSecret() != nil {
return missingFeatureError
}
if ok, _ := secret.GetExternalSecretURL(password); !ok {
@@ -648,7 +648,7 @@ func (s *InstanceService) AddDataSource(ctx context.Context, request *v1pb.AddDa
return nil, status.Errorf(codes.NotFound, "instance %q has been deleted", request.Name)
}
for _, ds := range instance.DataSources {
- if ds.ID == request.DataSource.Id {
+ if ds.Options.GetId() == request.DataSource.Id {
return nil, status.Errorf(codes.NotFound, "data source already exists with the same name")
}
}
@@ -659,13 +659,13 @@ func (s *InstanceService) AddDataSource(ctx context.Context, request *v1pb.AddDa
// Test connection.
if request.ValidateOnly {
err := func() error {
- driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, "", false /* datashare */, dataSource.Type == api.RO, db.ConnectionContext{})
+ driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, "", false /* datashare */, dataSource.Options.GetType() == storepb.DataSourceType_READ_ONLY, db.ConnectionContext{})
if err != nil {
return status.Errorf(codes.Internal, "failed to get database driver with error: %v", err.Error())
}
defer driver.Close(ctx)
if err := driver.Ping(ctx); err != nil {
- return status.Errorf(codes.InvalidArgument, "invalid datasource %s, error %s", dataSource.Type, err)
+ return status.Errorf(codes.InvalidArgument, "invalid datasource %s, error %s", dataSource.Options.GetType(), err)
}
return nil
}()
@@ -713,7 +713,7 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Up
var dataSource store.DataSourceMessage
found := false
for _, ds := range instance.DataSources {
- if ds.ID == request.DataSource.Id {
+ if ds.Options.GetId() == request.DataSource.Id {
dataSource = *ds
found = true
break
@@ -723,135 +723,103 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Up
return nil, status.Errorf(codes.NotFound, `cannot found data source "%s"`, request.DataSource.Id)
}
- if dataSource.Type == api.RO {
+ if dataSource.Options.GetType() == storepb.DataSourceType_READ_ONLY {
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureReadReplicaConnection, instance); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
}
+ options, ok := proto.Clone(dataSource.Options).(*storepb.DataSourceOptions)
+ if !ok {
+ return nil, status.Errorf(codes.Internal, "failed to convert options type")
+ }
patch := &store.UpdateDataSourceMessage{
- InstanceID: instance.ResourceID,
- DataSourceID: request.DataSource.Id,
+ InstanceID: instance.ResourceID,
+ ID: request.DataSource.Id,
+ Options: options,
}
+ hasSSH := false
for _, path := range request.UpdateMask.Paths {
switch path {
case "username":
- patch.Username = &request.DataSource.Username
- dataSource.Username = *patch.Username
+ patch.Options.Username = request.DataSource.Username
case "password":
- obfuscated := common.Obfuscate(request.DataSource.Password, s.secret)
- patch.ObfuscatedPassword = &obfuscated
- dataSource.ObfuscatedPassword = obfuscated
+ patch.Options.ObfuscatedPassword = common.Obfuscate(request.DataSource.Password, s.secret)
case "ssl_ca":
- obfuscated := common.Obfuscate(request.DataSource.SslCa, s.secret)
- patch.ObfuscatedSslCa = &obfuscated
- dataSource.ObfuscatedSslCa = obfuscated
+ patch.Options.ObfuscatedSslCa = common.Obfuscate(request.DataSource.SslCa, s.secret)
case "ssl_cert":
- obfuscated := common.Obfuscate(request.DataSource.SslCert, s.secret)
- patch.ObfuscatedSslCert = &obfuscated
- dataSource.ObfuscatedSslCert = obfuscated
+ patch.Options.ObfuscatedSslCert = common.Obfuscate(request.DataSource.SslCert, s.secret)
case "ssl_key":
- obfuscated := common.Obfuscate(request.DataSource.SslKey, s.secret)
- patch.ObfuscatedSslKey = &obfuscated
- dataSource.ObfuscatedSslKey = obfuscated
+ patch.Options.ObfuscatedSslKey = common.Obfuscate(request.DataSource.SslKey, s.secret)
case "host":
- patch.Host = &request.DataSource.Host
- dataSource.Host = request.DataSource.Host
+ patch.Options.Host = request.DataSource.Host
case "port":
- patch.Port = &request.DataSource.Port
- dataSource.Port = request.DataSource.Port
+ patch.Options.Port = request.DataSource.Port
case "database":
- patch.Database = &request.DataSource.Database
- dataSource.Database = request.DataSource.Database
+ patch.Options.Database = request.DataSource.Database
case "srv":
- patch.SRV = &request.DataSource.Srv
- dataSource.SRV = request.DataSource.Srv
+ patch.Options.Srv = request.DataSource.Srv
case "authentication_database":
- patch.AuthenticationDatabase = &request.DataSource.AuthenticationDatabase
- dataSource.AuthenticationDatabase = request.DataSource.AuthenticationDatabase
+ patch.Options.AuthenticationDatabase = request.DataSource.AuthenticationDatabase
case "sid":
- patch.SID = &request.DataSource.Sid
- dataSource.SID = request.DataSource.Sid
+ patch.Options.Sid = request.DataSource.Sid
case "service_name":
- patch.ServiceName = &request.DataSource.ServiceName
- dataSource.ServiceName = request.DataSource.ServiceName
+ patch.Options.ServiceName = request.DataSource.ServiceName
case "ssh_host":
- patch.SSHHost = &request.DataSource.SshHost
- dataSource.SSHHost = request.DataSource.SshHost
+ patch.Options.SshHost = request.DataSource.SshHost
+ hasSSH = true
case "ssh_port":
- patch.SSHPort = &request.DataSource.SshPort
- dataSource.SSHPort = request.DataSource.SshPort
+ patch.Options.SshPort = request.DataSource.SshPort
+ hasSSH = true
case "ssh_user":
- patch.SSHUser = &request.DataSource.SshUser
- dataSource.SSHUser = request.DataSource.SshUser
+ patch.Options.SshUser = request.DataSource.SshUser
+ hasSSH = true
case "ssh_password":
- obfuscated := common.Obfuscate(request.DataSource.SshPassword, s.secret)
- patch.SSHObfuscatedPassword = &obfuscated
- dataSource.SSHObfuscatedPassword = obfuscated
+ patch.Options.SshObfuscatedPassword = common.Obfuscate(request.DataSource.SshPassword, s.secret)
+ hasSSH = true
case "ssh_private_key":
- obfuscated := common.Obfuscate(request.DataSource.SshPrivateKey, s.secret)
- patch.SSHObfuscatedPrivateKey = &obfuscated
- dataSource.SSHObfuscatedPrivateKey = obfuscated
+ patch.Options.SshObfuscatedPrivateKey = common.Obfuscate(request.DataSource.SshPrivateKey, s.secret)
+ hasSSH = true
case "authentication_private_key":
- obfuscated := common.Obfuscate(request.DataSource.AuthenticationPrivateKey, s.secret)
- patch.AuthenticationPrivateKeyObfuscated = &obfuscated
- dataSource.AuthenticationPrivateKeyObfuscated = obfuscated
+ patch.Options.AuthenticationPrivateKeyObfuscated = common.Obfuscate(request.DataSource.AuthenticationPrivateKey, s.secret)
case "external_secret":
externalSecret, err := convertToStoreDataSourceExternalSecret(request.DataSource.ExternalSecret)
if err != nil {
return nil, err
}
- dataSource.ExternalSecret = externalSecret
- patch.ExternalSecret = externalSecret
- patch.RemoveExternalSecret = externalSecret == nil
+ dataSource.Options.ExternalSecret = externalSecret
case "sasl_config":
- dataSource.SASLConfig = convertToStoreDataSourceSaslConfig(request.DataSource.SaslConfig)
- patch.SASLConfig = dataSource.SASLConfig
- patch.RemoveSASLConfig = dataSource.SASLConfig == nil
+ patch.Options.SaslConfig = convertToStoreDataSourceSaslConfig(request.DataSource.SaslConfig)
case "authentication_type":
- authType := convertToAuthenticationType(request.DataSource.AuthenticationType)
- dataSource.AuthenticationType = authType
- patch.AuthenticationType = &authType
+ dataSource.Options.AuthenticationType = convertToAuthenticationType(request.DataSource.AuthenticationType)
case "additional_addresses":
- additionalAddresses := convertToStoreAdditionalAddresses(request.DataSource.AdditionalAddresses)
- dataSource.AdditionalAddresses = additionalAddresses
- patch.AdditionalAddress = &additionalAddresses
+ dataSource.Options.AdditionalAddresses = convertToStoreAdditionalAddresses(request.DataSource.AdditionalAddresses)
case "replica_set":
- dataSource.ReplicaSet = request.DataSource.ReplicaSet
- patch.ReplicaSet = &request.DataSource.ReplicaSet
+ dataSource.Options.ReplicaSet = request.DataSource.ReplicaSet
case "direct_connection":
- dataSource.DirectConnection = request.DataSource.DirectConnection
- patch.DirectConnection = &request.DataSource.DirectConnection
+ dataSource.Options.DirectConnection = request.DataSource.DirectConnection
case "region":
- dataSource.Region = request.DataSource.Region
- patch.Region = &request.DataSource.Region
+ dataSource.Options.Region = request.DataSource.Region
case "warehouse_id":
- dataSource.WarehouseID = request.DataSource.WarehouseId
- patch.WarehouseID = &request.DataSource.WarehouseId
+ dataSource.Options.WarehouseId = request.DataSource.WarehouseId
case "use_ssl":
- dataSource.UseSSL = request.DataSource.UseSsl
- patch.UseSSL = &request.DataSource.UseSsl
+ dataSource.Options.UseSsl = request.DataSource.UseSsl
case "redis_type":
- redisType := convertToStoreRedisType(request.DataSource.RedisType)
- dataSource.RedisType = redisType
- patch.RedisType = &redisType
+ dataSource.Options.RedisType = convertToStoreRedisType(request.DataSource.RedisType)
case "master_name":
- dataSource.MasterName = request.DataSource.MasterName
- patch.MasterName = &request.DataSource.MasterName
+ dataSource.Options.MasterName = request.DataSource.MasterName
case "master_username":
- dataSource.MasterUsername = request.DataSource.MasterUsername
- patch.MasterUsername = &request.DataSource.MasterUsername
+ dataSource.Options.MasterUsername = request.DataSource.MasterUsername
case "master_password":
- obfuscated := common.Obfuscate(request.DataSource.MasterPassword, s.secret)
- dataSource.MasterObfuscatedPassword = obfuscated
- patch.MasterObfuscatedPassword = &obfuscated
+ dataSource.Options.MasterObfuscatedPassword = common.Obfuscate(request.DataSource.MasterPassword, s.secret)
case "iam_extension":
if v := request.DataSource.IamExtension; v != nil {
switch v := v.(type) {
case *v1pb.DataSource_ClientSecretCredential_:
- dataSource.ClientSecretCredential = convertToStoreClientSecretCredential(v.ClientSecretCredential)
- patch.ClientSecretCredential = dataSource.ClientSecretCredential
+ patch.Options.IamExtension = &storepb.DataSourceOptions_ClientSecretCredential_{
+ ClientSecretCredential: convertToStoreClientSecretCredential(v.ClientSecretCredential),
+ }
default:
}
}
@@ -864,7 +832,7 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Up
return nil, err
}
- if patch.SSHHost != nil || patch.SSHPort != nil || patch.SSHUser != nil || patch.SSHObfuscatedPassword != nil || patch.SSHObfuscatedPrivateKey != nil {
+ if hasSSH {
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureInstanceSSHConnection, instance); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
@@ -873,13 +841,13 @@ func (s *InstanceService) UpdateDataSource(ctx context.Context, request *v1pb.Up
// Test connection.
if request.ValidateOnly {
err := func() error {
- driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, &dataSource, "", false /* datashare */, dataSource.Type == api.RO, db.ConnectionContext{})
+ driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, &dataSource, "", false /* datashare */, dataSource.Options.GetType() == storepb.DataSourceType_READ_ONLY, db.ConnectionContext{})
if err != nil {
return status.Errorf(codes.Internal, "failed to get database driver with error: %v", err.Error())
}
defer driver.Close(ctx)
if err := driver.Ping(ctx); err != nil {
- return status.Errorf(codes.InvalidArgument, "invalid datasource %s, error %s", dataSource.Type, err)
+ return status.Errorf(codes.InvalidArgument, "invalid datasource %s, error %s", dataSource.Options.GetType(), err)
}
return nil
}()
@@ -921,7 +889,7 @@ func (s *InstanceService) RemoveDataSource(ctx context.Context, request *v1pb.Re
var dataSource store.DataSourceMessage
found := false
for _, ds := range instance.DataSources {
- if ds.ID == request.DataSource.Id {
+ if ds.Options.GetId() == request.DataSource.Id {
dataSource = *ds
found = true
break
@@ -932,11 +900,11 @@ func (s *InstanceService) RemoveDataSource(ctx context.Context, request *v1pb.Re
}
// We only support remove RO type datasource to instance now, see more details in instance_service.proto.
- if dataSource.Type != api.RO {
+ if dataSource.Options.GetType() != storepb.DataSourceType_READ_ONLY {
return nil, status.Errorf(codes.InvalidArgument, "only support remove read-only data source")
}
- if err := s.store.RemoveDataSourceV2(ctx, instance.ResourceID, dataSource.ID); err != nil {
+ if err := s.store.RemoveDataSourceV2(ctx, instance.ResourceID, dataSource.Options.GetId()); err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
@@ -1161,21 +1129,21 @@ func convertToV1DataSourceExternalSecret(externalSecret *storepb.DataSourceExter
func convertToV1DataSources(dataSources []*store.DataSourceMessage) ([]*v1pb.DataSource, error) {
dataSourceList := []*v1pb.DataSource{}
for _, ds := range dataSources {
- externalSecret, err := convertToV1DataSourceExternalSecret(ds.ExternalSecret)
+ externalSecret, err := convertToV1DataSourceExternalSecret(ds.Options.GetExternalSecret())
if err != nil {
return nil, err
}
dataSourceType := v1pb.DataSourceType_DATA_SOURCE_UNSPECIFIED
- switch ds.Type {
- case api.Admin:
+ switch ds.Options.GetType() {
+ case storepb.DataSourceType_ADMIN:
dataSourceType = v1pb.DataSourceType_ADMIN
- case api.RO:
+ case storepb.DataSourceType_READ_ONLY:
dataSourceType = v1pb.DataSourceType_READ_ONLY
}
authenticationType := v1pb.DataSource_AUTHENTICATION_UNSPECIFIED
- switch ds.AuthenticationType {
+ switch ds.Options.GetAuthenticationType() {
case storepb.DataSourceOptions_AUTHENTICATION_UNSPECIFIED, storepb.DataSourceOptions_PASSWORD:
authenticationType = v1pb.DataSource_PASSWORD
case storepb.DataSourceOptions_GOOGLE_CLOUD_SQL_IAM:
@@ -1187,31 +1155,31 @@ func convertToV1DataSources(dataSources []*store.DataSourceMessage) ([]*v1pb.Dat
}
dataSource := &v1pb.DataSource{
- Id: ds.ID,
+ Id: ds.Options.GetId(),
Type: dataSourceType,
- Username: ds.Username,
+ Username: ds.Options.GetUsername(),
// We don't return the password and SSLs on reads.
- Host: ds.Host,
- Port: ds.Port,
- Database: ds.Database,
- Srv: ds.SRV,
- AuthenticationDatabase: ds.AuthenticationDatabase,
- Sid: ds.SID,
- ServiceName: ds.ServiceName,
+ Host: ds.Options.GetHost(),
+ Port: ds.Options.GetPort(),
+ Database: ds.Options.GetDatabase(),
+ Srv: ds.Options.GetSrv(),
+ AuthenticationDatabase: ds.Options.GetAuthenticationDatabase(),
+ Sid: ds.Options.GetSid(),
+ ServiceName: ds.Options.GetServiceName(),
ExternalSecret: externalSecret,
AuthenticationType: authenticationType,
- SaslConfig: convertToV1DataSourceSaslConfig(ds.SASLConfig),
- AdditionalAddresses: convertToV1DataSourceAddresses(ds.AdditionalAddresses),
- ReplicaSet: ds.ReplicaSet,
- DirectConnection: ds.DirectConnection,
- Region: ds.Region,
- WarehouseId: ds.WarehouseID,
- UseSsl: ds.UseSSL,
- RedisType: convertToV1RedisType(ds.RedisType),
- MasterName: ds.MasterName,
- MasterUsername: ds.MasterUsername,
+ SaslConfig: convertToV1DataSourceSaslConfig(ds.Options.GetSaslConfig()),
+ AdditionalAddresses: convertToV1DataSourceAddresses(ds.Options.GetAdditionalAddresses()),
+ ReplicaSet: ds.Options.GetReplicaSet(),
+ DirectConnection: ds.Options.GetDirectConnection(),
+ Region: ds.Options.GetRegion(),
+ WarehouseId: ds.Options.GetWarehouseId(),
+ UseSsl: ds.Options.GetUseSsl(),
+ RedisType: convertToV1RedisType(ds.Options.GetRedisType()),
+ MasterName: ds.Options.GetMasterName(),
+ MasterUsername: ds.Options.GetMasterUsername(),
}
- if clientSecretCredential := convertToV1ClientSecretCredential(ds.ClientSecretCredential); clientSecretCredential != nil {
+ if clientSecretCredential := convertToV1ClientSecretCredential(ds.Options.GetClientSecretCredential()); clientSecretCredential != nil {
dataSource.IamExtension = &v1pb.DataSource_ClientSecretCredential_{
ClientSecretCredential: clientSecretCredential,
}
@@ -1401,40 +1369,42 @@ func (s *InstanceService) convertToDataSourceMessage(dataSource *v1pb.DataSource
clientSecretCredential := convertToStoreClientSecretCredential(dataSource.GetClientSecretCredential())
return &store.DataSourceMessage{
- ID: dataSource.Id,
- Type: dsType,
- Username: dataSource.Username,
- ObfuscatedPassword: common.Obfuscate(dataSource.Password, s.secret),
- ObfuscatedSslCa: common.Obfuscate(dataSource.SslCa, s.secret),
- ObfuscatedSslCert: common.Obfuscate(dataSource.SslCert, s.secret),
- ObfuscatedSslKey: common.Obfuscate(dataSource.SslKey, s.secret),
- Host: dataSource.Host,
- Port: dataSource.Port,
- Database: dataSource.Database,
- SRV: dataSource.Srv,
- AuthenticationDatabase: dataSource.AuthenticationDatabase,
- SID: dataSource.Sid,
- ServiceName: dataSource.ServiceName,
- SSHHost: dataSource.SshHost,
- SSHPort: dataSource.SshPort,
- SSHUser: dataSource.SshUser,
- SSHObfuscatedPassword: common.Obfuscate(dataSource.SshPassword, s.secret),
- SSHObfuscatedPrivateKey: common.Obfuscate(dataSource.SshPrivateKey, s.secret),
- AuthenticationPrivateKeyObfuscated: common.Obfuscate(dataSource.AuthenticationPrivateKey, s.secret),
- ExternalSecret: externalSecret,
- SASLConfig: saslConfig,
- AuthenticationType: convertToAuthenticationType(dataSource.AuthenticationType),
- AdditionalAddresses: convertToStoreAdditionalAddresses(dataSource.AdditionalAddresses),
- ReplicaSet: dataSource.ReplicaSet,
- DirectConnection: dataSource.DirectConnection,
- Region: dataSource.Region,
- WarehouseID: dataSource.WarehouseId,
- UseSSL: dataSource.UseSsl,
- RedisType: convertToStoreRedisType(dataSource.RedisType),
- MasterName: dataSource.MasterName,
- MasterUsername: dataSource.MasterUsername,
- MasterObfuscatedPassword: common.Obfuscate(dataSource.MasterPassword, s.secret),
- ClientSecretCredential: clientSecretCredential,
+ Options: &storepb.DataSourceOptions{
+ Id: dataSource.Id,
+ Type: dsType,
+ Username: dataSource.Username,
+ ObfuscatedPassword: common.Obfuscate(dataSource.Password, s.secret),
+ ObfuscatedSslCa: common.Obfuscate(dataSource.SslCa, s.secret),
+ ObfuscatedSslCert: common.Obfuscate(dataSource.SslCert, s.secret),
+ ObfuscatedSslKey: common.Obfuscate(dataSource.SslKey, s.secret),
+ Host: dataSource.Host,
+ Port: dataSource.Port,
+ Database: dataSource.Database,
+ Srv: dataSource.Srv,
+ AuthenticationDatabase: dataSource.AuthenticationDatabase,
+ Sid: dataSource.Sid,
+ ServiceName: dataSource.ServiceName,
+ SshHost: dataSource.SshHost,
+ SshPort: dataSource.SshPort,
+ SshUser: dataSource.SshUser,
+ SshObfuscatedPassword: common.Obfuscate(dataSource.SshPassword, s.secret),
+ SshObfuscatedPrivateKey: common.Obfuscate(dataSource.SshPrivateKey, s.secret),
+ AuthenticationPrivateKeyObfuscated: common.Obfuscate(dataSource.AuthenticationPrivateKey, s.secret),
+ ExternalSecret: externalSecret,
+ SaslConfig: saslConfig,
+ AuthenticationType: convertToAuthenticationType(dataSource.AuthenticationType),
+ AdditionalAddresses: convertToStoreAdditionalAddresses(dataSource.AdditionalAddresses),
+ ReplicaSet: dataSource.ReplicaSet,
+ DirectConnection: dataSource.DirectConnection,
+ Region: dataSource.Region,
+ WarehouseId: dataSource.WarehouseId,
+ UseSsl: dataSource.UseSsl,
+ RedisType: convertToStoreRedisType(dataSource.RedisType),
+ MasterName: dataSource.MasterName,
+ MasterUsername: dataSource.MasterUsername,
+ MasterObfuscatedPassword: common.Obfuscate(dataSource.MasterPassword, s.secret),
+ IamExtension: &storepb.DataSourceOptions_ClientSecretCredential_{ClientSecretCredential: clientSecretCredential},
+ },
}, nil
}
@@ -1463,15 +1433,13 @@ func (s *InstanceService) instanceCountGuard(ctx context.Context) error {
return nil
}
-func convertDataSourceTp(tp v1pb.DataSourceType) (api.DataSourceType, error) {
- var dsType api.DataSourceType
+func convertDataSourceTp(tp v1pb.DataSourceType) (storepb.DataSourceType, error) {
switch tp {
case v1pb.DataSourceType_READ_ONLY:
- dsType = api.RO
+ return storepb.DataSourceType_READ_ONLY, nil
case v1pb.DataSourceType_ADMIN:
- dsType = api.Admin
+ return storepb.DataSourceType_ADMIN, nil
default:
- return "", errors.Errorf("invalid data source type %v", tp)
+ return storepb.DataSourceType_DATA_SOURCE_UNSPECIFIED, errors.Errorf("invalid data source type %v", tp)
}
- return dsType, nil
}
diff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.go
index 94cb8a1b5c..590e6b3e8f 100644
--- a/backend/api/v1/rollout_service_task.go
+++ b/backend/api/v1/rollout_service_task.go
@@ -189,7 +189,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
}
// Get admin data source username.
- adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
if adminDataSource == nil {
return nil, common.Errorf(common.Internal, "admin data source not found for instance %q", instance.Title)
}
@@ -220,7 +220,7 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
}
}
- statement, err := getCreateDatabaseStatement(instance.Engine, c, databaseName, adminDataSource.Username)
+ statement, err := getCreateDatabaseStatement(instance.Engine, c, databaseName, adminDataSource.Options.GetUsername())
if err != nil {
return nil, err
}
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index db55140d5e..23a481ebc7 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -193,7 +193,7 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
if err != nil {
return nil, err
}
- driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.Metadata.GetDatashare(), dataSource.Type == api.RO /* readOnly */, db.ConnectionContext{})
+ driver, err := s.dbFactory.GetDataSourceDriver(ctx, instance, dataSource, database.DatabaseName, database.Metadata.GetDatashare(), dataSource.Options.GetType() == storepb.DataSourceType_READ_ONLY, db.ConnectionContext{})
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get database driver: %v", err)
}
@@ -1087,7 +1087,7 @@ func BuildGetLinkedDatabaseMetadataFunc(storeInstance *store.Store, engine store
}
if instanceMeta != nil {
for _, dataSource := range instanceMeta.DataSources {
- if strings.Contains(linkedMeta.GetHost(), dataSource.Host) {
+ if strings.Contains(linkedMeta.GetHost(), dataSource.Options.GetHost()) {
linkedDatabase = database
break
}
@@ -1874,12 +1874,12 @@ func checkAndGetDataSourceQueriable(ctx context.Context, storeInstance *store.St
return nil, status.Newf(codes.Internal, "failed to list data sources: %v", err)
}
for _, ds := range dataSources {
- if ds.Type == api.RO {
+ if ds.Options.GetType() == storepb.DataSourceType_READ_ONLY {
return ds, nil
}
}
for _, ds := range dataSources {
- if ds.Type == api.Admin {
+ if ds.Options.GetType() == storepb.DataSourceType_ADMIN {
return ds, nil
}
}
@@ -1888,7 +1888,7 @@ func checkAndGetDataSourceQueriable(ctx context.Context, storeInstance *store.St
dataSource, err := storeInstance.GetDataSource(ctx, &store.FindDataSourceMessage{
InstanceID: &database.InstanceID,
- Name: &dataSourceID,
+ ID: &dataSourceID,
})
if err != nil {
return nil, status.Newf(codes.Internal, "failed to get data source: %v", err)
@@ -1903,7 +1903,7 @@ func checkAndGetDataSourceQueriable(ctx context.Context, storeInstance *store.St
}
// Always allow non-admin data source.
- if dataSource.Type != api.Admin {
+ if dataSource.Options.GetType() != storepb.DataSourceType_ADMIN {
return dataSource, nil
}
@@ -1956,17 +1956,17 @@ func checkAndGetDataSourceQueriable(ctx context.Context, storeInstance *store.St
if envAdminDataSourceRestriction == v1pb.DataSourceQueryPolicy_DISALLOW || projectAdminDataSourceRestriction == v1pb.DataSourceQueryPolicy_DISALLOW {
return nil, status.Errorf(codes.PermissionDenied, "data source %q is not queryable", dataSourceID)
} else if envAdminDataSourceRestriction == v1pb.DataSourceQueryPolicy_FALLBACK || projectAdminDataSourceRestriction == v1pb.DataSourceQueryPolicy_FALLBACK {
- readOnlyDataSourceType := api.RO
- readOnlyDataSources, err := storeInstance.ListDataSourcesV2(ctx, &store.FindDataSourceMessage{
+ dataSources, err := storeInstance.ListDataSourcesV2(ctx, &store.FindDataSourceMessage{
InstanceID: &database.InstanceID,
- Type: &readOnlyDataSourceType,
})
if err != nil {
return nil, errors.Wrapf(err, "failed to list read-only data sources")
}
// If there is any read-only data source, then return false.
- if len(readOnlyDataSources) > 0 {
- return nil, status.Errorf(codes.PermissionDenied, "data source %q is not queryable", dataSourceID)
+ for _, ds := range dataSources {
+ if ds.Options.Type == storepb.DataSourceType_READ_ONLY {
+ return nil, status.Errorf(codes.PermissionDenied, "data source %q is not queryable", dataSourceID)
+ }
}
}
diff --git a/backend/api/v1/sql_service_export_utils.go b/backend/api/v1/sql_service_export_utils.go
index eadaacb388..0d21a402ec 100644
--- a/backend/api/v1/sql_service_export_utils.go
+++ b/backend/api/v1/sql_service_export_utils.go
@@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/structpb"
- api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/parser/base"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/store/model"
@@ -458,8 +457,8 @@ func extractResourceList(ctx context.Context, storeInstance *store.Store, engine
return result, nil
case storepb.Engine_SNOWFLAKE:
- dataSource := utils.DataSourceFromInstanceWithType(instance, api.RO)
- adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ dataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_READ_ONLY)
+ adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
// If there are no read-only data source, fall back to admin data source.
if dataSource == nil {
dataSource = adminDataSource
@@ -526,8 +525,8 @@ func extractResourceList(ctx context.Context, storeInstance *store.Store, engine
}
return result, nil
case storepb.Engine_MSSQL:
- dataSource := utils.DataSourceFromInstanceWithType(instance, api.RO)
- adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ dataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_READ_ONLY)
+ adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
// If there are no read-only data source, fall back to admin data source.
if dataSource == nil {
dataSource = adminDataSource
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index fa663c7b4d..ca973f91c9 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -6,7 +6,6 @@ import (
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/component/secret"
- api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/db"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/utils"
@@ -38,7 +37,7 @@ func New(store *store.Store, mysqlBinDir, mongoBinDir, pgBinDir, dataDir, secret
// GetAdminDatabaseDriver gets the admin database driver using the instance's admin data source.
// Upon successful return, caller must call driver.Close(). Otherwise, it will leak the database connection.
func (d *DBFactory) GetAdminDatabaseDriver(ctx context.Context, instance *store.InstanceMessage, database *store.DatabaseMessage, connectionContext db.ConnectionContext) (db.Driver, error) {
- dataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ dataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
if dataSource == nil {
return nil, common.Errorf(common.Internal, "admin data source not found for instance %q", instance.Title)
}
@@ -67,55 +66,55 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.Ins
}
if databaseName == "" {
- databaseName = dataSource.Database
+ databaseName = dataSource.Options.GetDatabase()
}
- password, err := common.Unobfuscate(dataSource.ObfuscatedPassword, d.secret)
+ password, err := common.Unobfuscate(dataSource.Options.GetObfuscatedPassword(), d.secret)
if err != nil {
return nil, err
}
- sslCA, err := common.Unobfuscate(dataSource.ObfuscatedSslCa, d.secret)
+ sslCA, err := common.Unobfuscate(dataSource.Options.GetObfuscatedSslCa(), d.secret)
if err != nil {
return nil, err
}
- sslCert, err := common.Unobfuscate(dataSource.ObfuscatedSslCert, d.secret)
+ sslCert, err := common.Unobfuscate(dataSource.Options.GetObfuscatedSslCert(), d.secret)
if err != nil {
return nil, err
}
- sslKey, err := common.Unobfuscate(dataSource.ObfuscatedSslKey, d.secret)
+ sslKey, err := common.Unobfuscate(dataSource.Options.GetObfuscatedSslKey(), d.secret)
if err != nil {
return nil, err
}
- sshPassword, err := common.Unobfuscate(dataSource.SSHObfuscatedPassword, d.secret)
+ sshPassword, err := common.Unobfuscate(dataSource.Options.GetSshObfuscatedPassword(), d.secret)
if err != nil {
return nil, err
}
- sshPrivateKey, err := common.Unobfuscate(dataSource.SSHObfuscatedPrivateKey, d.secret)
+ sshPrivateKey, err := common.Unobfuscate(dataSource.Options.GetSshObfuscatedPrivateKey(), d.secret)
if err != nil {
return nil, err
}
- authenticationPrivateKey, err := common.Unobfuscate(dataSource.AuthenticationPrivateKeyObfuscated, d.secret)
+ authenticationPrivateKey, err := common.Unobfuscate(dataSource.Options.GetAuthenticationPrivateKeyObfuscated(), d.secret)
if err != nil {
return nil, err
}
- masterPassword, err := common.Unobfuscate(dataSource.MasterObfuscatedPassword, d.secret)
+ masterPassword, err := common.Unobfuscate(dataSource.Options.GetMasterObfuscatedPassword(), d.secret)
if err != nil {
return nil, err
}
- updatedPassword, err := secret.ReplaceExternalSecret(ctx, password, dataSource.ExternalSecret)
+ updatedPassword, err := secret.ReplaceExternalSecret(ctx, password, dataSource.Options.GetExternalSecret())
if err != nil {
return nil, err
}
password = updatedPassword
sshConfig := db.SSHConfig{
- Host: dataSource.SSHHost,
- Port: dataSource.SSHPort,
- User: dataSource.SSHUser,
+ Host: dataSource.Options.GetSshHost(),
+ Port: dataSource.Options.GetSshPort(),
+ User: dataSource.Options.GetSshUser(),
Password: sshPassword,
PrivateKey: sshPrivateKey,
}
var dbSaslConfig db.SASLConfig
- switch t := dataSource.SASLConfig.GetMechanism().(type) {
+ switch t := dataSource.Options.GetSaslConfig().GetMechanism().(type) {
case *storepb.SASLConfig_KrbConfig:
dbSaslConfig = &db.KerberosConfig{
Primary: t.KrbConfig.Primary,
@@ -142,40 +141,40 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.Ins
DbBinDir: dbBinDir,
},
db.ConnectionConfig{
- Username: dataSource.Username,
+ Username: dataSource.Options.GetUsername(),
Password: password,
TLSConfig: db.TLSConfig{
- UseSSL: dataSource.UseSSL,
+ UseSSL: dataSource.Options.GetUseSsl(),
SslCA: sslCA,
SslCert: sslCert,
SslKey: sslKey,
},
- Host: dataSource.Host,
- Port: dataSource.Port,
+ Host: dataSource.Options.GetHost(),
+ Port: dataSource.Options.GetPort(),
Database: databaseName,
DataShare: datashare,
- SRV: dataSource.SRV,
- AuthenticationDatabase: dataSource.AuthenticationDatabase,
- SID: dataSource.SID,
- ServiceName: dataSource.ServiceName,
+ SRV: dataSource.Options.GetSrv(),
+ AuthenticationDatabase: dataSource.Options.GetAuthenticationDatabase(),
+ SID: dataSource.Options.GetSid(),
+ ServiceName: dataSource.Options.ServiceName,
SSHConfig: sshConfig,
ReadOnly: readOnly,
ConnectionContext: connectionContext,
AuthenticationPrivateKey: authenticationPrivateKey,
- AuthenticationType: dataSource.AuthenticationType,
+ AuthenticationType: dataSource.Options.GetAuthenticationType(),
SASLConfig: dbSaslConfig,
- AdditionalAddresses: dataSource.AdditionalAddresses,
- ReplicaSet: dataSource.ReplicaSet,
- DirectConnection: dataSource.DirectConnection,
- Region: dataSource.Region,
- WarehouseID: dataSource.WarehouseID,
- RedisType: dataSource.RedisType,
- MasterName: dataSource.MasterName,
- MasterUsername: dataSource.MasterUsername,
+ AdditionalAddresses: dataSource.Options.GetAdditionalAddresses(),
+ ReplicaSet: dataSource.Options.GetReplicaSet(),
+ DirectConnection: dataSource.Options.GetDirectConnection(),
+ Region: dataSource.Options.GetRegion(),
+ WarehouseID: dataSource.Options.GetWarehouseId(),
+ RedisType: dataSource.Options.GetRedisType(),
+ MasterName: dataSource.Options.GetMasterName(),
+ MasterUsername: dataSource.Options.GetMasterUsername(),
MasterPassword: masterPassword,
- ExtraConnectionParameters: dataSource.ExtraConnectionParameters,
+ ExtraConnectionParameters: dataSource.Options.GetExtraConnectionParameters(),
MaximumSQLResultSize: maximumSQLResultSize,
- ClientSecretCredential: dataSource.ClientSecretCredential,
+ ClientSecretCredential: dataSource.Options.GetClientSecretCredential(),
},
)
if err != nil {
diff --git a/backend/component/ghost/config.go b/backend/component/ghost/config.go
index 464215579c..c8900423a1 100644
--- a/backend/component/ghost/config.go
+++ b/backend/component/ghost/config.go
@@ -193,11 +193,11 @@ func GetUserFlags(flags map[string]string) (*UserFlags, error) {
// NewMigrationContext is the context for gh-ost migration.
func NewMigrationContext(ctx context.Context, taskID int, database *store.DatabaseMessage, dataSource *store.DataSourceMessage, secret string, tableName string, tmpTableNameSuffix string, statement string, noop bool, flags map[string]string, serverIDOffset uint) (*base.MigrationContext, error) {
- password, err := common.Unobfuscate(dataSource.ObfuscatedPassword, secret)
+ password, err := common.Unobfuscate(dataSource.Options.GetObfuscatedPassword(), secret)
if err != nil {
return nil, errors.Wrapf(err, "failed to get password")
}
- updatedPassword, err := secretcomp.ReplaceExternalSecret(ctx, password, dataSource.ExternalSecret)
+ updatedPassword, err := secretcomp.ReplaceExternalSecret(ctx, password, dataSource.Options.GetExternalSecret())
if err != nil {
return nil, err
}
@@ -205,27 +205,27 @@ func NewMigrationContext(ctx context.Context, taskID int, database *store.Databa
migrationContext := base.NewMigrationContext()
migrationContext.Log = newGhostLogger()
- migrationContext.InspectorConnectionConfig.Key.Hostname = dataSource.Host
+ migrationContext.InspectorConnectionConfig.Key.Hostname = dataSource.Options.GetHost()
port := 3306
- if dataSource.Port != "" {
- dsPort, err := strconv.Atoi(dataSource.Port)
+ if dataSource.Options.GetPort() != "" {
+ dsPort, err := strconv.Atoi(dataSource.Options.GetPort())
if err != nil {
return nil, errors.Wrap(err, "failed to convert port from string to int")
}
port = dsPort
}
- if dataSource.UseSSL {
- ca, err := common.Unobfuscate(dataSource.ObfuscatedSslCa, secret)
+ if dataSource.Options.GetUseSsl() {
+ ca, err := common.Unobfuscate(dataSource.Options.GetObfuscatedSslCa(), secret)
if err != nil {
return nil, errors.Wrapf(err, "failed to get ssl ca")
}
- cert, err := common.Unobfuscate(dataSource.ObfuscatedSslCert, secret)
+ cert, err := common.Unobfuscate(dataSource.Options.GetObfuscatedSslCert(), secret)
if err != nil {
return nil, errors.Wrapf(err, "failed to get ssl cert")
}
- key, err := common.Unobfuscate(dataSource.ObfuscatedSslKey, secret)
+ key, err := common.Unobfuscate(dataSource.Options.GetObfuscatedSslKey(), secret)
if err != nil {
return nil, errors.Wrapf(err, "failed to get ssl key")
}
@@ -240,7 +240,7 @@ func NewMigrationContext(ctx context.Context, taskID int, database *store.Databa
}
}
migrationContext.InspectorConnectionConfig.Key.Port = port
- migrationContext.CliUser = dataSource.Username
+ migrationContext.CliUser = dataSource.Options.GetUsername()
migrationContext.CliPassword = password
// GhostDatabaseName is our homemade parameter to allow creating temporary tables under another database.
migrationContext.GhostDatabaseName = "bbdataarchive"
diff --git a/backend/legacyapi/data_source.go b/backend/legacyapi/data_source.go
deleted file mode 100644
index e620a5baf8..0000000000
--- a/backend/legacyapi/data_source.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package api
-
-// DataSourceType is the type of data source.
-type DataSourceType string
-
-const (
- // Admin is the ADMIN type of data source.
- Admin DataSourceType = "ADMIN"
- // RO is the read-only type of data source.
- RO DataSourceType = "RO"
-)
diff --git a/backend/migrator/migration/3.5/0006##data_source.sql b/backend/migrator/migration/3.5/0006##data_source.sql
new file mode 100644
index 0000000000..ec15ebb9b4
--- /dev/null
+++ b/backend/migrator/migration/3.5/0006##data_source.sql
@@ -0,0 +1,22 @@
+UPDATE data_source SET options = options || jsonb_build_object('host', host);
+UPDATE data_source SET options = options || jsonb_build_object('port', port);
+UPDATE data_source SET options = options || jsonb_build_object('username', username);
+UPDATE data_source SET options = options || jsonb_build_object('obfuscatedPassword', password);
+UPDATE data_source SET options = options || jsonb_build_object('database', database);
+UPDATE data_source SET options = options || jsonb_build_object('obfuscatedSslKey', ssl_key);
+UPDATE data_source SET options = options || jsonb_build_object('obfuscatedSslCert', ssl_cert);
+UPDATE data_source SET options = options || jsonb_build_object('obfuscatedSslCa', ssl_ca);
+UPDATE data_source SET options = options || jsonb_build_object('id', name);
+UPDATE data_source SET options = options || jsonb_build_object('type', 'ADMIN') WHERE type = 'ADMIN';
+UPDATE data_source SET options = options || jsonb_build_object('type', 'READ_ONLY') WHERE type = 'RO';
+
+ALTER TABLE data_source DROP COLUMN host;
+ALTER TABLE data_source DROP COLUMN port;
+ALTER TABLE data_source DROP COLUMN username;
+ALTER TABLE data_source DROP COLUMN password;
+ALTER TABLE data_source DROP COLUMN database;
+ALTER TABLE data_source DROP COLUMN ssl_key;
+ALTER TABLE data_source DROP COLUMN ssl_cert;
+ALTER TABLE data_source DROP COLUMN ssl_ca;
+ALTER TABLE data_source DROP COLUMN name;
+ALTER TABLE data_source DROP COLUMN type;
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 4b5725eaba..eb4d05219d 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -166,20 +166,8 @@ ALTER SEQUENCE db_schema_id_seq RESTART WITH 101;
CREATE TABLE data_source (
id serial PRIMARY KEY,
instance text NOT NULL REFERENCES instance(resource_id),
- name text NOT NULL,
- type text NOT NULL CHECK (type IN ('ADMIN', 'RW', 'RO')),
- username text NOT NULL,
- password text NOT NULL,
- ssl_key text NOT NULL DEFAULT '',
- ssl_cert text NOT NULL DEFAULT '',
- ssl_ca text NOT NULL DEFAULT '',
- host text NOT NULL DEFAULT '',
- port text NOT NULL DEFAULT '',
- options jsonb NOT NULL DEFAULT '{}',
- database text NOT NULL DEFAULT ''
-);
-
-CREATE UNIQUE INDEX idx_data_source_unique_instance_name ON data_source(instance, name);
+ options jsonb NOT NULL DEFAULT '{}'
+);
ALTER SEQUENCE data_source_id_seq RESTART WITH 101;
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index fe5849fce7..c18dd53ddd 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -212,5 +212,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.5.5"), releaseVersion)
+ require.Equal(t, semver.MustParse("3.5.6"), releaseVersion)
}
diff --git a/backend/runner/plancheck/ghost_sync_executor.go b/backend/runner/plancheck/ghost_sync_executor.go
index d110d7f37b..4117dce9d8 100644
--- a/backend/runner/plancheck/ghost_sync_executor.go
+++ b/backend/runner/plancheck/ghost_sync_executor.go
@@ -16,7 +16,6 @@ import (
"github.com/bytebase/bytebase/backend/common/log"
"github.com/bytebase/bytebase/backend/component/dbfactory"
"github.com/bytebase/bytebase/backend/component/ghost"
- api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/db"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/utils"
@@ -80,7 +79,7 @@ func (e *GhostSyncExecutor) Run(ctx context.Context, config *storepb.PlanCheckRu
return nil, errors.Errorf("database not found %q", config.DatabaseName)
}
- adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
if adminDataSource == nil {
return nil, common.Errorf(common.Internal, "admin data source not found for instance %s", instance.ResourceID)
}
diff --git a/backend/runner/taskrun/schema_update_ghost_executor.go b/backend/runner/taskrun/schema_update_ghost_executor.go
index f7ddbfa824..2d6153ec06 100644
--- a/backend/runner/taskrun/schema_update_ghost_executor.go
+++ b/backend/runner/taskrun/schema_update_ghost_executor.go
@@ -18,7 +18,6 @@ import (
"github.com/bytebase/bytebase/backend/component/ghost"
"github.com/bytebase/bytebase/backend/component/state"
enterprise "github.com/bytebase/bytebase/backend/enterprise/api"
- api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/db"
"github.com/bytebase/bytebase/backend/runner/schemasync"
"github.com/bytebase/bytebase/backend/store"
@@ -90,7 +89,7 @@ func (exec *SchemaUpdateGhostExecutor) RunOnce(ctx context.Context, driverCtx co
return err
}
- adminDataSource := utils.DataSourceFromInstanceWithType(instance, api.Admin)
+ adminDataSource := utils.DataSourceFromInstanceWithType(instance, storepb.DataSourceType_ADMIN)
if adminDataSource == nil {
return common.Errorf(common.Internal, "admin data source not found for instance %s", instance.ResourceID)
}
diff --git a/backend/server/onboard.go b/backend/server/onboard.go
index 87bf9b167f..4570051ced 100644
--- a/backend/server/onboard.go
+++ b/backend/server/onboard.go
@@ -43,13 +43,15 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
ExternalLink: "",
DataSources: []*store.DataSourceMessage{
{
- ID: "admin",
- Type: api.Admin,
- Username: postgres.SampleUser,
- ObfuscatedPassword: common.Obfuscate("", s.secret),
- Host: common.GetPostgresSocketDir(),
- Port: strconv.Itoa(s.profile.SampleDatabasePort),
- Database: postgres.SampleDatabaseTest,
+ Options: &storepb.DataSourceOptions{
+ Id: "admin",
+ Type: storepb.DataSourceType_ADMIN,
+ Username: postgres.SampleUser,
+ ObfuscatedPassword: common.Obfuscate("", s.secret),
+ Host: common.GetPostgresSocketDir(),
+ Port: strconv.Itoa(s.profile.SampleDatabasePort),
+ Database: postgres.SampleDatabaseTest,
+ },
},
},
EnvironmentID: api.DefaultTestEnvironmentID,
@@ -102,13 +104,15 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
ExternalLink: "",
DataSources: []*store.DataSourceMessage{
{
- ID: "admin",
- Type: api.Admin,
- Username: postgres.SampleUser,
- ObfuscatedPassword: common.Obfuscate("", s.secret),
- Host: common.GetPostgresSocketDir(),
- Port: strconv.Itoa(s.profile.SampleDatabasePort + 1),
- Database: postgres.SampleDatabaseProd,
+ Options: &storepb.DataSourceOptions{
+ Id: "admin",
+ Type: storepb.DataSourceType_ADMIN,
+ Username: postgres.SampleUser,
+ ObfuscatedPassword: common.Obfuscate("", s.secret),
+ Host: common.GetPostgresSocketDir(),
+ Port: strconv.Itoa(s.profile.SampleDatabasePort + 1),
+ Database: postgres.SampleDatabaseProd,
+ },
},
},
EnvironmentID: api.DefaultProdEnvironmentID,
diff --git a/backend/store/data_source.go b/backend/store/data_source.go
index 9e2610a9de..6402fb9cbc 100644
--- a/backend/store/data_source.go
+++ b/backend/store/data_source.go
@@ -3,191 +3,48 @@ package store
import (
"context"
"fmt"
- "slices"
"strings"
"github.com/pkg/errors"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
"google.golang.org/protobuf/encoding/protojson"
"github.com/bytebase/bytebase/backend/common"
- api "github.com/bytebase/bytebase/backend/legacyapi"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
// DataSourceMessage is the message for data source.
type DataSourceMessage struct {
- ID string
- Type api.DataSourceType
- Username string
- ObfuscatedPassword string
- ObfuscatedSslCa string
- ObfuscatedSslCert string
- ObfuscatedSslKey string
- Host string
- Port string
- Database string
- // Flatten data source options.
- SRV bool
- AuthenticationDatabase string
- SID string
- ServiceName string
- // SSH related.
- SSHHost string
- SSHPort string
- SSHUser string
- SSHObfuscatedPassword string
- SSHObfuscatedPrivateKey string
- // SASL.
- SASLConfig *storepb.SASLConfig
- // Authentication
- AuthenticationPrivateKeyObfuscated string
- // external secret
- ExternalSecret *storepb.DataSourceExternalSecret
- AuthenticationType storepb.DataSourceOptions_AuthenticationType
- AdditionalAddresses []*storepb.DataSourceOptions_Address
- ReplicaSet string
- DirectConnection bool
- Region string
- WarehouseID string
- UseSSL bool
- RedisType storepb.DataSourceOptions_RedisType
- MasterName string
- MasterUsername string
- MasterObfuscatedPassword string
- // Extra connection parameters
- ExtraConnectionParameters map[string]string
- ClientSecretCredential *storepb.DataSourceOptions_ClientSecretCredential
+ Options *storepb.DataSourceOptions
}
// FindDataSourceMessage is the message for finding a database.
type FindDataSourceMessage struct {
ID *string
- Name *string
InstanceID *string
- Type *api.DataSourceType
-}
-
-// Copy returns a copy of the data source message.
-func (m *DataSourceMessage) Copy() *DataSourceMessage {
- deepCopyAdditionalAddresses := slices.Clone[[]*storepb.DataSourceOptions_Address](m.AdditionalAddresses)
- return &DataSourceMessage{
- ID: m.ID,
- Type: m.Type,
- Username: m.Username,
- ObfuscatedPassword: m.ObfuscatedPassword,
- ObfuscatedSslCa: m.ObfuscatedSslCa,
- ObfuscatedSslCert: m.ObfuscatedSslCert,
- ObfuscatedSslKey: m.ObfuscatedSslKey,
- Host: m.Host,
- Port: m.Port,
- Database: m.Database,
- SRV: m.SRV,
- AuthenticationDatabase: m.AuthenticationDatabase,
- SID: m.SID,
- ServiceName: m.ServiceName,
- SSHHost: m.SSHHost,
- SSHPort: m.SSHPort,
- SSHUser: m.SSHUser,
- SSHObfuscatedPassword: m.SSHObfuscatedPassword,
- SSHObfuscatedPrivateKey: m.SSHObfuscatedPrivateKey,
- AuthenticationPrivateKeyObfuscated: m.AuthenticationPrivateKeyObfuscated,
- ExternalSecret: m.ExternalSecret,
- AuthenticationType: m.AuthenticationType,
- SASLConfig: m.SASLConfig,
- AdditionalAddresses: deepCopyAdditionalAddresses,
- ReplicaSet: m.ReplicaSet,
- DirectConnection: m.DirectConnection,
- Region: m.Region,
- UseSSL: m.UseSSL,
- RedisType: m.RedisType,
- MasterName: m.MasterName,
- MasterUsername: m.MasterUsername,
- MasterObfuscatedPassword: m.MasterObfuscatedPassword,
- ExtraConnectionParameters: m.ExtraConnectionParameters,
- ClientSecretCredential: m.ClientSecretCredential,
- }
}
// UpdateDataSourceMessage is the message for the data source.
type UpdateDataSourceMessage struct {
- InstanceID string
- DataSourceID string
-
- Username *string
- ObfuscatedPassword *string
- ObfuscatedSslCa *string
- ObfuscatedSslCert *string
- ObfuscatedSslKey *string
- Host *string
- Port *string
- Database *string
- // Flatten data source options.
- SRV *bool
- AuthenticationDatabase *string
- SID *string
- ServiceName *string
- // SSH related.
- SSHHost *string
- SSHPort *string
- SSHUser *string
- SSHObfuscatedPassword *string
- SSHObfuscatedPrivateKey *string
- // Authentication
- AuthenticationPrivateKeyObfuscated *string
- // external secret
- ExternalSecret *storepb.DataSourceExternalSecret
- RemoveExternalSecret bool
- AuthenticationType *storepb.DataSourceOptions_AuthenticationType
- // SASLConfig.
- SASLConfig *storepb.SASLConfig
- AdditionalAddress *[]*storepb.DataSourceOptions_Address
- ReplicaSet *string
- RemoveSASLConfig bool
- DirectConnection *bool
- Region *string
- WarehouseID *string
- UseSSL *bool
-
- RedisType *storepb.DataSourceOptions_RedisType
- MasterName *string
- MasterUsername *string
- MasterObfuscatedPassword *string
-
- ClientSecretCredential *storepb.DataSourceOptions_ClientSecretCredential
+ InstanceID string
+ ID string
+
+ Options *storepb.DataSourceOptions
}
func (*Store) listInstanceDataSourceMap(ctx context.Context, tx *Tx, find *FindDataSourceMessage) (map[string][]*DataSourceMessage, error) {
where, args := []string{"TRUE"}, []any{}
if find.ID != nil {
- where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *find.ID)
- }
- if find.Name != nil {
- where, args = append(where, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *find.Name)
+ where, args = append(where, fmt.Sprintf("options->>'id' = $%d", len(args)+1)), append(args, *find.ID)
}
if find.InstanceID != nil {
where, args = append(where, fmt.Sprintf("instance = $%d", len(args)+1)), append(args, *find.InstanceID)
}
- if find.Type != nil {
- where, args = append(where, fmt.Sprintf("type = $%d", len(args)+1)), append(args, *find.Type)
- }
instanceDataSourcesMap := make(map[string][]*DataSourceMessage)
rows, err := tx.QueryContext(ctx, `
SELECT
instance,
- name,
- type,
- username,
- password,
- ssl_key,
- ssl_cert,
- ssl_ca,
- host,
- port,
- database,
options
FROM data_source
WHERE `+strings.Join(where, " AND "),
@@ -203,51 +60,15 @@ func (*Store) listInstanceDataSourceMap(ctx context.Context, tx *Tx, find *FindD
var dataSourceMessage DataSourceMessage
if err := rows.Scan(
&instanceID,
- &dataSourceMessage.ID,
- &dataSourceMessage.Type,
- &dataSourceMessage.Username,
- &dataSourceMessage.ObfuscatedPassword,
- &dataSourceMessage.ObfuscatedSslKey,
- &dataSourceMessage.ObfuscatedSslCert,
- &dataSourceMessage.ObfuscatedSslCa,
- &dataSourceMessage.Host,
- &dataSourceMessage.Port,
- &dataSourceMessage.Database,
&protoBytes,
); err != nil {
return nil, err
}
- var dataSourceOptions storepb.DataSourceOptions
- if err := common.ProtojsonUnmarshaler.Unmarshal(protoBytes, &dataSourceOptions); err != nil {
+ dataSourceOptions := &storepb.DataSourceOptions{}
+ if err := common.ProtojsonUnmarshaler.Unmarshal(protoBytes, dataSourceOptions); err != nil {
return nil, err
}
- dataSourceMessage.SRV = dataSourceOptions.Srv
- dataSourceMessage.AuthenticationDatabase = dataSourceOptions.AuthenticationDatabase
- dataSourceMessage.SID = dataSourceOptions.Sid
- dataSourceMessage.ServiceName = dataSourceOptions.ServiceName
- dataSourceMessage.SSHHost = dataSourceOptions.SshHost
- dataSourceMessage.SSHPort = dataSourceOptions.SshPort
- dataSourceMessage.SSHUser = dataSourceOptions.SshUser
- dataSourceMessage.SSHObfuscatedPassword = dataSourceOptions.SshObfuscatedPassword
- dataSourceMessage.SSHObfuscatedPrivateKey = dataSourceOptions.SshObfuscatedPrivateKey
- dataSourceMessage.AuthenticationPrivateKeyObfuscated = dataSourceOptions.AuthenticationPrivateKeyObfuscated
- dataSourceMessage.ExternalSecret = dataSourceOptions.ExternalSecret
- dataSourceMessage.SASLConfig = dataSourceOptions.SaslConfig
- dataSourceMessage.AuthenticationType = dataSourceOptions.AuthenticationType
- dataSourceMessage.AdditionalAddresses = dataSourceOptions.AdditionalAddresses
- dataSourceMessage.ReplicaSet = dataSourceOptions.ReplicaSet
- dataSourceMessage.DirectConnection = dataSourceOptions.DirectConnection
- dataSourceMessage.Region = dataSourceOptions.Region
- dataSourceMessage.WarehouseID = dataSourceOptions.WarehouseId
- dataSourceMessage.UseSSL = dataSourceOptions.UseSsl
- dataSourceMessage.RedisType = dataSourceOptions.RedisType
- dataSourceMessage.MasterName = dataSourceOptions.MasterName
- dataSourceMessage.MasterObfuscatedPassword = dataSourceOptions.MasterObfuscatedPassword
- dataSourceMessage.MasterUsername = dataSourceOptions.MasterUsername
- dataSourceMessage.ExtraConnectionParameters = dataSourceOptions.ExtraConnectionParameters
- if dataSourceOptions.GetClientSecretCredential() != nil {
- dataSourceMessage.ClientSecretCredential = dataSourceOptions.GetClientSecretCredential()
- }
+ dataSourceMessage.Options = dataSourceOptions
instanceDataSourcesMap[instanceID] = append(instanceDataSourcesMap[instanceID], &dataSourceMessage)
}
if err := rows.Err(); err != nil {
@@ -260,7 +81,7 @@ func (*Store) listInstanceDataSourceMap(ctx context.Context, tx *Tx, find *FindD
func (s *Store) ListDataSourcesV2(ctx context.Context, find *FindDataSourceMessage) ([]*DataSourceMessage, error) {
tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
- return nil, errors.New("Failed to begin transaction")
+ return nil, err
}
defer tx.Rollback()
@@ -293,7 +114,7 @@ func (s *Store) GetDataSource(ctx context.Context, find *FindDataSourceMessage)
func (s *Store) AddDataSourceToInstanceV2(ctx context.Context, instanceID string, dataSource *DataSourceMessage) error {
tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
- return errors.New("Failed to begin transaction")
+ return err
}
defer tx.Rollback()
@@ -302,7 +123,7 @@ func (s *Store) AddDataSourceToInstanceV2(ctx context.Context, instanceID string
}
if err := tx.Commit(); err != nil {
- return errors.New("Failed to commit transaction")
+ return err
}
s.instanceCache.Remove(getInstanceCacheKey(instanceID))
@@ -313,216 +134,50 @@ func (s *Store) AddDataSourceToInstanceV2(ctx context.Context, instanceID string
func (s *Store) RemoveDataSourceV2(ctx context.Context, instanceID string, dataSourceID string) error {
tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
- return errors.New("Failed to begin transaction")
+ return err
}
defer tx.Rollback()
- result, err := tx.ExecContext(ctx, `
- DELETE FROM data_source WHERE instance = $1 AND name = $2;
- `, instanceID, dataSourceID)
- if err != nil {
+ if _, err := tx.ExecContext(ctx, `
+ DELETE FROM data_source WHERE instance = $1 AND options->>'id' = $2;
+ `, instanceID, dataSourceID); err != nil {
return err
}
- rowsAffected, err := result.RowsAffected()
- if err != nil {
- return errors.Wrapf(err, "failed to get rows affected")
- }
- if rowsAffected != 1 {
- return errors.Errorf("remove %d type data_sources for instance %s, but expected 1", rowsAffected, instanceID)
- }
-
if err := tx.Commit(); err != nil {
- return errors.Wrap(err, "failed to commit transaction")
+ return err
}
s.instanceCache.Remove(getInstanceCacheKey(instanceID))
return nil
}
-func getDataSourceOption(ctx context.Context, tx *Tx, find *FindDataSourceMessage) (*storepb.DataSourceOptions, error) {
- where, args := []string{"TRUE"}, []any{}
- if find.ID != nil {
- where, args = append(where, fmt.Sprintf("id = $%d", len(args)+1)), append(args, *find.ID)
- }
- if find.Name != nil {
- where, args = append(where, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *find.Name)
- }
- if find.InstanceID != nil {
- where, args = append(where, fmt.Sprintf("instance = $%d", len(args)+1)), append(args, *find.InstanceID)
- }
- if find.Type != nil {
- where, args = append(where, fmt.Sprintf("type = $%d", len(args)+1)), append(args, *find.Type)
- }
- row := tx.QueryRowContext(ctx, `
- SELECT
- options
- FROM data_source
- WHERE `+strings.Join(where, " AND "),
- args...,
- )
- if row.Err() != nil {
- return nil, row.Err()
- }
- var protoBytes []byte
- if err := row.Scan(&protoBytes); err != nil {
- return nil, err
- }
- var dataSourceOptions storepb.DataSourceOptions
- if err := common.ProtojsonUnmarshaler.Unmarshal(protoBytes, &dataSourceOptions); err != nil {
- return nil, err
- }
-
- return &dataSourceOptions, nil
-}
-
// UpdateDataSourceV2 updates a data source and returns the instance.
func (s *Store) UpdateDataSourceV2(ctx context.Context, patch *UpdateDataSourceMessage) error {
set, args := []string{}, []any{}
- if v := patch.Username; v != nil {
- set, args = append(set, fmt.Sprintf("username = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.ObfuscatedPassword; v != nil {
- set, args = append(set, fmt.Sprintf("password = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.ObfuscatedSslKey; v != nil {
- set, args = append(set, fmt.Sprintf("ssl_key = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.ObfuscatedSslCert; v != nil {
- set, args = append(set, fmt.Sprintf("ssl_cert = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.ObfuscatedSslCa; v != nil {
- set, args = append(set, fmt.Sprintf("ssl_ca = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.Host; v != nil {
- set, args = append(set, fmt.Sprintf("host = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.Port; v != nil {
- set, args = append(set, fmt.Sprintf("port = $%d", len(args)+1)), append(args, *v)
- }
- if v := patch.Database; v != nil {
- set, args = append(set, fmt.Sprintf("database = $%d", len(args)+1)), append(args, *v)
+ if v := patch.Options; v != nil {
+ o, err := protojson.Marshal(v)
+ if err != nil {
+ return err
+ }
+ set, args = append(set, fmt.Sprintf("options = $%d", len(args)+1)), append(args, o)
}
tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return errors.New("failed to begin transaction")
- }
- defer tx.Rollback()
-
- dataSource, err := getDataSourceOption(ctx, tx, &FindDataSourceMessage{
- InstanceID: &patch.InstanceID,
- Name: &patch.DataSourceID,
- })
if err != nil {
return err
}
- if dataSource == nil {
- return status.Errorf(codes.NotFound, "data source not found: %s", patch.DataSourceID)
- }
-
- if v := patch.SRV; v != nil {
- dataSource.Srv = *v
- }
- if v := patch.AuthenticationDatabase; v != nil {
- dataSource.AuthenticationDatabase = *v
- }
- if v := patch.SID; v != nil {
- dataSource.Sid = *v
- }
- if v := patch.ServiceName; v != nil {
- dataSource.ServiceName = *v
- }
- if v := patch.SSHHost; v != nil {
- dataSource.SshHost = *v
- }
- if v := patch.SSHPort; v != nil {
- dataSource.SshPort = *v
- }
- if v := patch.SSHUser; v != nil {
- dataSource.SshUser = *v
- }
- if v := patch.SSHObfuscatedPassword; v != nil {
- dataSource.SshObfuscatedPassword = *v
- }
- if v := patch.SSHObfuscatedPrivateKey; v != nil {
- dataSource.SshObfuscatedPrivateKey = *v
- }
- if v := patch.AuthenticationPrivateKeyObfuscated; v != nil {
- dataSource.AuthenticationPrivateKeyObfuscated = *v
- }
- if v := patch.AuthenticationType; v != nil {
- dataSource.AuthenticationType = *v
- }
- if v := patch.ExternalSecret; v != nil {
- dataSource.ExternalSecret = v
- } else if patch.RemoveExternalSecret {
- dataSource.ExternalSecret = nil
- }
- if v := patch.SASLConfig; v != nil {
- dataSource.SaslConfig = v
- } else if patch.RemoveSASLConfig {
- dataSource.SaslConfig = nil
- }
- if v := patch.AdditionalAddress; v != nil {
- dataSource.AdditionalAddresses = *v
- }
- if v := patch.ReplicaSet; v != nil {
- dataSource.ReplicaSet = *v
- }
- if v := patch.DirectConnection; v != nil {
- dataSource.DirectConnection = *v
- }
- if v := patch.Region; v != nil {
- dataSource.Region = *v
- }
- if v := patch.WarehouseID; v != nil {
- dataSource.WarehouseId = *v
- }
- if v := patch.UseSSL; v != nil {
- dataSource.UseSsl = *v
- }
- if v := patch.RedisType; v != nil {
- dataSource.RedisType = *v
- }
- if v := patch.MasterName; v != nil {
- dataSource.MasterName = *v
- }
- if v := patch.MasterUsername; v != nil {
- dataSource.MasterUsername = *v
- }
- if v := patch.MasterObfuscatedPassword; v != nil {
- dataSource.MasterObfuscatedPassword = *v
- }
- if v := patch.ClientSecretCredential; v != nil {
- dataSource.IamExtension = &storepb.DataSourceOptions_ClientSecretCredential_{
- ClientSecretCredential: v,
- }
- }
- protoBytes, err := protojson.Marshal(dataSource)
- if err != nil {
- return errors.Wrap(err, "failed to marshal data source options")
- }
- set, args = append(set, fmt.Sprintf("options = $%d", len(args)+1)), append(args, protoBytes)
+ defer tx.Rollback()
- query := fmt.Sprintf(`UPDATE data_source SET %s WHERE instance = $%d AND name = $%d`, strings.Join(set, ", "), len(args)+1, len(args)+2)
- args = append(args, patch.InstanceID, patch.DataSourceID)
- result, err := tx.ExecContext(ctx, query, args...)
- if err != nil {
+ query := fmt.Sprintf(`UPDATE data_source SET %s WHERE instance = $%d AND options->>'id' = $%d`, strings.Join(set, ", "), len(args)+1, len(args)+2)
+ args = append(args, patch.InstanceID, patch.ID)
+ if _, err := tx.ExecContext(ctx, query, args...); err != nil {
return err
}
- rowsAffected, err := result.RowsAffected()
- if err != nil {
- return errors.Wrapf(err, "failed to get rows affected")
- }
- if rowsAffected != 1 {
- return errors.Errorf("update %v data source records from instance %s, but expected one", rowsAffected, patch.InstanceID)
- }
-
if err := tx.Commit(); err != nil {
- return errors.Wrap(err, "failed to commit transaction")
+ return err
}
s.instanceCache.Remove(getInstanceCacheKey(patch.InstanceID))
@@ -530,64 +185,18 @@ func (s *Store) UpdateDataSourceV2(ctx context.Context, patch *UpdateDataSourceM
}
func (*Store) addDataSourceToInstanceImplV2(ctx context.Context, tx *Tx, instanceID string, dataSource *DataSourceMessage) error {
- // We flatten the data source fields in DataSourceMessage, so we need to compose them in store layer before INSERT.
- dataSourceOptions := storepb.DataSourceOptions{
- Srv: dataSource.SRV,
- AuthenticationDatabase: dataSource.AuthenticationDatabase,
- Sid: dataSource.SID,
- ServiceName: dataSource.ServiceName,
- SshHost: dataSource.SSHHost,
- SshPort: dataSource.SSHPort,
- SshUser: dataSource.SSHUser,
- SshObfuscatedPassword: dataSource.SSHObfuscatedPassword,
- SshObfuscatedPrivateKey: dataSource.SSHObfuscatedPrivateKey,
- AuthenticationPrivateKeyObfuscated: dataSource.AuthenticationPrivateKeyObfuscated,
- ExternalSecret: dataSource.ExternalSecret,
- AuthenticationType: dataSource.AuthenticationType,
- SaslConfig: dataSource.SASLConfig,
- AdditionalAddresses: dataSource.AdditionalAddresses,
- ReplicaSet: dataSource.ReplicaSet,
- DirectConnection: dataSource.DirectConnection,
- Region: dataSource.Region,
- WarehouseId: dataSource.WarehouseID,
- UseSsl: dataSource.UseSSL,
- RedisType: dataSource.RedisType,
- MasterName: dataSource.MasterName,
- MasterUsername: dataSource.MasterName,
- MasterObfuscatedPassword: dataSource.MasterObfuscatedPassword,
- ExtraConnectionParameters: dataSource.ExtraConnectionParameters,
- }
- if dataSource.ClientSecretCredential != nil {
- dataSourceOptions.IamExtension = &storepb.DataSourceOptions_ClientSecretCredential_{
- ClientSecretCredential: dataSource.ClientSecretCredential,
- }
- }
- protoBytes, err := protojson.Marshal(&dataSourceOptions)
+ protoBytes, err := protojson.Marshal(dataSource.Options)
if err != nil {
- return errors.Wrap(err, "failed to marshal data source options")
+ return err
}
if _, err := tx.ExecContext(ctx, `
INSERT INTO data_source (
instance,
- name,
- type,
- username,
- password,
- ssl_key,
- ssl_cert,
- ssl_ca,
- host,
- port,
- options,
- database
+ options
)
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
- `, instanceID, dataSource.ID,
- dataSource.Type, dataSource.Username, dataSource.ObfuscatedPassword, dataSource.ObfuscatedSslKey,
- dataSource.ObfuscatedSslCert, dataSource.ObfuscatedSslCa, dataSource.Host, dataSource.Port,
- protoBytes, dataSource.Database,
- ); err != nil {
+ VALUES ($1, $2)
+ `, instanceID, protoBytes); err != nil {
return err
}
diff --git a/backend/store/instance.go b/backend/store/instance.go
index a83d2209f6..3999050a70 100644
--- a/backend/store/instance.go
+++ b/backend/store/instance.go
@@ -13,7 +13,6 @@ import (
"google.golang.org/protobuf/encoding/protojson"
"github.com/bytebase/bytebase/backend/common"
- api "github.com/bytebase/bytebase/backend/legacyapi"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
@@ -436,11 +435,11 @@ func validateDataSourceList(dataSources []*DataSourceMessage) error {
dataSourceMap := map[string]bool{}
adminCount := 0
for _, dataSource := range dataSources {
- if dataSourceMap[dataSource.ID] {
- return status.Errorf(codes.InvalidArgument, "duplicate data source ID %s", dataSource.ID)
+ if dataSourceMap[dataSource.Options.GetId()] {
+ return status.Errorf(codes.InvalidArgument, "duplicate data source ID %s", dataSource.Options.GetId())
}
- dataSourceMap[dataSource.ID] = true
- if dataSource.Type == api.Admin {
+ dataSourceMap[dataSource.Options.GetId()] = true
+ if dataSource.Options.GetType() == storepb.DataSourceType_ADMIN {
adminCount++
}
}
diff --git a/backend/utils/utils.go b/backend/utils/utils.go
index e097bda857..4b058c12ad 100644
--- a/backend/utils/utils.go
+++ b/backend/utils/utils.go
@@ -31,9 +31,9 @@ import (
)
// DataSourceFromInstanceWithType gets a typed data source from an instance.
-func DataSourceFromInstanceWithType(instance *store.InstanceMessage, dataSourceType api.DataSourceType) *store.DataSourceMessage {
+func DataSourceFromInstanceWithType(instance *store.InstanceMessage, dataSourceType storepb.DataSourceType) *store.DataSourceMessage {
for _, dataSource := range instance.DataSources {
- if dataSource.Type == dataSourceType {
+ if dataSource.Options.GetType() == dataSourceType {
return dataSource
}
}
diff --git a/frontend/src/types/proto/store/data_source.ts b/frontend/src/types/proto/store/data_source.ts
index 797dc58d67..874f1ff92b 100644
--- a/frontend/src/types/proto/store/data_source.ts
+++ b/frontend/src/types/proto/store/data_source.ts
@@ -10,210 +10,70 @@ import Long from "long";
export const protobufPackage = "bytebase.store";
-export interface DataSourceExternalSecret {
- secretType: DataSourceExternalSecret_SecretType;
- url: string;
- authType: DataSourceExternalSecret_AuthType;
- appRole?: DataSourceExternalSecret_AppRoleAuthOption | undefined;
- token?:
- | string
- | undefined;
- /** engine name is the name for secret engine. */
- engineName: string;
- /** the secret name in the engine to store the password. */
- secretName: string;
- /** the key name for the password. */
- passwordKeyName: string;
-}
-
-export enum DataSourceExternalSecret_SecretType {
- SAECRET_TYPE_UNSPECIFIED = "SAECRET_TYPE_UNSPECIFIED",
- /** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
- VAULT_KV_V2 = "VAULT_KV_V2",
- /** AWS_SECRETS_MANAGER - ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html */
- AWS_SECRETS_MANAGER = "AWS_SECRETS_MANAGER",
- /** GCP_SECRET_MANAGER - ref: https://cloud.google.com/secret-manager/docs */
- GCP_SECRET_MANAGER = "GCP_SECRET_MANAGER",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceExternalSecret_SecretTypeFromJSON(object: any): DataSourceExternalSecret_SecretType {
- switch (object) {
- case 0:
- case "SAECRET_TYPE_UNSPECIFIED":
- return DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
- case 1:
- case "VAULT_KV_V2":
- return DataSourceExternalSecret_SecretType.VAULT_KV_V2;
- case 2:
- case "AWS_SECRETS_MANAGER":
- return DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER;
- case 3:
- case "GCP_SECRET_MANAGER":
- return DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceExternalSecret_SecretType.UNRECOGNIZED;
- }
-}
-
-export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExternalSecret_SecretType): string {
- switch (object) {
- case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
- return "SAECRET_TYPE_UNSPECIFIED";
- case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
- return "VAULT_KV_V2";
- case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
- return "AWS_SECRETS_MANAGER";
- case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
- return "GCP_SECRET_MANAGER";
- case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function dataSourceExternalSecret_SecretTypeToNumber(object: DataSourceExternalSecret_SecretType): number {
- switch (object) {
- case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
- return 0;
- case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
- return 1;
- case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
- return 2;
- case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
- return 3;
- case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum DataSourceExternalSecret_AuthType {
- AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
- /** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
- TOKEN = "TOKEN",
- /** VAULT_APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
- VAULT_APP_ROLE = "VAULT_APP_ROLE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function dataSourceExternalSecret_AuthTypeFromJSON(object: any): DataSourceExternalSecret_AuthType {
- switch (object) {
- case 0:
- case "AUTH_TYPE_UNSPECIFIED":
- return DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
- case 1:
- case "TOKEN":
- return DataSourceExternalSecret_AuthType.TOKEN;
- case 2:
- case "VAULT_APP_ROLE":
- return DataSourceExternalSecret_AuthType.VAULT_APP_ROLE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return DataSourceExternalSecret_AuthType.UNRECOGNIZED;
- }
-}
-
-export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExternalSecret_AuthType): string {
- switch (object) {
- case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
- return "AUTH_TYPE_UNSPECIFIED";
- case DataSourceExternalSecret_AuthType.TOKEN:
- return "TOKEN";
- case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
- return "VAULT_APP_ROLE";
- case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function dataSourceExternalSecret_AuthTypeToNumber(object: DataSourceExternalSecret_AuthType): number {
- switch (object) {
- case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
- return 0;
- case DataSourceExternalSecret_AuthType.TOKEN:
- return 1;
- case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
- return 2;
- case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface DataSourceExternalSecret_AppRoleAuthOption {
- roleId: string;
- /** the secret id for the role without ttl. */
- secretId: string;
- type: DataSourceExternalSecret_AppRoleAuthOption_SecretType;
- /** The path where the approle auth method is mounted. */
- mountPath: string;
-}
-
-export enum DataSourceExternalSecret_AppRoleAuthOption_SecretType {
- SECRET_TYPE_UNSPECIFIED = "SECRET_TYPE_UNSPECIFIED",
- PLAIN = "PLAIN",
- ENVIRONMENT = "ENVIRONMENT",
+export enum DataSourceType {
+ DATA_SOURCE_UNSPECIFIED = "DATA_SOURCE_UNSPECIFIED",
+ ADMIN = "ADMIN",
+ READ_ONLY = "READ_ONLY",
UNRECOGNIZED = "UNRECOGNIZED",
}
-export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(
- object: any,
-): DataSourceExternalSecret_AppRoleAuthOption_SecretType {
+export function dataSourceTypeFromJSON(object: any): DataSourceType {
switch (object) {
case 0:
- case "SECRET_TYPE_UNSPECIFIED":
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
+ case "DATA_SOURCE_UNSPECIFIED":
+ return DataSourceType.DATA_SOURCE_UNSPECIFIED;
case 1:
- case "PLAIN":
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN;
+ case "ADMIN":
+ return DataSourceType.ADMIN;
case 2:
- case "ENVIRONMENT":
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT;
+ case "READ_ONLY":
+ return DataSourceType.READ_ONLY;
case -1:
case "UNRECOGNIZED":
default:
- return DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED;
+ return DataSourceType.UNRECOGNIZED;
}
}
-export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(
- object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
-): string {
+export function dataSourceTypeToJSON(object: DataSourceType): string {
switch (object) {
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
- return "SECRET_TYPE_UNSPECIFIED";
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
- return "PLAIN";
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
- return "ENVIRONMENT";
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
+ case DataSourceType.DATA_SOURCE_UNSPECIFIED:
+ return "DATA_SOURCE_UNSPECIFIED";
+ case DataSourceType.ADMIN:
+ return "ADMIN";
+ case DataSourceType.READ_ONLY:
+ return "READ_ONLY";
+ case DataSourceType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
-export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(
- object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
-): number {
+export function dataSourceTypeToNumber(object: DataSourceType): number {
switch (object) {
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
+ case DataSourceType.DATA_SOURCE_UNSPECIFIED:
return 0;
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
+ case DataSourceType.ADMIN:
return 1;
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
+ case DataSourceType.READ_ONLY:
return 2;
- case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
+ case DataSourceType.UNRECOGNIZED:
default:
return -1;
}
}
export interface DataSourceOptions {
+ id: string;
+ type: DataSourceType;
+ host: string;
+ port: string;
+ username: string;
+ obfuscatedPassword: string;
+ database: string;
+ obfuscatedSslKey: string;
+ obfuscatedSslCert: string;
+ obfuscatedSslCa: string;
/** srv is a boolean flag that indicates whether the host is a DNS SRV record. */
srv: boolean;
/** authentication_database is the database name to authenticate against, which stores the user credentials. */
@@ -432,256 +292,660 @@ export interface KerberosConfig {
kdcTransportProtocol: string;
}
-function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
- return {
- secretType: DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
- url: "",
- authType: DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
- appRole: undefined,
- token: undefined,
- engineName: "",
- secretName: "",
- passwordKeyName: "",
- };
+export interface DataSourceExternalSecret {
+ secretType: DataSourceExternalSecret_SecretType;
+ url: string;
+ authType: DataSourceExternalSecret_AuthType;
+ appRole?: DataSourceExternalSecret_AppRoleAuthOption | undefined;
+ token?:
+ | string
+ | undefined;
+ /** engine name is the name for secret engine. */
+ engineName: string;
+ /** the secret name in the engine to store the password. */
+ secretName: string;
+ /** the key name for the password. */
+ passwordKeyName: string;
}
-export const DataSourceExternalSecret: MessageFns<DataSourceExternalSecret> = {
- encode(message: DataSourceExternalSecret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
- writer.uint32(8).int32(dataSourceExternalSecret_SecretTypeToNumber(message.secretType));
- }
- if (message.url !== "") {
- writer.uint32(18).string(message.url);
- }
- if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(dataSourceExternalSecret_AuthTypeToNumber(message.authType));
- }
- if (message.appRole !== undefined) {
- DataSourceExternalSecret_AppRoleAuthOption.encode(message.appRole, writer.uint32(34).fork()).join();
- }
- if (message.token !== undefined) {
- writer.uint32(42).string(message.token);
- }
- if (message.engineName !== "") {
- writer.uint32(50).string(message.engineName);
- }
- if (message.secretName !== "") {
- writer.uint32(58).string(message.secretName);
- }
- if (message.passwordKeyName !== "") {
- writer.uint32(66).string(message.passwordKeyName);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceExternalSecret {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceExternalSecret();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 8) {
- break;
- }
+export enum DataSourceExternalSecret_SecretType {
+ SAECRET_TYPE_UNSPECIFIED = "SAECRET_TYPE_UNSPECIFIED",
+ /** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
+ VAULT_KV_V2 = "VAULT_KV_V2",
+ /** AWS_SECRETS_MANAGER - ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html */
+ AWS_SECRETS_MANAGER = "AWS_SECRETS_MANAGER",
+ /** GCP_SECRET_MANAGER - ref: https://cloud.google.com/secret-manager/docs */
+ GCP_SECRET_MANAGER = "GCP_SECRET_MANAGER",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
- message.secretType = dataSourceExternalSecret_SecretTypeFromJSON(reader.int32());
- continue;
- }
- case 2: {
- if (tag !== 18) {
+export function dataSourceExternalSecret_SecretTypeFromJSON(object: any): DataSourceExternalSecret_SecretType {
+ switch (object) {
+ case 0:
+ case "SAECRET_TYPE_UNSPECIFIED":
+ return DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
+ case 1:
+ case "VAULT_KV_V2":
+ return DataSourceExternalSecret_SecretType.VAULT_KV_V2;
+ case 2:
+ case "AWS_SECRETS_MANAGER":
+ return DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER;
+ case 3:
+ case "GCP_SECRET_MANAGER":
+ return DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return DataSourceExternalSecret_SecretType.UNRECOGNIZED;
+ }
+}
+
+export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExternalSecret_SecretType): string {
+ switch (object) {
+ case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
+ return "SAECRET_TYPE_UNSPECIFIED";
+ case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
+ return "VAULT_KV_V2";
+ case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
+ return "AWS_SECRETS_MANAGER";
+ case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
+ return "GCP_SECRET_MANAGER";
+ case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function dataSourceExternalSecret_SecretTypeToNumber(object: DataSourceExternalSecret_SecretType): number {
+ switch (object) {
+ case DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_SecretType.VAULT_KV_V2:
+ return 1;
+ case DataSourceExternalSecret_SecretType.AWS_SECRETS_MANAGER:
+ return 2;
+ case DataSourceExternalSecret_SecretType.GCP_SECRET_MANAGER:
+ return 3;
+ case DataSourceExternalSecret_SecretType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
+export enum DataSourceExternalSecret_AuthType {
+ AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
+ /** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
+ TOKEN = "TOKEN",
+ /** VAULT_APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
+ VAULT_APP_ROLE = "VAULT_APP_ROLE",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function dataSourceExternalSecret_AuthTypeFromJSON(object: any): DataSourceExternalSecret_AuthType {
+ switch (object) {
+ case 0:
+ case "AUTH_TYPE_UNSPECIFIED":
+ return DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
+ case 1:
+ case "TOKEN":
+ return DataSourceExternalSecret_AuthType.TOKEN;
+ case 2:
+ case "VAULT_APP_ROLE":
+ return DataSourceExternalSecret_AuthType.VAULT_APP_ROLE;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return DataSourceExternalSecret_AuthType.UNRECOGNIZED;
+ }
+}
+
+export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExternalSecret_AuthType): string {
+ switch (object) {
+ case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
+ return "AUTH_TYPE_UNSPECIFIED";
+ case DataSourceExternalSecret_AuthType.TOKEN:
+ return "TOKEN";
+ case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
+ return "VAULT_APP_ROLE";
+ case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function dataSourceExternalSecret_AuthTypeToNumber(object: DataSourceExternalSecret_AuthType): number {
+ switch (object) {
+ case DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_AuthType.TOKEN:
+ return 1;
+ case DataSourceExternalSecret_AuthType.VAULT_APP_ROLE:
+ return 2;
+ case DataSourceExternalSecret_AuthType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
+export interface DataSourceExternalSecret_AppRoleAuthOption {
+ roleId: string;
+ /** the secret id for the role without ttl. */
+ secretId: string;
+ type: DataSourceExternalSecret_AppRoleAuthOption_SecretType;
+ /** The path where the approle auth method is mounted. */
+ mountPath: string;
+}
+
+export enum DataSourceExternalSecret_AppRoleAuthOption_SecretType {
+ SECRET_TYPE_UNSPECIFIED = "SECRET_TYPE_UNSPECIFIED",
+ PLAIN = "PLAIN",
+ ENVIRONMENT = "ENVIRONMENT",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(
+ object: any,
+): DataSourceExternalSecret_AppRoleAuthOption_SecretType {
+ switch (object) {
+ case 0:
+ case "SECRET_TYPE_UNSPECIFIED":
+ return DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
+ case 1:
+ case "PLAIN":
+ return DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN;
+ case 2:
+ case "ENVIRONMENT":
+ return DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED;
+ }
+}
+
+export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(
+ object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
+): string {
+ switch (object) {
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
+ return "SECRET_TYPE_UNSPECIFIED";
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
+ return "PLAIN";
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
+ return "ENVIRONMENT";
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(
+ object: DataSourceExternalSecret_AppRoleAuthOption_SecretType,
+): number {
+ switch (object) {
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED:
+ return 0;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
+ return 1;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
+ return 2;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
+function createBaseDataSourceOptions(): DataSourceOptions {
+ return {
+ id: "",
+ type: DataSourceType.DATA_SOURCE_UNSPECIFIED,
+ host: "",
+ port: "",
+ username: "",
+ obfuscatedPassword: "",
+ database: "",
+ obfuscatedSslKey: "",
+ obfuscatedSslCert: "",
+ obfuscatedSslCa: "",
+ srv: false,
+ authenticationDatabase: "",
+ sid: "",
+ serviceName: "",
+ sshHost: "",
+ sshPort: "",
+ sshUser: "",
+ sshObfuscatedPassword: "",
+ sshObfuscatedPrivateKey: "",
+ authenticationPrivateKeyObfuscated: "",
+ externalSecret: undefined,
+ authenticationType: DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
+ clientSecretCredential: undefined,
+ saslConfig: undefined,
+ additionalAddresses: [],
+ replicaSet: "",
+ directConnection: false,
+ region: "",
+ warehouseId: "",
+ masterName: "",
+ masterUsername: "",
+ masterObfuscatedPassword: "",
+ redisType: DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED,
+ useSsl: false,
+ cluster: "",
+ extraConnectionParameters: {},
+ };
+}
+
+export const DataSourceOptions: MessageFns<DataSourceOptions> = {
+ encode(message: DataSourceOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.id !== "") {
+ writer.uint32(10).string(message.id);
+ }
+ if (message.type !== DataSourceType.DATA_SOURCE_UNSPECIFIED) {
+ writer.uint32(16).int32(dataSourceTypeToNumber(message.type));
+ }
+ if (message.host !== "") {
+ writer.uint32(26).string(message.host);
+ }
+ if (message.port !== "") {
+ writer.uint32(34).string(message.port);
+ }
+ if (message.username !== "") {
+ writer.uint32(42).string(message.username);
+ }
+ if (message.obfuscatedPassword !== "") {
+ writer.uint32(50).string(message.obfuscatedPassword);
+ }
+ if (message.database !== "") {
+ writer.uint32(58).string(message.database);
+ }
+ if (message.obfuscatedSslKey !== "") {
+ writer.uint32(66).string(message.obfuscatedSslKey);
+ }
+ if (message.obfuscatedSslCert !== "") {
+ writer.uint32(74).string(message.obfuscatedSslCert);
+ }
+ if (message.obfuscatedSslCa !== "") {
+ writer.uint32(82).string(message.obfuscatedSslCa);
+ }
+ if (message.srv !== false) {
+ writer.uint32(88).bool(message.srv);
+ }
+ if (message.authenticationDatabase !== "") {
+ writer.uint32(98).string(message.authenticationDatabase);
+ }
+ if (message.sid !== "") {
+ writer.uint32(106).string(message.sid);
+ }
+ if (message.serviceName !== "") {
+ writer.uint32(114).string(message.serviceName);
+ }
+ if (message.sshHost !== "") {
+ writer.uint32(122).string(message.sshHost);
+ }
+ if (message.sshPort !== "") {
+ writer.uint32(130).string(message.sshPort);
+ }
+ if (message.sshUser !== "") {
+ writer.uint32(138).string(message.sshUser);
+ }
+ if (message.sshObfuscatedPassword !== "") {
+ writer.uint32(146).string(message.sshObfuscatedPassword);
+ }
+ if (message.sshObfuscatedPrivateKey !== "") {
+ writer.uint32(154).string(message.sshObfuscatedPrivateKey);
+ }
+ if (message.authenticationPrivateKeyObfuscated !== "") {
+ writer.uint32(162).string(message.authenticationPrivateKeyObfuscated);
+ }
+ if (message.externalSecret !== undefined) {
+ DataSourceExternalSecret.encode(message.externalSecret, writer.uint32(170).fork()).join();
+ }
+ if (message.authenticationType !== DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
+ writer.uint32(176).int32(dataSourceOptions_AuthenticationTypeToNumber(message.authenticationType));
+ }
+ if (message.clientSecretCredential !== undefined) {
+ DataSourceOptions_ClientSecretCredential.encode(message.clientSecretCredential, writer.uint32(186).fork()).join();
+ }
+ if (message.saslConfig !== undefined) {
+ SASLConfig.encode(message.saslConfig, writer.uint32(194).fork()).join();
+ }
+ for (const v of message.additionalAddresses) {
+ DataSourceOptions_Address.encode(v!, writer.uint32(202).fork()).join();
+ }
+ if (message.replicaSet !== "") {
+ writer.uint32(210).string(message.replicaSet);
+ }
+ if (message.directConnection !== false) {
+ writer.uint32(216).bool(message.directConnection);
+ }
+ if (message.region !== "") {
+ writer.uint32(226).string(message.region);
+ }
+ if (message.warehouseId !== "") {
+ writer.uint32(234).string(message.warehouseId);
+ }
+ if (message.masterName !== "") {
+ writer.uint32(242).string(message.masterName);
+ }
+ if (message.masterUsername !== "") {
+ writer.uint32(250).string(message.masterUsername);
+ }
+ if (message.masterObfuscatedPassword !== "") {
+ writer.uint32(258).string(message.masterObfuscatedPassword);
+ }
+ if (message.redisType !== DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED) {
+ writer.uint32(264).int32(dataSourceOptions_RedisTypeToNumber(message.redisType));
+ }
+ if (message.useSsl !== false) {
+ writer.uint32(272).bool(message.useSsl);
+ }
+ if (message.cluster !== "") {
+ writer.uint32(282).string(message.cluster);
+ }
+ Object.entries(message.extraConnectionParameters).forEach(([key, value]) => {
+ DataSourceOptions_ExtraConnectionParametersEntry.encode({ key: key as any, value }, writer.uint32(290).fork())
+ .join();
+ });
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDataSourceOptions();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
+ break;
+ }
+
+ message.id = reader.string();
+ continue;
+ }
+ case 2: {
+ if (tag !== 16) {
+ break;
+ }
+
+ message.type = dataSourceTypeFromJSON(reader.int32());
+ continue;
+ }
+ case 3: {
+ if (tag !== 26) {
+ break;
+ }
+
+ message.host = reader.string();
+ continue;
+ }
+ case 4: {
+ if (tag !== 34) {
+ break;
+ }
+
+ message.port = reader.string();
+ continue;
+ }
+ case 5: {
+ if (tag !== 42) {
+ break;
+ }
+
+ message.username = reader.string();
+ continue;
+ }
+ case 6: {
+ if (tag !== 50) {
+ break;
+ }
+
+ message.obfuscatedPassword = reader.string();
+ continue;
+ }
+ case 7: {
+ if (tag !== 58) {
+ break;
+ }
+
+ message.database = reader.string();
+ continue;
+ }
+ case 8: {
+ if (tag !== 66) {
+ break;
+ }
+
+ message.obfuscatedSslKey = reader.string();
+ continue;
+ }
+ case 9: {
+ if (tag !== 74) {
+ break;
+ }
+
+ message.obfuscatedSslCert = reader.string();
+ continue;
+ }
+ case 10: {
+ if (tag !== 82) {
+ break;
+ }
+
+ message.obfuscatedSslCa = reader.string();
+ continue;
+ }
+ case 11: {
+ if (tag !== 88) {
+ break;
+ }
+
+ message.srv = reader.bool();
+ continue;
+ }
+ case 12: {
+ if (tag !== 98) {
+ break;
+ }
+
+ message.authenticationDatabase = reader.string();
+ continue;
+ }
+ case 13: {
+ if (tag !== 106) {
+ break;
+ }
+
+ message.sid = reader.string();
+ continue;
+ }
+ case 14: {
+ if (tag !== 114) {
+ break;
+ }
+
+ message.serviceName = reader.string();
+ continue;
+ }
+ case 15: {
+ if (tag !== 122) {
+ break;
+ }
+
+ message.sshHost = reader.string();
+ continue;
+ }
+ case 16: {
+ if (tag !== 130) {
+ break;
+ }
+
+ message.sshPort = reader.string();
+ continue;
+ }
+ case 17: {
+ if (tag !== 138) {
+ break;
+ }
+
+ message.sshUser = reader.string();
+ continue;
+ }
+ case 18: {
+ if (tag !== 146) {
+ break;
+ }
+
+ message.sshObfuscatedPassword = reader.string();
+ continue;
+ }
+ case 19: {
+ if (tag !== 154) {
+ break;
+ }
+
+ message.sshObfuscatedPrivateKey = reader.string();
+ continue;
+ }
+ case 20: {
+ if (tag !== 162) {
break;
}
- message.url = reader.string();
+ message.authenticationPrivateKeyObfuscated = reader.string();
continue;
}
- case 3: {
- if (tag !== 24) {
+ case 21: {
+ if (tag !== 170) {
break;
}
- message.authType = dataSourceExternalSecret_AuthTypeFromJSON(reader.int32());
+ message.externalSecret = DataSourceExternalSecret.decode(reader, reader.uint32());
continue;
}
- case 4: {
- if (tag !== 34) {
+ case 22: {
+ if (tag !== 176) {
break;
}
- message.appRole = DataSourceExternalSecret_AppRoleAuthOption.decode(reader, reader.uint32());
+ message.authenticationType = dataSourceOptions_AuthenticationTypeFromJSON(reader.int32());
continue;
}
- case 5: {
- if (tag !== 42) {
+ case 23: {
+ if (tag !== 186) {
break;
}
- message.token = reader.string();
+ message.clientSecretCredential = DataSourceOptions_ClientSecretCredential.decode(reader, reader.uint32());
continue;
}
- case 6: {
- if (tag !== 50) {
+ case 24: {
+ if (tag !== 194) {
break;
}
- message.engineName = reader.string();
+ message.saslConfig = SASLConfig.decode(reader, reader.uint32());
continue;
}
- case 7: {
- if (tag !== 58) {
+ case 25: {
+ if (tag !== 202) {
break;
}
- message.secretName = reader.string();
+ message.additionalAddresses.push(DataSourceOptions_Address.decode(reader, reader.uint32()));
continue;
}
- case 8: {
- if (tag !== 66) {
+ case 26: {
+ if (tag !== 210) {
break;
}
- message.passwordKeyName = reader.string();
+ message.replicaSet = reader.string();
continue;
}
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
+ case 27: {
+ if (tag !== 216) {
+ break;
+ }
- fromJSON(object: any): DataSourceExternalSecret {
- return {
- secretType: isSet(object.secretType)
- ? dataSourceExternalSecret_SecretTypeFromJSON(object.secretType)
- : DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
- url: isSet(object.url) ? globalThis.String(object.url) : "",
- authType: isSet(object.authType)
- ? dataSourceExternalSecret_AuthTypeFromJSON(object.authType)
- : DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
- appRole: isSet(object.appRole) ? DataSourceExternalSecret_AppRoleAuthOption.fromJSON(object.appRole) : undefined,
- token: isSet(object.token) ? globalThis.String(object.token) : undefined,
- engineName: isSet(object.engineName) ? globalThis.String(object.engineName) : "",
- secretName: isSet(object.secretName) ? globalThis.String(object.secretName) : "",
- passwordKeyName: isSet(object.passwordKeyName) ? globalThis.String(object.passwordKeyName) : "",
- };
- },
+ message.directConnection = reader.bool();
+ continue;
+ }
+ case 28: {
+ if (tag !== 226) {
+ break;
+ }
- toJSON(message: DataSourceExternalSecret): unknown {
- const obj: any = {};
- if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
- obj.secretType = dataSourceExternalSecret_SecretTypeToJSON(message.secretType);
- }
- if (message.url !== "") {
- obj.url = message.url;
- }
- if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
- obj.authType = dataSourceExternalSecret_AuthTypeToJSON(message.authType);
- }
- if (message.appRole !== undefined) {
- obj.appRole = DataSourceExternalSecret_AppRoleAuthOption.toJSON(message.appRole);
- }
- if (message.token !== undefined) {
- obj.token = message.token;
- }
- if (message.engineName !== "") {
- obj.engineName = message.engineName;
- }
- if (message.secretName !== "") {
- obj.secretName = message.secretName;
- }
- if (message.passwordKeyName !== "") {
- obj.passwordKeyName = message.passwordKeyName;
- }
- return obj;
- },
+ message.region = reader.string();
+ continue;
+ }
+ case 29: {
+ if (tag !== 234) {
+ break;
+ }
- create(base?: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
- return DataSourceExternalSecret.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
- const message = createBaseDataSourceExternalSecret();
- message.secretType = object.secretType ?? DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
- message.url = object.url ?? "";
- message.authType = object.authType ?? DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
- message.appRole = (object.appRole !== undefined && object.appRole !== null)
- ? DataSourceExternalSecret_AppRoleAuthOption.fromPartial(object.appRole)
- : undefined;
- message.token = object.token ?? undefined;
- message.engineName = object.engineName ?? "";
- message.secretName = object.secretName ?? "";
- message.passwordKeyName = object.passwordKeyName ?? "";
- return message;
- },
-};
+ message.warehouseId = reader.string();
+ continue;
+ }
+ case 30: {
+ if (tag !== 242) {
+ break;
+ }
-function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
- return {
- roleId: "",
- secretId: "",
- type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
- mountPath: "",
- };
-}
+ message.masterName = reader.string();
+ continue;
+ }
+ case 31: {
+ if (tag !== 250) {
+ break;
+ }
-export const DataSourceExternalSecret_AppRoleAuthOption: MessageFns<DataSourceExternalSecret_AppRoleAuthOption> = {
- encode(message: DataSourceExternalSecret_AppRoleAuthOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.roleId !== "") {
- writer.uint32(10).string(message.roleId);
- }
- if (message.secretId !== "") {
- writer.uint32(18).string(message.secretId);
- }
- if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
- writer.uint32(24).int32(dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(message.type));
- }
- if (message.mountPath !== "") {
- writer.uint32(34).string(message.mountPath);
- }
- return writer;
- },
+ message.masterUsername = reader.string();
+ continue;
+ }
+ case 32: {
+ if (tag !== 258) {
+ break;
+ }
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceExternalSecret_AppRoleAuthOption {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
+ message.masterObfuscatedPassword = reader.string();
+ continue;
+ }
+ case 33: {
+ if (tag !== 264) {
break;
}
- message.roleId = reader.string();
+ message.redisType = dataSourceOptions_RedisTypeFromJSON(reader.int32());
continue;
}
- case 2: {
- if (tag !== 18) {
+ case 34: {
+ if (tag !== 272) {
break;
}
- message.secretId = reader.string();
+ message.useSsl = reader.bool();
continue;
}
- case 3: {
- if (tag !== 24) {
+ case 35: {
+ if (tag !== 282) {
break;
}
- message.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(reader.int32());
+ message.cluster = reader.string();
continue;
}
- case 4: {
- if (tag !== 34) {
+ case 36: {
+ if (tag !== 290) {
break;
}
- message.mountPath = reader.string();
+ const entry36 = DataSourceOptions_ExtraConnectionParametersEntry.decode(reader, reader.uint32());
+ if (entry36.value !== undefined) {
+ message.extraConnectionParameters[entry36.key] = entry36.value;
+ }
continue;
}
}
@@ -693,380 +957,528 @@ export const DataSourceExternalSecret_AppRoleAuthOption: MessageFns<DataSourceEx
return message;
},
- fromJSON(object: any): DataSourceExternalSecret_AppRoleAuthOption {
+ fromJSON(object: any): DataSourceOptions {
return {
- roleId: isSet(object.roleId) ? globalThis.String(object.roleId) : "",
- secretId: isSet(object.secretId) ? globalThis.String(object.secretId) : "",
- type: isSet(object.type)
- ? dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(object.type)
- : DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
- mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
+ type: isSet(object.type) ? dataSourceTypeFromJSON(object.type) : DataSourceType.DATA_SOURCE_UNSPECIFIED,
+ host: isSet(object.host) ? globalThis.String(object.host) : "",
+ port: isSet(object.port) ? globalThis.String(object.port) : "",
+ username: isSet(object.username) ? globalThis.String(object.username) : "",
+ obfuscatedPassword: isSet(object.obfuscatedPassword) ? globalThis.String(object.obfuscatedPassword) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ obfuscatedSslKey: isSet(object.obfuscatedSslKey) ? globalThis.String(object.obfuscatedSslKey) : "",
+ obfuscatedSslCert: isSet(object.obfuscatedSslCert) ? globalThis.String(object.obfuscatedSslCert) : "",
+ obfuscatedSslCa: isSet(object.obfuscatedSslCa) ? globalThis.String(object.obfuscatedSslCa) : "",
+ srv: isSet(object.srv) ? globalThis.Boolean(object.srv) : false,
+ authenticationDatabase: isSet(object.authenticationDatabase)
+ ? globalThis.String(object.authenticationDatabase)
+ : "",
+ sid: isSet(object.sid) ? globalThis.String(object.sid) : "",
+ serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
+ sshHost: isSet(object.sshHost) ? globalThis.String(object.sshHost) : "",
+ sshPort: isSet(object.sshPort) ? globalThis.String(object.sshPort) : "",
+ sshUser: isSet(object.sshUser) ? globalThis.String(object.sshUser) : "",
+ sshObfuscatedPassword: isSet(object.sshObfuscatedPassword) ? globalThis.String(object.sshObfuscatedPassword) : "",
+ sshObfuscatedPrivateKey: isSet(object.sshObfuscatedPrivateKey)
+ ? globalThis.String(object.sshObfuscatedPrivateKey)
+ : "",
+ authenticationPrivateKeyObfuscated: isSet(object.authenticationPrivateKeyObfuscated)
+ ? globalThis.String(object.authenticationPrivateKeyObfuscated)
+ : "",
+ externalSecret: isSet(object.externalSecret)
+ ? DataSourceExternalSecret.fromJSON(object.externalSecret)
+ : undefined,
+ authenticationType: isSet(object.authenticationType)
+ ? dataSourceOptions_AuthenticationTypeFromJSON(object.authenticationType)
+ : DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
+ clientSecretCredential: isSet(object.clientSecretCredential)
+ ? DataSourceOptions_ClientSecretCredential.fromJSON(object.clientSecretCredential)
+ : undefined,
+ saslConfig: isSet(object.saslConfig) ? SASLConfig.fromJSON(object.saslConfig) : undefined,
+ additionalAddresses: globalThis.Array.isArray(object?.additionalAddresses)
+ ? object.additionalAddresses.map((e: any) => DataSourceOptions_Address.fromJSON(e))
+ : [],
+ replicaSet: isSet(object.replicaSet) ? globalThis.String(object.replicaSet) : "",
+ directConnection: isSet(object.directConnection) ? globalThis.Boolean(object.directConnection) : false,
+ region: isSet(object.region) ? globalThis.String(object.region) : "",
+ warehouseId: isSet(object.warehouseId) ? globalThis.String(object.warehouseId) : "",
+ masterName: isSet(object.masterName) ? globalThis.String(object.masterName) : "",
+ masterUsername: isSet(object.masterUsername) ? globalThis.String(object.masterUsername) : "",
+ masterObfuscatedPassword: isSet(object.masterObfuscatedPassword)
+ ? globalThis.String(object.masterObfuscatedPassword)
+ : "",
+ redisType: isSet(object.redisType)
+ ? dataSourceOptions_RedisTypeFromJSON(object.redisType)
+ : DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED,
+ useSsl: isSet(object.useSsl) ? globalThis.Boolean(object.useSsl) : false,
+ cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "",
+ extraConnectionParameters: isObject(object.extraConnectionParameters)
+ ? Object.entries(object.extraConnectionParameters).reduce<{ [key: string]: string }>((acc, [key, value]) => {
+ acc[key] = String(value);
+ return acc;
+ }, {})
+ : {},
};
},
- toJSON(message: DataSourceExternalSecret_AppRoleAuthOption): unknown {
+ toJSON(message: DataSourceOptions): unknown {
const obj: any = {};
- if (message.roleId !== "") {
- obj.roleId = message.roleId;
+ if (message.id !== "") {
+ obj.id = message.id;
+ }
+ if (message.type !== DataSourceType.DATA_SOURCE_UNSPECIFIED) {
+ obj.type = dataSourceTypeToJSON(message.type);
+ }
+ if (message.host !== "") {
+ obj.host = message.host;
+ }
+ if (message.port !== "") {
+ obj.port = message.port;
}
- if (message.secretId !== "") {
- obj.secretId = message.secretId;
+ if (message.username !== "") {
+ obj.username = message.username;
}
- if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
- obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
+ if (message.obfuscatedPassword !== "") {
+ obj.obfuscatedPassword = message.obfuscatedPassword;
}
- if (message.mountPath !== "") {
- obj.mountPath = message.mountPath;
+ if (message.database !== "") {
+ obj.database = message.database;
+ }
+ if (message.obfuscatedSslKey !== "") {
+ obj.obfuscatedSslKey = message.obfuscatedSslKey;
+ }
+ if (message.obfuscatedSslCert !== "") {
+ obj.obfuscatedSslCert = message.obfuscatedSslCert;
+ }
+ if (message.obfuscatedSslCa !== "") {
+ obj.obfuscatedSslCa = message.obfuscatedSslCa;
}
- return obj;
- },
-
- create(base?: DeepPartial<DataSourceExternalSecret_AppRoleAuthOption>): DataSourceExternalSecret_AppRoleAuthOption {
- return DataSourceExternalSecret_AppRoleAuthOption.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataSourceExternalSecret_AppRoleAuthOption>,
- ): DataSourceExternalSecret_AppRoleAuthOption {
- const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
- message.roleId = object.roleId ?? "";
- message.secretId = object.secretId ?? "";
- message.type = object.type ?? DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
- message.mountPath = object.mountPath ?? "";
- return message;
- },
-};
-
-function createBaseDataSourceOptions(): DataSourceOptions {
- return {
- srv: false,
- authenticationDatabase: "",
- sid: "",
- serviceName: "",
- sshHost: "",
- sshPort: "",
- sshUser: "",
- sshObfuscatedPassword: "",
- sshObfuscatedPrivateKey: "",
- authenticationPrivateKeyObfuscated: "",
- externalSecret: undefined,
- authenticationType: DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
- clientSecretCredential: undefined,
- saslConfig: undefined,
- additionalAddresses: [],
- replicaSet: "",
- directConnection: false,
- region: "",
- warehouseId: "",
- masterName: "",
- masterUsername: "",
- masterObfuscatedPassword: "",
- redisType: DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED,
- useSsl: false,
- cluster: "",
- extraConnectionParameters: {},
- };
-}
-
-export const DataSourceOptions: MessageFns<DataSourceOptions> = {
- encode(message: DataSourceOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.srv !== false) {
- writer.uint32(8).bool(message.srv);
+ obj.srv = message.srv;
}
if (message.authenticationDatabase !== "") {
- writer.uint32(18).string(message.authenticationDatabase);
+ obj.authenticationDatabase = message.authenticationDatabase;
}
if (message.sid !== "") {
- writer.uint32(26).string(message.sid);
+ obj.sid = message.sid;
}
if (message.serviceName !== "") {
- writer.uint32(34).string(message.serviceName);
+ obj.serviceName = message.serviceName;
}
if (message.sshHost !== "") {
- writer.uint32(42).string(message.sshHost);
+ obj.sshHost = message.sshHost;
}
if (message.sshPort !== "") {
- writer.uint32(50).string(message.sshPort);
+ obj.sshPort = message.sshPort;
}
if (message.sshUser !== "") {
- writer.uint32(58).string(message.sshUser);
+ obj.sshUser = message.sshUser;
}
if (message.sshObfuscatedPassword !== "") {
- writer.uint32(66).string(message.sshObfuscatedPassword);
+ obj.sshObfuscatedPassword = message.sshObfuscatedPassword;
}
if (message.sshObfuscatedPrivateKey !== "") {
- writer.uint32(74).string(message.sshObfuscatedPrivateKey);
+ obj.sshObfuscatedPrivateKey = message.sshObfuscatedPrivateKey;
}
if (message.authenticationPrivateKeyObfuscated !== "") {
- writer.uint32(82).string(message.authenticationPrivateKeyObfuscated);
+ obj.authenticationPrivateKeyObfuscated = message.authenticationPrivateKeyObfuscated;
}
if (message.externalSecret !== undefined) {
- DataSourceExternalSecret.encode(message.externalSecret, writer.uint32(90).fork()).join();
+ obj.externalSecret = DataSourceExternalSecret.toJSON(message.externalSecret);
}
if (message.authenticationType !== DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
- writer.uint32(96).int32(dataSourceOptions_AuthenticationTypeToNumber(message.authenticationType));
+ obj.authenticationType = dataSourceOptions_AuthenticationTypeToJSON(message.authenticationType);
}
if (message.clientSecretCredential !== undefined) {
- DataSourceOptions_ClientSecretCredential.encode(message.clientSecretCredential, writer.uint32(210).fork()).join();
+ obj.clientSecretCredential = DataSourceOptions_ClientSecretCredential.toJSON(message.clientSecretCredential);
}
if (message.saslConfig !== undefined) {
- SASLConfig.encode(message.saslConfig, writer.uint32(106).fork()).join();
+ obj.saslConfig = SASLConfig.toJSON(message.saslConfig);
}
- for (const v of message.additionalAddresses) {
- DataSourceOptions_Address.encode(v!, writer.uint32(114).fork()).join();
+ if (message.additionalAddresses?.length) {
+ obj.additionalAddresses = message.additionalAddresses.map((e) => DataSourceOptions_Address.toJSON(e));
}
if (message.replicaSet !== "") {
- writer.uint32(122).string(message.replicaSet);
+ obj.replicaSet = message.replicaSet;
}
if (message.directConnection !== false) {
- writer.uint32(128).bool(message.directConnection);
+ obj.directConnection = message.directConnection;
}
if (message.region !== "") {
- writer.uint32(138).string(message.region);
+ obj.region = message.region;
}
if (message.warehouseId !== "") {
- writer.uint32(154).string(message.warehouseId);
+ obj.warehouseId = message.warehouseId;
}
if (message.masterName !== "") {
- writer.uint32(162).string(message.masterName);
+ obj.masterName = message.masterName;
}
if (message.masterUsername !== "") {
- writer.uint32(170).string(message.masterUsername);
+ obj.masterUsername = message.masterUsername;
}
if (message.masterObfuscatedPassword !== "") {
- writer.uint32(178).string(message.masterObfuscatedPassword);
+ obj.masterObfuscatedPassword = message.masterObfuscatedPassword;
}
if (message.redisType !== DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED) {
- writer.uint32(184).int32(dataSourceOptions_RedisTypeToNumber(message.redisType));
+ obj.redisType = dataSourceOptions_RedisTypeToJSON(message.redisType);
}
if (message.useSsl !== false) {
- writer.uint32(192).bool(message.useSsl);
+ obj.useSsl = message.useSsl;
}
if (message.cluster !== "") {
- writer.uint32(202).string(message.cluster);
+ obj.cluster = message.cluster;
+ }
+ if (message.extraConnectionParameters) {
+ const entries = Object.entries(message.extraConnectionParameters);
+ if (entries.length > 0) {
+ obj.extraConnectionParameters = {};
+ entries.forEach(([k, v]) => {
+ obj.extraConnectionParameters[k] = v;
+ });
+ }
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<DataSourceOptions>): DataSourceOptions {
+ return DataSourceOptions.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<DataSourceOptions>): DataSourceOptions {
+ const message = createBaseDataSourceOptions();
+ message.id = object.id ?? "";
+ message.type = object.type ?? DataSourceType.DATA_SOURCE_UNSPECIFIED;
+ message.host = object.host ?? "";
+ message.port = object.port ?? "";
+ message.username = object.username ?? "";
+ message.obfuscatedPassword = object.obfuscatedPassword ?? "";
+ message.database = object.database ?? "";
+ message.obfuscatedSslKey = object.obfuscatedSslKey ?? "";
+ message.obfuscatedSslCert = object.obfuscatedSslCert ?? "";
+ message.obfuscatedSslCa = object.obfuscatedSslCa ?? "";
+ message.srv = object.srv ?? false;
+ message.authenticationDatabase = object.authenticationDatabase ?? "";
+ message.sid = object.sid ?? "";
+ message.serviceName = object.serviceName ?? "";
+ message.sshHost = object.sshHost ?? "";
+ message.sshPort = object.sshPort ?? "";
+ message.sshUser = object.sshUser ?? "";
+ message.sshObfuscatedPassword = object.sshObfuscatedPassword ?? "";
+ message.sshObfuscatedPrivateKey = object.sshObfuscatedPrivateKey ?? "";
+ message.authenticationPrivateKeyObfuscated = object.authenticationPrivateKeyObfuscated ?? "";
+ message.externalSecret = (object.externalSecret !== undefined && object.externalSecret !== null)
+ ? DataSourceExternalSecret.fromPartial(object.externalSecret)
+ : undefined;
+ message.authenticationType = object.authenticationType ??
+ DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
+ message.clientSecretCredential =
+ (object.clientSecretCredential !== undefined && object.clientSecretCredential !== null)
+ ? DataSourceOptions_ClientSecretCredential.fromPartial(object.clientSecretCredential)
+ : undefined;
+ message.saslConfig = (object.saslConfig !== undefined && object.saslConfig !== null)
+ ? SASLConfig.fromPartial(object.saslConfig)
+ : undefined;
+ message.additionalAddresses = object.additionalAddresses?.map((e) => DataSourceOptions_Address.fromPartial(e)) ||
+ [];
+ message.replicaSet = object.replicaSet ?? "";
+ message.directConnection = object.directConnection ?? false;
+ message.region = object.region ?? "";
+ message.warehouseId = object.warehouseId ?? "";
+ message.masterName = object.masterName ?? "";
+ message.masterUsername = object.masterUsername ?? "";
+ message.masterObfuscatedPassword = object.masterObfuscatedPassword ?? "";
+ message.redisType = object.redisType ?? DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED;
+ message.useSsl = object.useSsl ?? false;
+ message.cluster = object.cluster ?? "";
+ message.extraConnectionParameters = Object.entries(object.extraConnectionParameters ?? {}).reduce<
+ { [key: string]: string }
+ >((acc, [key, value]) => {
+ if (value !== undefined) {
+ acc[key] = globalThis.String(value);
+ }
+ return acc;
+ }, {});
+ return message;
+ },
+};
+
+function createBaseDataSourceOptions_ClientSecretCredential(): DataSourceOptions_ClientSecretCredential {
+ return { tenantId: "", clientId: "", clientSecret: "" };
+}
+
+export const DataSourceOptions_ClientSecretCredential: MessageFns<DataSourceOptions_ClientSecretCredential> = {
+ encode(message: DataSourceOptions_ClientSecretCredential, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.tenantId !== "") {
+ writer.uint32(10).string(message.tenantId);
+ }
+ if (message.clientId !== "") {
+ writer.uint32(18).string(message.clientId);
+ }
+ if (message.clientSecret !== "") {
+ writer.uint32(26).string(message.clientSecret);
}
- Object.entries(message.extraConnectionParameters).forEach(([key, value]) => {
- DataSourceOptions_ExtraConnectionParametersEntry.encode({ key: key as any, value }, writer.uint32(218).fork())
- .join();
- });
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions {
+ decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions_ClientSecretCredential {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceOptions();
+ const message = createBaseDataSourceOptions_ClientSecretCredential();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
- if (tag !== 8) {
- break;
- }
-
- message.srv = reader.bool();
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.authenticationDatabase = reader.string();
- continue;
- }
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.sid = reader.string();
- continue;
- }
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.serviceName = reader.string();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.sshHost = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.sshPort = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.sshUser = reader.string();
- continue;
- }
- case 8: {
- if (tag !== 66) {
- break;
- }
-
- message.sshObfuscatedPassword = reader.string();
- continue;
- }
- case 9: {
- if (tag !== 74) {
- break;
- }
-
- message.sshObfuscatedPrivateKey = reader.string();
- continue;
- }
- case 10: {
- if (tag !== 82) {
- break;
- }
-
- message.authenticationPrivateKeyObfuscated = reader.string();
- continue;
- }
- case 11: {
- if (tag !== 90) {
+ if (tag !== 10) {
break;
}
- message.externalSecret = DataSourceExternalSecret.decode(reader, reader.uint32());
+ message.tenantId = reader.string();
continue;
}
- case 12: {
- if (tag !== 96) {
+ case 2: {
+ if (tag !== 18) {
break;
}
- message.authenticationType = dataSourceOptions_AuthenticationTypeFromJSON(reader.int32());
+ message.clientId = reader.string();
continue;
}
- case 26: {
- if (tag !== 210) {
+ case 3: {
+ if (tag !== 26) {
break;
}
- message.clientSecretCredential = DataSourceOptions_ClientSecretCredential.decode(reader, reader.uint32());
+ message.clientSecret = reader.string();
continue;
}
- case 13: {
- if (tag !== 106) {
- break;
- }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
- message.saslConfig = SASLConfig.decode(reader, reader.uint32());
- continue;
- }
- case 14: {
- if (tag !== 114) {
- break;
- }
+ fromJSON(object: any): DataSourceOptions_ClientSecretCredential {
+ return {
+ tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
+ clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
+ clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
+ };
+ },
- message.additionalAddresses.push(DataSourceOptions_Address.decode(reader, reader.uint32()));
- continue;
- }
- case 15: {
- if (tag !== 122) {
- break;
- }
+ toJSON(message: DataSourceOptions_ClientSecretCredential): unknown {
+ const obj: any = {};
+ if (message.tenantId !== "") {
+ obj.tenantId = message.tenantId;
+ }
+ if (message.clientId !== "") {
+ obj.clientId = message.clientId;
+ }
+ if (message.clientSecret !== "") {
+ obj.clientSecret = message.clientSecret;
+ }
+ return obj;
+ },
- message.replicaSet = reader.string();
- continue;
- }
- case 16: {
- if (tag !== 128) {
- break;
- }
+ create(base?: DeepPartial<DataSourceOptions_ClientSecretCredential>): DataSourceOptions_ClientSecretCredential {
+ return DataSourceOptions_ClientSecretCredential.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<DataSourceOptions_ClientSecretCredential>): DataSourceOptions_ClientSecretCredential {
+ const message = createBaseDataSourceOptions_ClientSecretCredential();
+ message.tenantId = object.tenantId ?? "";
+ message.clientId = object.clientId ?? "";
+ message.clientSecret = object.clientSecret ?? "";
+ return message;
+ },
+};
- message.directConnection = reader.bool();
- continue;
- }
- case 17: {
- if (tag !== 138) {
- break;
- }
+function createBaseDataSourceOptions_Address(): DataSourceOptions_Address {
+ return { host: "", port: "" };
+}
- message.region = reader.string();
- continue;
- }
- case 19: {
- if (tag !== 154) {
- break;
- }
+export const DataSourceOptions_Address: MessageFns<DataSourceOptions_Address> = {
+ encode(message: DataSourceOptions_Address, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.host !== "") {
+ writer.uint32(10).string(message.host);
+ }
+ if (message.port !== "") {
+ writer.uint32(18).string(message.port);
+ }
+ return writer;
+ },
- message.warehouseId = reader.string();
- continue;
- }
- case 20: {
- if (tag !== 162) {
+ decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions_Address {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDataSourceOptions_Address();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
break;
}
- message.masterName = reader.string();
+ message.host = reader.string();
continue;
}
- case 21: {
- if (tag !== 170) {
+ case 2: {
+ if (tag !== 18) {
break;
}
- message.masterUsername = reader.string();
+ message.port = reader.string();
continue;
}
- case 22: {
- if (tag !== 178) {
- break;
- }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
- message.masterObfuscatedPassword = reader.string();
- continue;
- }
- case 23: {
- if (tag !== 184) {
+ fromJSON(object: any): DataSourceOptions_Address {
+ return {
+ host: isSet(object.host) ? globalThis.String(object.host) : "",
+ port: isSet(object.port) ? globalThis.String(object.port) : "",
+ };
+ },
+
+ toJSON(message: DataSourceOptions_Address): unknown {
+ const obj: any = {};
+ if (message.host !== "") {
+ obj.host = message.host;
+ }
+ if (message.port !== "") {
+ obj.port = message.port;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<DataSourceOptions_Address>): DataSourceOptions_Address {
+ return DataSourceOptions_Address.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<DataSourceOptions_Address>): DataSourceOptions_Address {
+ const message = createBaseDataSourceOptions_Address();
+ message.host = object.host ?? "";
+ message.port = object.port ?? "";
+ return message;
+ },
+};
+
+function createBaseDataSourceOptions_ExtraConnectionParametersEntry(): DataSourceOptions_ExtraConnectionParametersEntry {
+ return { key: "", value: "" };
+}
+
+export const DataSourceOptions_ExtraConnectionParametersEntry: MessageFns<
+ DataSourceOptions_ExtraConnectionParametersEntry
+> = {
+ encode(
+ message: DataSourceOptions_ExtraConnectionParametersEntry,
+ writer: BinaryWriter = new BinaryWriter(),
+ ): BinaryWriter {
+ if (message.key !== "") {
+ writer.uint32(10).string(message.key);
+ }
+ if (message.value !== "") {
+ writer.uint32(18).string(message.value);
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions_ExtraConnectionParametersEntry {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDataSourceOptions_ExtraConnectionParametersEntry();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
break;
}
- message.redisType = dataSourceOptions_RedisTypeFromJSON(reader.int32());
+ message.key = reader.string();
continue;
}
- case 24: {
- if (tag !== 192) {
+ case 2: {
+ if (tag !== 18) {
break;
}
- message.useSsl = reader.bool();
+ message.value = reader.string();
continue;
}
- case 25: {
- if (tag !== 202) {
- break;
- }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): DataSourceOptions_ExtraConnectionParametersEntry {
+ return {
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
+ };
+ },
+
+ toJSON(message: DataSourceOptions_ExtraConnectionParametersEntry): unknown {
+ const obj: any = {};
+ if (message.key !== "") {
+ obj.key = message.key;
+ }
+ if (message.value !== "") {
+ obj.value = message.value;
+ }
+ return obj;
+ },
+
+ create(
+ base?: DeepPartial<DataSourceOptions_ExtraConnectionParametersEntry>,
+ ): DataSourceOptions_ExtraConnectionParametersEntry {
+ return DataSourceOptions_ExtraConnectionParametersEntry.fromPartial(base ?? {});
+ },
+ fromPartial(
+ object: DeepPartial<DataSourceOptions_ExtraConnectionParametersEntry>,
+ ): DataSourceOptions_ExtraConnectionParametersEntry {
+ const message = createBaseDataSourceOptions_ExtraConnectionParametersEntry();
+ message.key = object.key ?? "";
+ message.value = object.value ?? "";
+ return message;
+ },
+};
+
+function createBaseSASLConfig(): SASLConfig {
+ return { krbConfig: undefined };
+}
+
+export const SASLConfig: MessageFns<SASLConfig> = {
+ encode(message: SASLConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.krbConfig !== undefined) {
+ KerberosConfig.encode(message.krbConfig, writer.uint32(10).fork()).join();
+ }
+ return writer;
+ },
- message.cluster = reader.string();
- continue;
- }
- case 27: {
- if (tag !== 218) {
+ decode(input: BinaryReader | Uint8Array, length?: number): SASLConfig {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSASLConfig();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
break;
}
- const entry27 = DataSourceOptions_ExtraConnectionParametersEntry.decode(reader, reader.uint32());
- if (entry27.value !== undefined) {
- message.extraConnectionParameters[entry27.key] = entry27.value;
- }
+ message.krbConfig = KerberosConfig.decode(reader, reader.uint32());
continue;
}
}
@@ -1078,222 +1490,72 @@ export const DataSourceOptions: MessageFns<DataSourceOptions> = {
return message;
},
- fromJSON(object: any): DataSourceOptions {
- return {
- srv: isSet(object.srv) ? globalThis.Boolean(object.srv) : false,
- authenticationDatabase: isSet(object.authenticationDatabase)
- ? globalThis.String(object.authenticationDatabase)
- : "",
- sid: isSet(object.sid) ? globalThis.String(object.sid) : "",
- serviceName: isSet(object.serviceName) ? globalThis.String(object.serviceName) : "",
- sshHost: isSet(object.sshHost) ? globalThis.String(object.sshHost) : "",
- sshPort: isSet(object.sshPort) ? globalThis.String(object.sshPort) : "",
- sshUser: isSet(object.sshUser) ? globalThis.String(object.sshUser) : "",
- sshObfuscatedPassword: isSet(object.sshObfuscatedPassword) ? globalThis.String(object.sshObfuscatedPassword) : "",
- sshObfuscatedPrivateKey: isSet(object.sshObfuscatedPrivateKey)
- ? globalThis.String(object.sshObfuscatedPrivateKey)
- : "",
- authenticationPrivateKeyObfuscated: isSet(object.authenticationPrivateKeyObfuscated)
- ? globalThis.String(object.authenticationPrivateKeyObfuscated)
- : "",
- externalSecret: isSet(object.externalSecret)
- ? DataSourceExternalSecret.fromJSON(object.externalSecret)
- : undefined,
- authenticationType: isSet(object.authenticationType)
- ? dataSourceOptions_AuthenticationTypeFromJSON(object.authenticationType)
- : DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED,
- clientSecretCredential: isSet(object.clientSecretCredential)
- ? DataSourceOptions_ClientSecretCredential.fromJSON(object.clientSecretCredential)
- : undefined,
- saslConfig: isSet(object.saslConfig) ? SASLConfig.fromJSON(object.saslConfig) : undefined,
- additionalAddresses: globalThis.Array.isArray(object?.additionalAddresses)
- ? object.additionalAddresses.map((e: any) => DataSourceOptions_Address.fromJSON(e))
- : [],
- replicaSet: isSet(object.replicaSet) ? globalThis.String(object.replicaSet) : "",
- directConnection: isSet(object.directConnection) ? globalThis.Boolean(object.directConnection) : false,
- region: isSet(object.region) ? globalThis.String(object.region) : "",
- warehouseId: isSet(object.warehouseId) ? globalThis.String(object.warehouseId) : "",
- masterName: isSet(object.masterName) ? globalThis.String(object.masterName) : "",
- masterUsername: isSet(object.masterUsername) ? globalThis.String(object.masterUsername) : "",
- masterObfuscatedPassword: isSet(object.masterObfuscatedPassword)
- ? globalThis.String(object.masterObfuscatedPassword)
- : "",
- redisType: isSet(object.redisType)
- ? dataSourceOptions_RedisTypeFromJSON(object.redisType)
- : DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED,
- useSsl: isSet(object.useSsl) ? globalThis.Boolean(object.useSsl) : false,
- cluster: isSet(object.cluster) ? globalThis.String(object.cluster) : "",
- extraConnectionParameters: isObject(object.extraConnectionParameters)
- ? Object.entries(object.extraConnectionParameters).reduce<{ [key: string]: string }>((acc, [key, value]) => {
- acc[key] = String(value);
- return acc;
- }, {})
- : {},
- };
+ fromJSON(object: any): SASLConfig {
+ return { krbConfig: isSet(object.krbConfig) ? KerberosConfig.fromJSON(object.krbConfig) : undefined };
},
- toJSON(message: DataSourceOptions): unknown {
+ toJSON(message: SASLConfig): unknown {
const obj: any = {};
- if (message.srv !== false) {
- obj.srv = message.srv;
- }
- if (message.authenticationDatabase !== "") {
- obj.authenticationDatabase = message.authenticationDatabase;
- }
- if (message.sid !== "") {
- obj.sid = message.sid;
- }
- if (message.serviceName !== "") {
- obj.serviceName = message.serviceName;
- }
- if (message.sshHost !== "") {
- obj.sshHost = message.sshHost;
- }
- if (message.sshPort !== "") {
- obj.sshPort = message.sshPort;
- }
- if (message.sshUser !== "") {
- obj.sshUser = message.sshUser;
- }
- if (message.sshObfuscatedPassword !== "") {
- obj.sshObfuscatedPassword = message.sshObfuscatedPassword;
- }
- if (message.sshObfuscatedPrivateKey !== "") {
- obj.sshObfuscatedPrivateKey = message.sshObfuscatedPrivateKey;
- }
- if (message.authenticationPrivateKeyObfuscated !== "") {
- obj.authenticationPrivateKeyObfuscated = message.authenticationPrivateKeyObfuscated;
- }
- if (message.externalSecret !== undefined) {
- obj.externalSecret = DataSourceExternalSecret.toJSON(message.externalSecret);
- }
- if (message.authenticationType !== DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED) {
- obj.authenticationType = dataSourceOptions_AuthenticationTypeToJSON(message.authenticationType);
- }
- if (message.clientSecretCredential !== undefined) {
- obj.clientSecretCredential = DataSourceOptions_ClientSecretCredential.toJSON(message.clientSecretCredential);
- }
- if (message.saslConfig !== undefined) {
- obj.saslConfig = SASLConfig.toJSON(message.saslConfig);
- }
- if (message.additionalAddresses?.length) {
- obj.additionalAddresses = message.additionalAddresses.map((e) => DataSourceOptions_Address.toJSON(e));
- }
- if (message.replicaSet !== "") {
- obj.replicaSet = message.replicaSet;
- }
- if (message.directConnection !== false) {
- obj.directConnection = message.directConnection;
- }
- if (message.region !== "") {
- obj.region = message.region;
- }
- if (message.warehouseId !== "") {
- obj.warehouseId = message.warehouseId;
- }
- if (message.masterName !== "") {
- obj.masterName = message.masterName;
- }
- if (message.masterUsername !== "") {
- obj.masterUsername = message.masterUsername;
- }
- if (message.masterObfuscatedPassword !== "") {
- obj.masterObfuscatedPassword = message.masterObfuscatedPassword;
- }
- if (message.redisType !== DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED) {
- obj.redisType = dataSourceOptions_RedisTypeToJSON(message.redisType);
- }
- if (message.useSsl !== false) {
- obj.useSsl = message.useSsl;
- }
- if (message.cluster !== "") {
- obj.cluster = message.cluster;
- }
- if (message.extraConnectionParameters) {
- const entries = Object.entries(message.extraConnectionParameters);
- if (entries.length > 0) {
- obj.extraConnectionParameters = {};
- entries.forEach(([k, v]) => {
- obj.extraConnectionParameters[k] = v;
- });
- }
+ if (message.krbConfig !== undefined) {
+ obj.krbConfig = KerberosConfig.toJSON(message.krbConfig);
}
return obj;
},
- create(base?: DeepPartial<DataSourceOptions>): DataSourceOptions {
- return DataSourceOptions.fromPartial(base ?? {});
+ create(base?: DeepPartial<SASLConfig>): SASLConfig {
+ return SASLConfig.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<DataSourceOptions>): DataSourceOptions {
- const message = createBaseDataSourceOptions();
- message.srv = object.srv ?? false;
- message.authenticationDatabase = object.authenticationDatabase ?? "";
- message.sid = object.sid ?? "";
- message.serviceName = object.serviceName ?? "";
- message.sshHost = object.sshHost ?? "";
- message.sshPort = object.sshPort ?? "";
- message.sshUser = object.sshUser ?? "";
- message.sshObfuscatedPassword = object.sshObfuscatedPassword ?? "";
- message.sshObfuscatedPrivateKey = object.sshObfuscatedPrivateKey ?? "";
- message.authenticationPrivateKeyObfuscated = object.authenticationPrivateKeyObfuscated ?? "";
- message.externalSecret = (object.externalSecret !== undefined && object.externalSecret !== null)
- ? DataSourceExternalSecret.fromPartial(object.externalSecret)
- : undefined;
- message.authenticationType = object.authenticationType ??
- DataSourceOptions_AuthenticationType.AUTHENTICATION_UNSPECIFIED;
- message.clientSecretCredential =
- (object.clientSecretCredential !== undefined && object.clientSecretCredential !== null)
- ? DataSourceOptions_ClientSecretCredential.fromPartial(object.clientSecretCredential)
- : undefined;
- message.saslConfig = (object.saslConfig !== undefined && object.saslConfig !== null)
- ? SASLConfig.fromPartial(object.saslConfig)
+ fromPartial(object: DeepPartial<SASLConfig>): SASLConfig {
+ const message = createBaseSASLConfig();
+ message.krbConfig = (object.krbConfig !== undefined && object.krbConfig !== null)
+ ? KerberosConfig.fromPartial(object.krbConfig)
: undefined;
- message.additionalAddresses = object.additionalAddresses?.map((e) => DataSourceOptions_Address.fromPartial(e)) ||
- [];
- message.replicaSet = object.replicaSet ?? "";
- message.directConnection = object.directConnection ?? false;
- message.region = object.region ?? "";
- message.warehouseId = object.warehouseId ?? "";
- message.masterName = object.masterName ?? "";
- message.masterUsername = object.masterUsername ?? "";
- message.masterObfuscatedPassword = object.masterObfuscatedPassword ?? "";
- message.redisType = object.redisType ?? DataSourceOptions_RedisType.REDIS_TYPE_UNSPECIFIED;
- message.useSsl = object.useSsl ?? false;
- message.cluster = object.cluster ?? "";
- message.extraConnectionParameters = Object.entries(object.extraConnectionParameters ?? {}).reduce<
- { [key: string]: string }
- >((acc, [key, value]) => {
- if (value !== undefined) {
- acc[key] = globalThis.String(value);
- }
- return acc;
- }, {});
return message;
},
};
-function createBaseDataSourceOptions_ClientSecretCredential(): DataSourceOptions_ClientSecretCredential {
- return { tenantId: "", clientId: "", clientSecret: "" };
+function createBaseKerberosConfig(): KerberosConfig {
+ return {
+ primary: "",
+ instance: "",
+ realm: "",
+ keytab: new Uint8Array(0),
+ kdcHost: "",
+ kdcPort: "",
+ kdcTransportProtocol: "",
+ };
}
-export const DataSourceOptions_ClientSecretCredential: MessageFns<DataSourceOptions_ClientSecretCredential> = {
- encode(message: DataSourceOptions_ClientSecretCredential, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.tenantId !== "") {
- writer.uint32(10).string(message.tenantId);
+export const KerberosConfig: MessageFns<KerberosConfig> = {
+ encode(message: KerberosConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.primary !== "") {
+ writer.uint32(10).string(message.primary);
}
- if (message.clientId !== "") {
- writer.uint32(18).string(message.clientId);
+ if (message.instance !== "") {
+ writer.uint32(18).string(message.instance);
}
- if (message.clientSecret !== "") {
- writer.uint32(26).string(message.clientSecret);
+ if (message.realm !== "") {
+ writer.uint32(26).string(message.realm);
+ }
+ if (message.keytab.length !== 0) {
+ writer.uint32(34).bytes(message.keytab);
+ }
+ if (message.kdcHost !== "") {
+ writer.uint32(42).string(message.kdcHost);
+ }
+ if (message.kdcPort !== "") {
+ writer.uint32(50).string(message.kdcPort);
+ }
+ if (message.kdcTransportProtocol !== "") {
+ writer.uint32(58).string(message.kdcTransportProtocol);
}
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions_ClientSecretCredential {
+ decode(input: BinaryReader | Uint8Array, length?: number): KerberosConfig {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceOptions_ClientSecretCredential();
+ const message = createBaseKerberosConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -1302,7 +1564,7 @@ export const DataSourceOptions_ClientSecretCredential: MessageFns<DataSourceOpti
break;
}
- message.tenantId = reader.string();
+ message.primary = reader.string();
continue;
}
case 2: {
@@ -1310,7 +1572,7 @@ export const DataSourceOptions_ClientSecretCredential: MessageFns<DataSourceOpti
break;
}
- message.clientId = reader.string();
+ message.instance = reader.string();
continue;
}
case 3: {
@@ -1318,88 +1580,39 @@ export const DataSourceOptions_ClientSecretCredential: MessageFns<DataSourceOpti
break;
}
- message.clientSecret = reader.string();
+ message.realm = reader.string();
continue;
}
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSourceOptions_ClientSecretCredential {
- return {
- tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "",
- clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
- clientSecret: isSet(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
- };
- },
-
- toJSON(message: DataSourceOptions_ClientSecretCredential): unknown {
- const obj: any = {};
- if (message.tenantId !== "") {
- obj.tenantId = message.tenantId;
- }
- if (message.clientId !== "") {
- obj.clientId = message.clientId;
- }
- if (message.clientSecret !== "") {
- obj.clientSecret = message.clientSecret;
- }
- return obj;
- },
-
- create(base?: DeepPartial<DataSourceOptions_ClientSecretCredential>): DataSourceOptions_ClientSecretCredential {
- return DataSourceOptions_ClientSecretCredential.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<DataSourceOptions_ClientSecretCredential>): DataSourceOptions_ClientSecretCredential {
- const message = createBaseDataSourceOptions_ClientSecretCredential();
- message.tenantId = object.tenantId ?? "";
- message.clientId = object.clientId ?? "";
- message.clientSecret = object.clientSecret ?? "";
- return message;
- },
-};
-
-function createBaseDataSourceOptions_Address(): DataSourceOptions_Address {
- return { host: "", port: "" };
-}
+ case 4: {
+ if (tag !== 34) {
+ break;
+ }
-export const DataSourceOptions_Address: MessageFns<DataSourceOptions_Address> = {
- encode(message: DataSourceOptions_Address, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.host !== "") {
- writer.uint32(10).string(message.host);
- }
- if (message.port !== "") {
- writer.uint32(18).string(message.port);
- }
- return writer;
- },
+ message.keytab = reader.bytes();
+ continue;
+ }
+ case 5: {
+ if (tag !== 42) {
+ break;
+ }
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions_Address {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceOptions_Address();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
+ message.kdcHost = reader.string();
+ continue;
+ }
+ case 6: {
+ if (tag !== 50) {
break;
}
- message.host = reader.string();
+ message.kdcPort = reader.string();
continue;
}
- case 2: {
- if (tag !== 18) {
+ case 7: {
+ if (tag !== 58) {
break;
}
- message.port = reader.string();
+ message.kdcTransportProtocol = reader.string();
continue;
}
}
@@ -1411,68 +1624,115 @@ export const DataSourceOptions_Address: MessageFns<DataSourceOptions_Address> =
return message;
},
- fromJSON(object: any): DataSourceOptions_Address {
+ fromJSON(object: any): KerberosConfig {
return {
- host: isSet(object.host) ? globalThis.String(object.host) : "",
- port: isSet(object.port) ? globalThis.String(object.port) : "",
+ primary: isSet(object.primary) ? globalThis.String(object.primary) : "",
+ instance: isSet(object.instance) ? globalThis.String(object.instance) : "",
+ realm: isSet(object.realm) ? globalThis.String(object.realm) : "",
+ keytab: isSet(object.keytab) ? bytesFromBase64(object.keytab) : new Uint8Array(0),
+ kdcHost: isSet(object.kdcHost) ? globalThis.String(object.kdcHost) : "",
+ kdcPort: isSet(object.kdcPort) ? globalThis.String(object.kdcPort) : "",
+ kdcTransportProtocol: isSet(object.kdcTransportProtocol) ? globalThis.String(object.kdcTransportProtocol) : "",
};
},
- toJSON(message: DataSourceOptions_Address): unknown {
+ toJSON(message: KerberosConfig): unknown {
const obj: any = {};
- if (message.host !== "") {
- obj.host = message.host;
+ if (message.primary !== "") {
+ obj.primary = message.primary;
}
- if (message.port !== "") {
- obj.port = message.port;
+ if (message.instance !== "") {
+ obj.instance = message.instance;
+ }
+ if (message.realm !== "") {
+ obj.realm = message.realm;
+ }
+ if (message.keytab.length !== 0) {
+ obj.keytab = base64FromBytes(message.keytab);
+ }
+ if (message.kdcHost !== "") {
+ obj.kdcHost = message.kdcHost;
+ }
+ if (message.kdcPort !== "") {
+ obj.kdcPort = message.kdcPort;
+ }
+ if (message.kdcTransportProtocol !== "") {
+ obj.kdcTransportProtocol = message.kdcTransportProtocol;
}
return obj;
},
- create(base?: DeepPartial<DataSourceOptions_Address>): DataSourceOptions_Address {
- return DataSourceOptions_Address.fromPartial(base ?? {});
+ create(base?: DeepPartial<KerberosConfig>): KerberosConfig {
+ return KerberosConfig.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<DataSourceOptions_Address>): DataSourceOptions_Address {
- const message = createBaseDataSourceOptions_Address();
- message.host = object.host ?? "";
- message.port = object.port ?? "";
+ fromPartial(object: DeepPartial<KerberosConfig>): KerberosConfig {
+ const message = createBaseKerberosConfig();
+ message.primary = object.primary ?? "";
+ message.instance = object.instance ?? "";
+ message.realm = object.realm ?? "";
+ message.keytab = object.keytab ?? new Uint8Array(0);
+ message.kdcHost = object.kdcHost ?? "";
+ message.kdcPort = object.kdcPort ?? "";
+ message.kdcTransportProtocol = object.kdcTransportProtocol ?? "";
return message;
},
};
-function createBaseDataSourceOptions_ExtraConnectionParametersEntry(): DataSourceOptions_ExtraConnectionParametersEntry {
- return { key: "", value: "" };
+function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
+ return {
+ secretType: DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
+ url: "",
+ authType: DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
+ appRole: undefined,
+ token: undefined,
+ engineName: "",
+ secretName: "",
+ passwordKeyName: "",
+ };
}
-export const DataSourceOptions_ExtraConnectionParametersEntry: MessageFns<
- DataSourceOptions_ExtraConnectionParametersEntry
-> = {
- encode(
- message: DataSourceOptions_ExtraConnectionParametersEntry,
- writer: BinaryWriter = new BinaryWriter(),
- ): BinaryWriter {
- if (message.key !== "") {
- writer.uint32(10).string(message.key);
+export const DataSourceExternalSecret: MessageFns<DataSourceExternalSecret> = {
+ encode(message: DataSourceExternalSecret, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
+ writer.uint32(8).int32(dataSourceExternalSecret_SecretTypeToNumber(message.secretType));
}
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
+ if (message.url !== "") {
+ writer.uint32(18).string(message.url);
+ }
+ if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(dataSourceExternalSecret_AuthTypeToNumber(message.authType));
+ }
+ if (message.appRole !== undefined) {
+ DataSourceExternalSecret_AppRoleAuthOption.encode(message.appRole, writer.uint32(34).fork()).join();
+ }
+ if (message.token !== undefined) {
+ writer.uint32(42).string(message.token);
+ }
+ if (message.engineName !== "") {
+ writer.uint32(50).string(message.engineName);
+ }
+ if (message.secretName !== "") {
+ writer.uint32(58).string(message.secretName);
+ }
+ if (message.passwordKeyName !== "") {
+ writer.uint32(66).string(message.passwordKeyName);
}
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): DataSourceOptions_ExtraConnectionParametersEntry {
+ decode(input: BinaryReader | Uint8Array, length?: number): DataSourceExternalSecret {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseDataSourceOptions_ExtraConnectionParametersEntry();
+ const message = createBaseDataSourceExternalSecret();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
- if (tag !== 10) {
+ if (tag !== 8) {
break;
}
- message.key = reader.string();
+ message.secretType = dataSourceExternalSecret_SecretTypeFromJSON(reader.int32());
continue;
}
case 2: {
@@ -1480,76 +1740,55 @@ export const DataSourceOptions_ExtraConnectionParametersEntry: MessageFns<
break;
}
- message.value = reader.string();
+ message.url = reader.string();
continue;
}
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): DataSourceOptions_ExtraConnectionParametersEntry {
- return {
- key: isSet(object.key) ? globalThis.String(object.key) : "",
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: DataSourceOptions_ExtraConnectionParametersEntry): unknown {
- const obj: any = {};
- if (message.key !== "") {
- obj.key = message.key;
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
+ case 3: {
+ if (tag !== 24) {
+ break;
+ }
- create(
- base?: DeepPartial<DataSourceOptions_ExtraConnectionParametersEntry>,
- ): DataSourceOptions_ExtraConnectionParametersEntry {
- return DataSourceOptions_ExtraConnectionParametersEntry.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<DataSourceOptions_ExtraConnectionParametersEntry>,
- ): DataSourceOptions_ExtraConnectionParametersEntry {
- const message = createBaseDataSourceOptions_ExtraConnectionParametersEntry();
- message.key = object.key ?? "";
- message.value = object.value ?? "";
- return message;
- },
-};
+ message.authType = dataSourceExternalSecret_AuthTypeFromJSON(reader.int32());
+ continue;
+ }
+ case 4: {
+ if (tag !== 34) {
+ break;
+ }
-function createBaseSASLConfig(): SASLConfig {
- return { krbConfig: undefined };
-}
+ message.appRole = DataSourceExternalSecret_AppRoleAuthOption.decode(reader, reader.uint32());
+ continue;
+ }
+ case 5: {
+ if (tag !== 42) {
+ break;
+ }
-export const SASLConfig: MessageFns<SASLConfig> = {
- encode(message: SASLConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.krbConfig !== undefined) {
- KerberosConfig.encode(message.krbConfig, writer.uint32(10).fork()).join();
- }
- return writer;
- },
+ message.token = reader.string();
+ continue;
+ }
+ case 6: {
+ if (tag !== 50) {
+ break;
+ }
- decode(input: BinaryReader | Uint8Array, length?: number): SASLConfig {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseSASLConfig();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
+ message.engineName = reader.string();
+ continue;
+ }
+ case 7: {
+ if (tag !== 58) {
break;
}
- message.krbConfig = KerberosConfig.decode(reader, reader.uint32());
+ message.secretName = reader.string();
+ continue;
+ }
+ case 8: {
+ if (tag !== 66) {
+ break;
+ }
+
+ message.passwordKeyName = reader.string();
continue;
}
}
@@ -1561,72 +1800,101 @@ export const SASLConfig: MessageFns<SASLConfig> = {
return message;
},
- fromJSON(object: any): SASLConfig {
- return { krbConfig: isSet(object.krbConfig) ? KerberosConfig.fromJSON(object.krbConfig) : undefined };
+ fromJSON(object: any): DataSourceExternalSecret {
+ return {
+ secretType: isSet(object.secretType)
+ ? dataSourceExternalSecret_SecretTypeFromJSON(object.secretType)
+ : DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED,
+ url: isSet(object.url) ? globalThis.String(object.url) : "",
+ authType: isSet(object.authType)
+ ? dataSourceExternalSecret_AuthTypeFromJSON(object.authType)
+ : DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED,
+ appRole: isSet(object.appRole) ? DataSourceExternalSecret_AppRoleAuthOption.fromJSON(object.appRole) : undefined,
+ token: isSet(object.token) ? globalThis.String(object.token) : undefined,
+ engineName: isSet(object.engineName) ? globalThis.String(object.engineName) : "",
+ secretName: isSet(object.secretName) ? globalThis.String(object.secretName) : "",
+ passwordKeyName: isSet(object.passwordKeyName) ? globalThis.String(object.passwordKeyName) : "",
+ };
},
- toJSON(message: SASLConfig): unknown {
+ toJSON(message: DataSourceExternalSecret): unknown {
const obj: any = {};
- if (message.krbConfig !== undefined) {
- obj.krbConfig = KerberosConfig.toJSON(message.krbConfig);
+ if (message.secretType !== DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED) {
+ obj.secretType = dataSourceExternalSecret_SecretTypeToJSON(message.secretType);
+ }
+ if (message.url !== "") {
+ obj.url = message.url;
+ }
+ if (message.authType !== DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED) {
+ obj.authType = dataSourceExternalSecret_AuthTypeToJSON(message.authType);
+ }
+ if (message.appRole !== undefined) {
+ obj.appRole = DataSourceExternalSecret_AppRoleAuthOption.toJSON(message.appRole);
+ }
+ if (message.token !== undefined) {
+ obj.token = message.token;
+ }
+ if (message.engineName !== "") {
+ obj.engineName = message.engineName;
+ }
+ if (message.secretName !== "") {
+ obj.secretName = message.secretName;
+ }
+ if (message.passwordKeyName !== "") {
+ obj.passwordKeyName = message.passwordKeyName;
}
return obj;
},
- create(base?: DeepPartial<SASLConfig>): SASLConfig {
- return SASLConfig.fromPartial(base ?? {});
+ create(base?: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
+ return DataSourceExternalSecret.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<SASLConfig>): SASLConfig {
- const message = createBaseSASLConfig();
- message.krbConfig = (object.krbConfig !== undefined && object.krbConfig !== null)
- ? KerberosConfig.fromPartial(object.krbConfig)
+ fromPartial(object: DeepPartial<DataSourceExternalSecret>): DataSourceExternalSecret {
+ const message = createBaseDataSourceExternalSecret();
+ message.secretType = object.secretType ?? DataSourceExternalSecret_SecretType.SAECRET_TYPE_UNSPECIFIED;
+ message.url = object.url ?? "";
+ message.authType = object.authType ?? DataSourceExternalSecret_AuthType.AUTH_TYPE_UNSPECIFIED;
+ message.appRole = (object.appRole !== undefined && object.appRole !== null)
+ ? DataSourceExternalSecret_AppRoleAuthOption.fromPartial(object.appRole)
: undefined;
+ message.token = object.token ?? undefined;
+ message.engineName = object.engineName ?? "";
+ message.secretName = object.secretName ?? "";
+ message.passwordKeyName = object.passwordKeyName ?? "";
return message;
},
};
-function createBaseKerberosConfig(): KerberosConfig {
+function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
return {
- primary: "",
- instance: "",
- realm: "",
- keytab: new Uint8Array(0),
- kdcHost: "",
- kdcPort: "",
- kdcTransportProtocol: "",
+ roleId: "",
+ secretId: "",
+ type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
+ mountPath: "",
};
}
-export const KerberosConfig: MessageFns<KerberosConfig> = {
- encode(message: KerberosConfig, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.primary !== "") {
- writer.uint32(10).string(message.primary);
- }
- if (message.instance !== "") {
- writer.uint32(18).string(message.instance);
- }
- if (message.realm !== "") {
- writer.uint32(26).string(message.realm);
- }
- if (message.keytab.length !== 0) {
- writer.uint32(34).bytes(message.keytab);
+export const DataSourceExternalSecret_AppRoleAuthOption: MessageFns<DataSourceExternalSecret_AppRoleAuthOption> = {
+ encode(message: DataSourceExternalSecret_AppRoleAuthOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.roleId !== "") {
+ writer.uint32(10).string(message.roleId);
}
- if (message.kdcHost !== "") {
- writer.uint32(42).string(message.kdcHost);
+ if (message.secretId !== "") {
+ writer.uint32(18).string(message.secretId);
}
- if (message.kdcPort !== "") {
- writer.uint32(50).string(message.kdcPort);
+ if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
+ writer.uint32(24).int32(dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToNumber(message.type));
}
- if (message.kdcTransportProtocol !== "") {
- writer.uint32(58).string(message.kdcTransportProtocol);
+ if (message.mountPath !== "") {
+ writer.uint32(34).string(message.mountPath);
}
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): KerberosConfig {
+ decode(input: BinaryReader | Uint8Array, length?: number): DataSourceExternalSecret_AppRoleAuthOption {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseKerberosConfig();
+ const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -1635,7 +1903,7 @@ export const KerberosConfig: MessageFns<KerberosConfig> = {
break;
}
- message.primary = reader.string();
+ message.roleId = reader.string();
continue;
}
case 2: {
@@ -1643,15 +1911,15 @@ export const KerberosConfig: MessageFns<KerberosConfig> = {
break;
}
- message.instance = reader.string();
+ message.secretId = reader.string();
continue;
}
case 3: {
- if (tag !== 26) {
+ if (tag !== 24) {
break;
}
- message.realm = reader.string();
+ message.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(reader.int32());
continue;
}
case 4: {
@@ -1659,31 +1927,7 @@ export const KerberosConfig: MessageFns<KerberosConfig> = {
break;
}
- message.keytab = reader.bytes();
- continue;
- }
- case 5: {
- if (tag !== 42) {
- break;
- }
-
- message.kdcHost = reader.string();
- continue;
- }
- case 6: {
- if (tag !== 50) {
- break;
- }
-
- message.kdcPort = reader.string();
- continue;
- }
- case 7: {
- if (tag !== 58) {
- break;
- }
-
- message.kdcTransportProtocol = reader.string();
+ message.mountPath = reader.string();
continue;
}
}
@@ -1695,56 +1939,45 @@ export const KerberosConfig: MessageFns<KerberosConfig> = {
return message;
},
- fromJSON(object: any): KerberosConfig {
+ fromJSON(object: any): DataSourceExternalSecret_AppRoleAuthOption {
return {
- primary: isSet(object.primary) ? globalThis.String(object.primary) : "",
- instance: isSet(object.instance) ? globalThis.String(object.instance) : "",
- realm: isSet(object.realm) ? globalThis.String(object.realm) : "",
- keytab: isSet(object.keytab) ? bytesFromBase64(object.keytab) : new Uint8Array(0),
- kdcHost: isSet(object.kdcHost) ? globalThis.String(object.kdcHost) : "",
- kdcPort: isSet(object.kdcPort) ? globalThis.String(object.kdcPort) : "",
- kdcTransportProtocol: isSet(object.kdcTransportProtocol) ? globalThis.String(object.kdcTransportProtocol) : "",
+ roleId: isSet(object.roleId) ? globalThis.String(object.roleId) : "",
+ secretId: isSet(object.secretId) ? globalThis.String(object.secretId) : "",
+ type: isSet(object.type)
+ ? dataSourceExternalSecret_AppRoleAuthOption_SecretTypeFromJSON(object.type)
+ : DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED,
+ mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
};
},
- toJSON(message: KerberosConfig): unknown {
+ toJSON(message: DataSourceExternalSecret_AppRoleAuthOption): unknown {
const obj: any = {};
- if (message.primary !== "") {
- obj.primary = message.primary;
- }
- if (message.instance !== "") {
- obj.instance = message.instance;
- }
- if (message.realm !== "") {
- obj.realm = message.realm;
- }
- if (message.keytab.length !== 0) {
- obj.keytab = base64FromBytes(message.keytab);
+ if (message.roleId !== "") {
+ obj.roleId = message.roleId;
}
- if (message.kdcHost !== "") {
- obj.kdcHost = message.kdcHost;
+ if (message.secretId !== "") {
+ obj.secretId = message.secretId;
}
- if (message.kdcPort !== "") {
- obj.kdcPort = message.kdcPort;
+ if (message.type !== DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED) {
+ obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
}
- if (message.kdcTransportProtocol !== "") {
- obj.kdcTransportProtocol = message.kdcTransportProtocol;
+ if (message.mountPath !== "") {
+ obj.mountPath = message.mountPath;
}
return obj;
},
- create(base?: DeepPartial<KerberosConfig>): KerberosConfig {
- return KerberosConfig.fromPartial(base ?? {});
+ create(base?: DeepPartial<DataSourceExternalSecret_AppRoleAuthOption>): DataSourceExternalSecret_AppRoleAuthOption {
+ return DataSourceExternalSecret_AppRoleAuthOption.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<KerberosConfig>): KerberosConfig {
- const message = createBaseKerberosConfig();
- message.primary = object.primary ?? "";
- message.instance = object.instance ?? "";
- message.realm = object.realm ?? "";
- message.keytab = object.keytab ?? new Uint8Array(0);
- message.kdcHost = object.kdcHost ?? "";
- message.kdcPort = object.kdcPort ?? "";
- message.kdcTransportProtocol = object.kdcTransportProtocol ?? "";
+ fromPartial(
+ object: DeepPartial<DataSourceExternalSecret_AppRoleAuthOption>,
+ ): DataSourceExternalSecret_AppRoleAuthOption {
+ const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
+ message.roleId = object.roleId ?? "";
+ message.secretId = object.secretId ?? "";
+ message.type = object.type ?? DataSourceExternalSecret_AppRoleAuthOption_SecretType.SECRET_TYPE_UNSPECIFIED;
+ message.mountPath = object.mountPath ?? "";
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 1f009ab2bc..bad1bd9575 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -74,6 +74,7 @@
- [DataSourceExternalSecret.SecretType](#bytebase-store-DataSourceExternalSecret-SecretType)
- [DataSourceOptions.AuthenticationType](#bytebase-store-DataSourceOptions-AuthenticationType)
- [DataSourceOptions.RedisType](#bytebase-store-DataSourceOptions-RedisType)
+ - [DataSourceType](#bytebase-store-DataSourceType)
- [store/database.proto](#store_database-proto)
- [CheckConstraintMetadata](#bytebase-store-CheckConstraintMetadata)
@@ -1154,6 +1155,16 @@ Metadata about the request.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
+| id | [string](#string) | | |
+| type | [DataSourceType](#bytebase-store-DataSourceType) | | |
+| host | [string](#string) | | |
+| port | [string](#string) | | |
+| username | [string](#string) | | |
+| obfuscated_password | [string](#string) | | |
+| database | [string](#string) | | |
+| obfuscated_ssl_key | [string](#string) | | |
+| obfuscated_ssl_cert | [string](#string) | | |
+| obfuscated_ssl_ca | [string](#string) | | |
| srv | [bool](#bool) | | srv is a boolean flag that indicates whether the host is a DNS SRV record. |
| authentication_database | [string](#string) | | authentication_database is the database name to authenticate against, which stores the user credentials. |
| sid | [string](#string) | | sid and service_name are used for Oracle. |
@@ -1341,6 +1352,19 @@ Metadata about the request.
| CLUSTER | 3 | |
+
+<a name="bytebase-store-DataSourceType"></a>
+
+### DataSourceType
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| DATA_SOURCE_UNSPECIFIED | 0 | |
+| ADMIN | 1 | |
+| READ_ONLY | 2 | |
+
+
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index ae836e434d..d93efc8a6e 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -456,6 +456,10 @@
<a href="#bytebase.store.DataSourceOptions.RedisType"><span class="badge">E</span>DataSourceOptions.RedisType</a>
</li>
+ <li>
+ <a href="#bytebase.store.DataSourceType"><span class="badge">E</span>DataSourceType</a>
+ </li>
+
</ul>
@@ -3403,6 +3407,76 @@ Format: projects/{project}/sheets/{sheet} </p></td>
</thead>
<tbody>
+ <tr>
+ <td>id</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td><a href="#bytebase.store.DataSourceType">DataSourceType</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>host</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>port</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>username</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>obfuscated_password</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>database</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>obfuscated_ssl_key</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>obfuscated_ssl_cert</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>obfuscated_ssl_ca</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
<tr>
<td>srv</td>
<td><a href="#bool">bool</a></td>
@@ -3956,6 +4030,35 @@ For PostgreSQL HA, this can be used to set target_session_attrs=read-write </p><
</tbody>
</table>
+ <h3 id="bytebase.store.DataSourceType">DataSourceType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>DATA_SOURCE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ADMIN</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>READ_ONLY</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
diff --git a/proto/generated-go/store/data_source.pb.go b/proto/generated-go/store/data_source.pb.go
index 00771cb467..d739732581 100644
--- a/proto/generated-go/store/data_source.pb.go
+++ b/proto/generated-go/store/data_source.pb.go
@@ -21,159 +21,53 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
-type DataSourceExternalSecret_SecretType int32
+type DataSourceType int32
const (
- DataSourceExternalSecret_SAECRET_TYPE_UNSPECIFIED DataSourceExternalSecret_SecretType = 0
- // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
- DataSourceExternalSecret_VAULT_KV_V2 DataSourceExternalSecret_SecretType = 1
- // ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
- DataSourceExternalSecret_AWS_SECRETS_MANAGER DataSourceExternalSecret_SecretType = 2
- // ref: https://cloud.google.com/secret-manager/docs
- DataSourceExternalSecret_GCP_SECRET_MANAGER DataSourceExternalSecret_SecretType = 3
+ DataSourceType_DATA_SOURCE_UNSPECIFIED DataSourceType = 0
+ DataSourceType_ADMIN DataSourceType = 1
+ DataSourceType_READ_ONLY DataSourceType = 2
)
-// Enum value maps for DataSourceExternalSecret_SecretType.
+// Enum value maps for DataSourceType.
var (
- DataSourceExternalSecret_SecretType_name = map[int32]string{
- 0: "SAECRET_TYPE_UNSPECIFIED",
- 1: "VAULT_KV_V2",
- 2: "AWS_SECRETS_MANAGER",
- 3: "GCP_SECRET_MANAGER",
+ DataSourceType_name = map[int32]string{
+ 0: "DATA_SOURCE_UNSPECIFIED",
+ 1: "ADMIN",
+ 2: "READ_ONLY",
}
- DataSourceExternalSecret_SecretType_value = map[string]int32{
- "SAECRET_TYPE_UNSPECIFIED": 0,
- "VAULT_KV_V2": 1,
- "AWS_SECRETS_MANAGER": 2,
- "GCP_SECRET_MANAGER": 3,
+ DataSourceType_value = map[string]int32{
+ "DATA_SOURCE_UNSPECIFIED": 0,
+ "ADMIN": 1,
+ "READ_ONLY": 2,
}
)
-func (x DataSourceExternalSecret_SecretType) Enum() *DataSourceExternalSecret_SecretType {
- p := new(DataSourceExternalSecret_SecretType)
+func (x DataSourceType) Enum() *DataSourceType {
+ p := new(DataSourceType)
*p = x
return p
}
-func (x DataSourceExternalSecret_SecretType) String() string {
+func (x DataSourceType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
-func (DataSourceExternalSecret_SecretType) Descriptor() protoreflect.EnumDescriptor {
+func (DataSourceType) Descriptor() protoreflect.EnumDescriptor {
return file_store_data_source_proto_enumTypes[0].Descriptor()
}
-func (DataSourceExternalSecret_SecretType) Type() protoreflect.EnumType {
+func (DataSourceType) Type() protoreflect.EnumType {
return &file_store_data_source_proto_enumTypes[0]
}
-func (x DataSourceExternalSecret_SecretType) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use DataSourceExternalSecret_SecretType.Descriptor instead.
-func (DataSourceExternalSecret_SecretType) EnumDescriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{0, 0}
-}
-
-type DataSourceExternalSecret_AuthType int32
-
-const (
- DataSourceExternalSecret_AUTH_TYPE_UNSPECIFIED DataSourceExternalSecret_AuthType = 0
- // ref: https://developer.hashicorp.com/vault/docs/auth/token
- DataSourceExternalSecret_TOKEN DataSourceExternalSecret_AuthType = 1
- // ref: https://developer.hashicorp.com/vault/docs/auth/approle
- DataSourceExternalSecret_VAULT_APP_ROLE DataSourceExternalSecret_AuthType = 2
-)
-
-// Enum value maps for DataSourceExternalSecret_AuthType.
-var (
- DataSourceExternalSecret_AuthType_name = map[int32]string{
- 0: "AUTH_TYPE_UNSPECIFIED",
- 1: "TOKEN",
- 2: "VAULT_APP_ROLE",
- }
- DataSourceExternalSecret_AuthType_value = map[string]int32{
- "AUTH_TYPE_UNSPECIFIED": 0,
- "TOKEN": 1,
- "VAULT_APP_ROLE": 2,
- }
-)
-
-func (x DataSourceExternalSecret_AuthType) Enum() *DataSourceExternalSecret_AuthType {
- p := new(DataSourceExternalSecret_AuthType)
- *p = x
- return p
-}
-
-func (x DataSourceExternalSecret_AuthType) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (DataSourceExternalSecret_AuthType) Descriptor() protoreflect.EnumDescriptor {
- return file_store_data_source_proto_enumTypes[1].Descriptor()
-}
-
-func (DataSourceExternalSecret_AuthType) Type() protoreflect.EnumType {
- return &file_store_data_source_proto_enumTypes[1]
-}
-
-func (x DataSourceExternalSecret_AuthType) Number() protoreflect.EnumNumber {
+func (x DataSourceType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
-// Deprecated: Use DataSourceExternalSecret_AuthType.Descriptor instead.
-func (DataSourceExternalSecret_AuthType) EnumDescriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{0, 1}
-}
-
-type DataSourceExternalSecret_AppRoleAuthOption_SecretType int32
-
-const (
- DataSourceExternalSecret_AppRoleAuthOption_SECRET_TYPE_UNSPECIFIED DataSourceExternalSecret_AppRoleAuthOption_SecretType = 0
- DataSourceExternalSecret_AppRoleAuthOption_PLAIN DataSourceExternalSecret_AppRoleAuthOption_SecretType = 1
- DataSourceExternalSecret_AppRoleAuthOption_ENVIRONMENT DataSourceExternalSecret_AppRoleAuthOption_SecretType = 2
-)
-
-// Enum value maps for DataSourceExternalSecret_AppRoleAuthOption_SecretType.
-var (
- DataSourceExternalSecret_AppRoleAuthOption_SecretType_name = map[int32]string{
- 0: "SECRET_TYPE_UNSPECIFIED",
- 1: "PLAIN",
- 2: "ENVIRONMENT",
- }
- DataSourceExternalSecret_AppRoleAuthOption_SecretType_value = map[string]int32{
- "SECRET_TYPE_UNSPECIFIED": 0,
- "PLAIN": 1,
- "ENVIRONMENT": 2,
- }
-)
-
-func (x DataSourceExternalSecret_AppRoleAuthOption_SecretType) Enum() *DataSourceExternalSecret_AppRoleAuthOption_SecretType {
- p := new(DataSourceExternalSecret_AppRoleAuthOption_SecretType)
- *p = x
- return p
-}
-
-func (x DataSourceExternalSecret_AppRoleAuthOption_SecretType) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) Descriptor() protoreflect.EnumDescriptor {
- return file_store_data_source_proto_enumTypes[2].Descriptor()
-}
-
-func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) Type() protoreflect.EnumType {
- return &file_store_data_source_proto_enumTypes[2]
-}
-
-func (x DataSourceExternalSecret_AppRoleAuthOption_SecretType) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use DataSourceExternalSecret_AppRoleAuthOption_SecretType.Descriptor instead.
-func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) EnumDescriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{0, 0, 0}
+// Deprecated: Use DataSourceType.Descriptor instead.
+func (DataSourceType) EnumDescriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{0}
}
type DataSourceOptions_AuthenticationType int32
@@ -215,11 +109,11 @@ func (x DataSourceOptions_AuthenticationType) String() string {
}
func (DataSourceOptions_AuthenticationType) Descriptor() protoreflect.EnumDescriptor {
- return file_store_data_source_proto_enumTypes[3].Descriptor()
+ return file_store_data_source_proto_enumTypes[1].Descriptor()
}
func (DataSourceOptions_AuthenticationType) Type() protoreflect.EnumType {
- return &file_store_data_source_proto_enumTypes[3]
+ return &file_store_data_source_proto_enumTypes[1]
}
func (x DataSourceOptions_AuthenticationType) Number() protoreflect.EnumNumber {
@@ -228,7 +122,7 @@ func (x DataSourceOptions_AuthenticationType) Number() protoreflect.EnumNumber {
// Deprecated: Use DataSourceOptions_AuthenticationType.Descriptor instead.
func (DataSourceOptions_AuthenticationType) EnumDescriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{1, 0}
+ return file_store_data_source_proto_rawDescGZIP(), []int{0, 0}
}
type DataSourceOptions_RedisType int32
@@ -267,11 +161,11 @@ func (x DataSourceOptions_RedisType) String() string {
}
func (DataSourceOptions_RedisType) Descriptor() protoreflect.EnumDescriptor {
- return file_store_data_source_proto_enumTypes[4].Descriptor()
+ return file_store_data_source_proto_enumTypes[2].Descriptor()
}
func (DataSourceOptions_RedisType) Type() protoreflect.EnumType {
- return &file_store_data_source_proto_enumTypes[4]
+ return &file_store_data_source_proto_enumTypes[2]
}
func (x DataSourceOptions_RedisType) Number() protoreflect.EnumNumber {
@@ -280,227 +174,329 @@ func (x DataSourceOptions_RedisType) Number() protoreflect.EnumNumber {
// Deprecated: Use DataSourceOptions_RedisType.Descriptor instead.
func (DataSourceOptions_RedisType) EnumDescriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{1, 1}
+ return file_store_data_source_proto_rawDescGZIP(), []int{0, 1}
}
-type DataSourceExternalSecret struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- SecretType DataSourceExternalSecret_SecretType `protobuf:"varint,1,opt,name=secret_type,json=secretType,proto3,enum=bytebase.store.DataSourceExternalSecret_SecretType" json:"secret_type,omitempty"`
- Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
- AuthType DataSourceExternalSecret_AuthType `protobuf:"varint,3,opt,name=auth_type,json=authType,proto3,enum=bytebase.store.DataSourceExternalSecret_AuthType" json:"auth_type,omitempty"`
- // Types that are valid to be assigned to AuthOption:
- //
- // *DataSourceExternalSecret_AppRole
- // *DataSourceExternalSecret_Token
- AuthOption isDataSourceExternalSecret_AuthOption `protobuf_oneof:"auth_option"`
- // engine name is the name for secret engine.
- EngineName string `protobuf:"bytes,6,opt,name=engine_name,json=engineName,proto3" json:"engine_name,omitempty"`
- // the secret name in the engine to store the password.
- SecretName string `protobuf:"bytes,7,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"`
- // the key name for the password.
- PasswordKeyName string `protobuf:"bytes,8,opt,name=password_key_name,json=passwordKeyName,proto3" json:"password_key_name,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
+type DataSourceExternalSecret_SecretType int32
-func (x *DataSourceExternalSecret) Reset() {
- *x = DataSourceExternalSecret{}
- mi := &file_store_data_source_proto_msgTypes[0]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
+const (
+ DataSourceExternalSecret_SAECRET_TYPE_UNSPECIFIED DataSourceExternalSecret_SecretType = 0
+ // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
+ DataSourceExternalSecret_VAULT_KV_V2 DataSourceExternalSecret_SecretType = 1
+ // ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
+ DataSourceExternalSecret_AWS_SECRETS_MANAGER DataSourceExternalSecret_SecretType = 2
+ // ref: https://cloud.google.com/secret-manager/docs
+ DataSourceExternalSecret_GCP_SECRET_MANAGER DataSourceExternalSecret_SecretType = 3
+)
-func (x *DataSourceExternalSecret) String() string {
- return protoimpl.X.MessageStringOf(x)
+// Enum value maps for DataSourceExternalSecret_SecretType.
+var (
+ DataSourceExternalSecret_SecretType_name = map[int32]string{
+ 0: "SAECRET_TYPE_UNSPECIFIED",
+ 1: "VAULT_KV_V2",
+ 2: "AWS_SECRETS_MANAGER",
+ 3: "GCP_SECRET_MANAGER",
+ }
+ DataSourceExternalSecret_SecretType_value = map[string]int32{
+ "SAECRET_TYPE_UNSPECIFIED": 0,
+ "VAULT_KV_V2": 1,
+ "AWS_SECRETS_MANAGER": 2,
+ "GCP_SECRET_MANAGER": 3,
+ }
+)
+
+func (x DataSourceExternalSecret_SecretType) Enum() *DataSourceExternalSecret_SecretType {
+ p := new(DataSourceExternalSecret_SecretType)
+ *p = x
+ return p
}
-func (*DataSourceExternalSecret) ProtoMessage() {}
+func (x DataSourceExternalSecret_SecretType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
-func (x *DataSourceExternalSecret) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[0]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
+func (DataSourceExternalSecret_SecretType) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_data_source_proto_enumTypes[3].Descriptor()
}
-// Deprecated: Use DataSourceExternalSecret.ProtoReflect.Descriptor instead.
-func (*DataSourceExternalSecret) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{0}
+func (DataSourceExternalSecret_SecretType) Type() protoreflect.EnumType {
+ return &file_store_data_source_proto_enumTypes[3]
}
-func (x *DataSourceExternalSecret) GetSecretType() DataSourceExternalSecret_SecretType {
- if x != nil {
- return x.SecretType
- }
- return DataSourceExternalSecret_SAECRET_TYPE_UNSPECIFIED
+func (x DataSourceExternalSecret_SecretType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
}
-func (x *DataSourceExternalSecret) GetUrl() string {
- if x != nil {
- return x.Url
- }
- return ""
+// Deprecated: Use DataSourceExternalSecret_SecretType.Descriptor instead.
+func (DataSourceExternalSecret_SecretType) EnumDescriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{3, 0}
}
-func (x *DataSourceExternalSecret) GetAuthType() DataSourceExternalSecret_AuthType {
- if x != nil {
- return x.AuthType
+type DataSourceExternalSecret_AuthType int32
+
+const (
+ DataSourceExternalSecret_AUTH_TYPE_UNSPECIFIED DataSourceExternalSecret_AuthType = 0
+ // ref: https://developer.hashicorp.com/vault/docs/auth/token
+ DataSourceExternalSecret_TOKEN DataSourceExternalSecret_AuthType = 1
+ // ref: https://developer.hashicorp.com/vault/docs/auth/approle
+ DataSourceExternalSecret_VAULT_APP_ROLE DataSourceExternalSecret_AuthType = 2
+)
+
+// Enum value maps for DataSourceExternalSecret_AuthType.
+var (
+ DataSourceExternalSecret_AuthType_name = map[int32]string{
+ 0: "AUTH_TYPE_UNSPECIFIED",
+ 1: "TOKEN",
+ 2: "VAULT_APP_ROLE",
}
- return DataSourceExternalSecret_AUTH_TYPE_UNSPECIFIED
+ DataSourceExternalSecret_AuthType_value = map[string]int32{
+ "AUTH_TYPE_UNSPECIFIED": 0,
+ "TOKEN": 1,
+ "VAULT_APP_ROLE": 2,
+ }
+)
+
+func (x DataSourceExternalSecret_AuthType) Enum() *DataSourceExternalSecret_AuthType {
+ p := new(DataSourceExternalSecret_AuthType)
+ *p = x
+ return p
}
-func (x *DataSourceExternalSecret) GetAuthOption() isDataSourceExternalSecret_AuthOption {
- if x != nil {
- return x.AuthOption
- }
- return nil
+func (x DataSourceExternalSecret_AuthType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
-func (x *DataSourceExternalSecret) GetAppRole() *DataSourceExternalSecret_AppRoleAuthOption {
- if x != nil {
- if x, ok := x.AuthOption.(*DataSourceExternalSecret_AppRole); ok {
- return x.AppRole
- }
- }
- return nil
+func (DataSourceExternalSecret_AuthType) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_data_source_proto_enumTypes[4].Descriptor()
}
-func (x *DataSourceExternalSecret) GetToken() string {
- if x != nil {
- if x, ok := x.AuthOption.(*DataSourceExternalSecret_Token); ok {
- return x.Token
- }
- }
- return ""
+func (DataSourceExternalSecret_AuthType) Type() protoreflect.EnumType {
+ return &file_store_data_source_proto_enumTypes[4]
}
-func (x *DataSourceExternalSecret) GetEngineName() string {
- if x != nil {
- return x.EngineName
- }
- return ""
+func (x DataSourceExternalSecret_AuthType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
}
-func (x *DataSourceExternalSecret) GetSecretName() string {
- if x != nil {
- return x.SecretName
- }
- return ""
+// Deprecated: Use DataSourceExternalSecret_AuthType.Descriptor instead.
+func (DataSourceExternalSecret_AuthType) EnumDescriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{3, 1}
}
-func (x *DataSourceExternalSecret) GetPasswordKeyName() string {
- if x != nil {
- return x.PasswordKeyName
+type DataSourceExternalSecret_AppRoleAuthOption_SecretType int32
+
+const (
+ DataSourceExternalSecret_AppRoleAuthOption_SECRET_TYPE_UNSPECIFIED DataSourceExternalSecret_AppRoleAuthOption_SecretType = 0
+ DataSourceExternalSecret_AppRoleAuthOption_PLAIN DataSourceExternalSecret_AppRoleAuthOption_SecretType = 1
+ DataSourceExternalSecret_AppRoleAuthOption_ENVIRONMENT DataSourceExternalSecret_AppRoleAuthOption_SecretType = 2
+)
+
+// Enum value maps for DataSourceExternalSecret_AppRoleAuthOption_SecretType.
+var (
+ DataSourceExternalSecret_AppRoleAuthOption_SecretType_name = map[int32]string{
+ 0: "SECRET_TYPE_UNSPECIFIED",
+ 1: "PLAIN",
+ 2: "ENVIRONMENT",
}
- return ""
+ DataSourceExternalSecret_AppRoleAuthOption_SecretType_value = map[string]int32{
+ "SECRET_TYPE_UNSPECIFIED": 0,
+ "PLAIN": 1,
+ "ENVIRONMENT": 2,
+ }
+)
+
+func (x DataSourceExternalSecret_AppRoleAuthOption_SecretType) Enum() *DataSourceExternalSecret_AppRoleAuthOption_SecretType {
+ p := new(DataSourceExternalSecret_AppRoleAuthOption_SecretType)
+ *p = x
+ return p
}
-type isDataSourceExternalSecret_AuthOption interface {
- isDataSourceExternalSecret_AuthOption()
+func (x DataSourceExternalSecret_AppRoleAuthOption_SecretType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
-type DataSourceExternalSecret_AppRole struct {
- AppRole *DataSourceExternalSecret_AppRoleAuthOption `protobuf:"bytes,4,opt,name=app_role,json=appRole,proto3,oneof"`
+func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_data_source_proto_enumTypes[5].Descriptor()
}
-type DataSourceExternalSecret_Token struct {
- Token string `protobuf:"bytes,5,opt,name=token,proto3,oneof"`
+func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) Type() protoreflect.EnumType {
+ return &file_store_data_source_proto_enumTypes[5]
}
-func (*DataSourceExternalSecret_AppRole) isDataSourceExternalSecret_AuthOption() {}
+func (x DataSourceExternalSecret_AppRoleAuthOption_SecretType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
-func (*DataSourceExternalSecret_Token) isDataSourceExternalSecret_AuthOption() {}
+// Deprecated: Use DataSourceExternalSecret_AppRoleAuthOption_SecretType.Descriptor instead.
+func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) EnumDescriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{3, 0, 0}
+}
type DataSourceOptions struct {
- state protoimpl.MessageState `protogen:"open.v1"`
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
+ Type DataSourceType `protobuf:"varint,2,opt,name=type,proto3,enum=bytebase.store.DataSourceType" json:"type,omitempty"`
+ Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"`
+ Port string `protobuf:"bytes,4,opt,name=port,proto3" json:"port,omitempty"`
+ Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"`
+ ObfuscatedPassword string `protobuf:"bytes,6,opt,name=obfuscated_password,json=obfuscatedPassword,proto3" json:"obfuscated_password,omitempty"`
+ Database string `protobuf:"bytes,7,opt,name=database,proto3" json:"database,omitempty"`
+ ObfuscatedSslKey string `protobuf:"bytes,8,opt,name=obfuscated_ssl_key,json=obfuscatedSslKey,proto3" json:"obfuscated_ssl_key,omitempty"`
+ ObfuscatedSslCert string `protobuf:"bytes,9,opt,name=obfuscated_ssl_cert,json=obfuscatedSslCert,proto3" json:"obfuscated_ssl_cert,omitempty"`
+ ObfuscatedSslCa string `protobuf:"bytes,10,opt,name=obfuscated_ssl_ca,json=obfuscatedSslCa,proto3" json:"obfuscated_ssl_ca,omitempty"`
// srv is a boolean flag that indicates whether the host is a DNS SRV record.
- Srv bool `protobuf:"varint,1,opt,name=srv,proto3" json:"srv,omitempty"`
+ Srv bool `protobuf:"varint,11,opt,name=srv,proto3" json:"srv,omitempty"`
// authentication_database is the database name to authenticate against, which stores the user credentials.
- AuthenticationDatabase string `protobuf:"bytes,2,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"`
+ AuthenticationDatabase string `protobuf:"bytes,12,opt,name=authentication_database,json=authenticationDatabase,proto3" json:"authentication_database,omitempty"`
// sid and service_name are used for Oracle.
- Sid string `protobuf:"bytes,3,opt,name=sid,proto3" json:"sid,omitempty"`
- ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
+ Sid string `protobuf:"bytes,13,opt,name=sid,proto3" json:"sid,omitempty"`
+ ServiceName string `protobuf:"bytes,14,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
// SSH related
// The hostname of the SSH server agent.
- SshHost string `protobuf:"bytes,5,opt,name=ssh_host,json=sshHost,proto3" json:"ssh_host,omitempty"`
+ SshHost string `protobuf:"bytes,15,opt,name=ssh_host,json=sshHost,proto3" json:"ssh_host,omitempty"`
// The port of the SSH server agent. It's 22 typically.
- SshPort string `protobuf:"bytes,6,opt,name=ssh_port,json=sshPort,proto3" json:"ssh_port,omitempty"`
+ SshPort string `protobuf:"bytes,16,opt,name=ssh_port,json=sshPort,proto3" json:"ssh_port,omitempty"`
// The user to login the server.
- SshUser string `protobuf:"bytes,7,opt,name=ssh_user,json=sshUser,proto3" json:"ssh_user,omitempty"`
+ SshUser string `protobuf:"bytes,17,opt,name=ssh_user,json=sshUser,proto3" json:"ssh_user,omitempty"`
// The password to login the server. If it's empty string, no password is required.
- SshObfuscatedPassword string `protobuf:"bytes,8,opt,name=ssh_obfuscated_password,json=sshObfuscatedPassword,proto3" json:"ssh_obfuscated_password,omitempty"`
+ SshObfuscatedPassword string `protobuf:"bytes,18,opt,name=ssh_obfuscated_password,json=sshObfuscatedPassword,proto3" json:"ssh_obfuscated_password,omitempty"`
// The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").
- SshObfuscatedPrivateKey string `protobuf:"bytes,9,opt,name=ssh_obfuscated_private_key,json=sshObfuscatedPrivateKey,proto3" json:"ssh_obfuscated_private_key,omitempty"`
+ SshObfuscatedPrivateKey string `protobuf:"bytes,19,opt,name=ssh_obfuscated_private_key,json=sshObfuscatedPrivateKey,proto3" json:"ssh_obfuscated_private_key,omitempty"`
// PKCS#8 private key in PEM format. If it's empty string, no private key is required.
// Used for authentication when connecting to the data source.
- AuthenticationPrivateKeyObfuscated string `protobuf:"bytes,10,opt,name=authentication_private_key_obfuscated,json=authenticationPrivateKeyObfuscated,proto3" json:"authentication_private_key_obfuscated,omitempty"`
- ExternalSecret *DataSourceExternalSecret `protobuf:"bytes,11,opt,name=external_secret,json=externalSecret,proto3" json:"external_secret,omitempty"`
- AuthenticationType DataSourceOptions_AuthenticationType `protobuf:"varint,12,opt,name=authentication_type,json=authenticationType,proto3,enum=bytebase.store.DataSourceOptions_AuthenticationType" json:"authentication_type,omitempty"`
+ AuthenticationPrivateKeyObfuscated string `protobuf:"bytes,20,opt,name=authentication_private_key_obfuscated,json=authenticationPrivateKeyObfuscated,proto3" json:"authentication_private_key_obfuscated,omitempty"`
+ ExternalSecret *DataSourceExternalSecret `protobuf:"bytes,21,opt,name=external_secret,json=externalSecret,proto3" json:"external_secret,omitempty"`
+ AuthenticationType DataSourceOptions_AuthenticationType `protobuf:"varint,22,opt,name=authentication_type,json=authenticationType,proto3,enum=bytebase.store.DataSourceOptions_AuthenticationType" json:"authentication_type,omitempty"`
// Types that are valid to be assigned to IamExtension:
//
// *DataSourceOptions_ClientSecretCredential_
IamExtension isDataSourceOptions_IamExtension `protobuf_oneof:"iam_extension"`
- SaslConfig *SASLConfig `protobuf:"bytes,13,opt,name=sasl_config,json=saslConfig,proto3" json:"sasl_config,omitempty"`
+ SaslConfig *SASLConfig `protobuf:"bytes,24,opt,name=sasl_config,json=saslConfig,proto3" json:"sasl_config,omitempty"`
// additional_addresses is used for MongoDB replica set.
- AdditionalAddresses []*DataSourceOptions_Address `protobuf:"bytes,14,rep,name=additional_addresses,json=additionalAddresses,proto3" json:"additional_addresses,omitempty"`
+ AdditionalAddresses []*DataSourceOptions_Address `protobuf:"bytes,25,rep,name=additional_addresses,json=additionalAddresses,proto3" json:"additional_addresses,omitempty"`
// replica_set is used for MongoDB replica set.
- ReplicaSet string `protobuf:"bytes,15,opt,name=replica_set,json=replicaSet,proto3" json:"replica_set,omitempty"`
+ ReplicaSet string `protobuf:"bytes,26,opt,name=replica_set,json=replicaSet,proto3" json:"replica_set,omitempty"`
// direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.
- DirectConnection bool `protobuf:"varint,16,opt,name=direct_connection,json=directConnection,proto3" json:"direct_connection,omitempty"`
+ DirectConnection bool `protobuf:"varint,27,opt,name=direct_connection,json=directConnection,proto3" json:"direct_connection,omitempty"`
// region is the location of where the DB is, works for AWS RDS. For example, us-east-1.
- Region string `protobuf:"bytes,17,opt,name=region,proto3" json:"region,omitempty"`
+ Region string `protobuf:"bytes,28,opt,name=region,proto3" json:"region,omitempty"`
// warehouse_id is used by Databricks.
- WarehouseId string `protobuf:"bytes,19,opt,name=warehouse_id,json=warehouseId,proto3" json:"warehouse_id,omitempty"`
+ WarehouseId string `protobuf:"bytes,29,opt,name=warehouse_id,json=warehouseId,proto3" json:"warehouse_id,omitempty"`
// master_name is the master name used by connecting redis-master via redis sentinel.
- MasterName string `protobuf:"bytes,20,opt,name=master_name,json=masterName,proto3" json:"master_name,omitempty"`
+ MasterName string `protobuf:"bytes,30,opt,name=master_name,json=masterName,proto3" json:"master_name,omitempty"`
// master_username and master_obfuscated_password are master credentials used by redis sentinel mode.
- MasterUsername string `protobuf:"bytes,21,opt,name=master_username,json=masterUsername,proto3" json:"master_username,omitempty"`
- MasterObfuscatedPassword string `protobuf:"bytes,22,opt,name=master_obfuscated_password,json=masterObfuscatedPassword,proto3" json:"master_obfuscated_password,omitempty"`
- RedisType DataSourceOptions_RedisType `protobuf:"varint,23,opt,name=redis_type,json=redisType,proto3,enum=bytebase.store.DataSourceOptions_RedisType" json:"redis_type,omitempty"`
+ MasterUsername string `protobuf:"bytes,31,opt,name=master_username,json=masterUsername,proto3" json:"master_username,omitempty"`
+ MasterObfuscatedPassword string `protobuf:"bytes,32,opt,name=master_obfuscated_password,json=masterObfuscatedPassword,proto3" json:"master_obfuscated_password,omitempty"`
+ RedisType DataSourceOptions_RedisType `protobuf:"varint,33,opt,name=redis_type,json=redisType,proto3,enum=bytebase.store.DataSourceOptions_RedisType" json:"redis_type,omitempty"`
// Use SSL to connect to the data source. By default, we use system default SSL configuration.
- UseSsl bool `protobuf:"varint,24,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"`
+ UseSsl bool `protobuf:"varint,34,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"`
// Cluster is the cluster name for the data source. Used by CockroachDB.
- Cluster string `protobuf:"bytes,25,opt,name=cluster,proto3" json:"cluster,omitempty"`
+ Cluster string `protobuf:"bytes,35,opt,name=cluster,proto3" json:"cluster,omitempty"`
// Extra connection parameters for the database connection.
// For PostgreSQL HA, this can be used to set target_session_attrs=read-write
- ExtraConnectionParameters map[string]string `protobuf:"bytes,27,rep,name=extra_connection_parameters,json=extraConnectionParameters,proto3" json:"extra_connection_parameters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ ExtraConnectionParameters map[string]string `protobuf:"bytes,36,rep,name=extra_connection_parameters,json=extraConnectionParameters,proto3" json:"extra_connection_parameters,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
-func (x *DataSourceOptions) Reset() {
- *x = DataSourceOptions{}
- mi := &file_store_data_source_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
+func (x *DataSourceOptions) Reset() {
+ *x = DataSourceOptions{}
+ mi := &file_store_data_source_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *DataSourceOptions) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DataSourceOptions) ProtoMessage() {}
+
+func (x *DataSourceOptions) ProtoReflect() protoreflect.Message {
+ mi := &file_store_data_source_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use DataSourceOptions.ProtoReflect.Descriptor instead.
+func (*DataSourceOptions) Descriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *DataSourceOptions) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
+func (x *DataSourceOptions) GetType() DataSourceType {
+ if x != nil {
+ return x.Type
+ }
+ return DataSourceType_DATA_SOURCE_UNSPECIFIED
+}
+
+func (x *DataSourceOptions) GetHost() string {
+ if x != nil {
+ return x.Host
+ }
+ return ""
+}
+
+func (x *DataSourceOptions) GetPort() string {
+ if x != nil {
+ return x.Port
+ }
+ return ""
+}
+
+func (x *DataSourceOptions) GetUsername() string {
+ if x != nil {
+ return x.Username
+ }
+ return ""
+}
+
+func (x *DataSourceOptions) GetObfuscatedPassword() string {
+ if x != nil {
+ return x.ObfuscatedPassword
+ }
+ return ""
}
-func (x *DataSourceOptions) String() string {
- return protoimpl.X.MessageStringOf(x)
+func (x *DataSourceOptions) GetDatabase() string {
+ if x != nil {
+ return x.Database
+ }
+ return ""
}
-func (*DataSourceOptions) ProtoMessage() {}
+func (x *DataSourceOptions) GetObfuscatedSslKey() string {
+ if x != nil {
+ return x.ObfuscatedSslKey
+ }
+ return ""
+}
-func (x *DataSourceOptions) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[1]
+func (x *DataSourceOptions) GetObfuscatedSslCert() string {
if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
+ return x.ObfuscatedSslCert
}
- return mi.MessageOf(x)
+ return ""
}
-// Deprecated: Use DataSourceOptions.ProtoReflect.Descriptor instead.
-func (*DataSourceOptions) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{1}
+func (x *DataSourceOptions) GetObfuscatedSslCa() string {
+ if x != nil {
+ return x.ObfuscatedSslCa
+ }
+ return ""
}
func (x *DataSourceOptions) GetSrv() bool {
@@ -699,7 +695,7 @@ type isDataSourceOptions_IamExtension interface {
}
type DataSourceOptions_ClientSecretCredential_ struct {
- ClientSecretCredential *DataSourceOptions_ClientSecretCredential `protobuf:"bytes,26,opt,name=client_secret_credential,json=clientSecretCredential,proto3,oneof"`
+ ClientSecretCredential *DataSourceOptions_ClientSecretCredential `protobuf:"bytes,23,opt,name=client_secret_credential,json=clientSecretCredential,proto3,oneof"`
}
func (*DataSourceOptions_ClientSecretCredential_) isDataSourceOptions_IamExtension() {}
@@ -716,7 +712,7 @@ type SASLConfig struct {
func (x *SASLConfig) Reset() {
*x = SASLConfig{}
- mi := &file_store_data_source_proto_msgTypes[2]
+ mi := &file_store_data_source_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -728,7 +724,7 @@ func (x *SASLConfig) String() string {
func (*SASLConfig) ProtoMessage() {}
func (x *SASLConfig) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[2]
+ mi := &file_store_data_source_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -741,7 +737,7 @@ func (x *SASLConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use SASLConfig.ProtoReflect.Descriptor instead.
func (*SASLConfig) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{2}
+ return file_store_data_source_proto_rawDescGZIP(), []int{1}
}
func (x *SASLConfig) GetMechanism() isSASLConfig_Mechanism {
@@ -785,7 +781,7 @@ type KerberosConfig struct {
func (x *KerberosConfig) Reset() {
*x = KerberosConfig{}
- mi := &file_store_data_source_proto_msgTypes[3]
+ mi := &file_store_data_source_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -797,7 +793,7 @@ func (x *KerberosConfig) String() string {
func (*KerberosConfig) ProtoMessage() {}
func (x *KerberosConfig) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[3]
+ mi := &file_store_data_source_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -810,7 +806,7 @@ func (x *KerberosConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use KerberosConfig.ProtoReflect.Descriptor instead.
func (*KerberosConfig) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{3}
+ return file_store_data_source_proto_rawDescGZIP(), []int{2}
}
func (x *KerberosConfig) GetPrimary() string {
@@ -862,33 +858,41 @@ func (x *KerberosConfig) GetKdcTransportProtocol() string {
return ""
}
-type DataSourceExternalSecret_AppRoleAuthOption struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
- // the secret id for the role without ttl.
- SecretId string `protobuf:"bytes,2,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"`
- Type DataSourceExternalSecret_AppRoleAuthOption_SecretType `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.store.DataSourceExternalSecret_AppRoleAuthOption_SecretType" json:"type,omitempty"`
- // The path where the approle auth method is mounted.
- MountPath string `protobuf:"bytes,4,opt,name=mount_path,json=mountPath,proto3" json:"mount_path,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+type DataSourceExternalSecret struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ SecretType DataSourceExternalSecret_SecretType `protobuf:"varint,1,opt,name=secret_type,json=secretType,proto3,enum=bytebase.store.DataSourceExternalSecret_SecretType" json:"secret_type,omitempty"`
+ Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
+ AuthType DataSourceExternalSecret_AuthType `protobuf:"varint,3,opt,name=auth_type,json=authType,proto3,enum=bytebase.store.DataSourceExternalSecret_AuthType" json:"auth_type,omitempty"`
+ // Types that are valid to be assigned to AuthOption:
+ //
+ // *DataSourceExternalSecret_AppRole
+ // *DataSourceExternalSecret_Token
+ AuthOption isDataSourceExternalSecret_AuthOption `protobuf_oneof:"auth_option"`
+ // engine name is the name for secret engine.
+ EngineName string `protobuf:"bytes,6,opt,name=engine_name,json=engineName,proto3" json:"engine_name,omitempty"`
+ // the secret name in the engine to store the password.
+ SecretName string `protobuf:"bytes,7,opt,name=secret_name,json=secretName,proto3" json:"secret_name,omitempty"`
+ // the key name for the password.
+ PasswordKeyName string `protobuf:"bytes,8,opt,name=password_key_name,json=passwordKeyName,proto3" json:"password_key_name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) Reset() {
- *x = DataSourceExternalSecret_AppRoleAuthOption{}
- mi := &file_store_data_source_proto_msgTypes[4]
+func (x *DataSourceExternalSecret) Reset() {
+ *x = DataSourceExternalSecret{}
+ mi := &file_store_data_source_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) String() string {
+func (x *DataSourceExternalSecret) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*DataSourceExternalSecret_AppRoleAuthOption) ProtoMessage() {}
+func (*DataSourceExternalSecret) ProtoMessage() {}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[4]
+func (x *DataSourceExternalSecret) ProtoReflect() protoreflect.Message {
+ mi := &file_store_data_source_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -899,39 +903,94 @@ func (x *DataSourceExternalSecret_AppRoleAuthOption) ProtoReflect() protoreflect
return mi.MessageOf(x)
}
-// Deprecated: Use DataSourceExternalSecret_AppRoleAuthOption.ProtoReflect.Descriptor instead.
-func (*DataSourceExternalSecret_AppRoleAuthOption) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{0, 0}
+// Deprecated: Use DataSourceExternalSecret.ProtoReflect.Descriptor instead.
+func (*DataSourceExternalSecret) Descriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{3}
}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) GetRoleId() string {
+func (x *DataSourceExternalSecret) GetSecretType() DataSourceExternalSecret_SecretType {
if x != nil {
- return x.RoleId
+ return x.SecretType
+ }
+ return DataSourceExternalSecret_SAECRET_TYPE_UNSPECIFIED
+}
+
+func (x *DataSourceExternalSecret) GetUrl() string {
+ if x != nil {
+ return x.Url
}
return ""
}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) GetSecretId() string {
+func (x *DataSourceExternalSecret) GetAuthType() DataSourceExternalSecret_AuthType {
if x != nil {
- return x.SecretId
+ return x.AuthType
+ }
+ return DataSourceExternalSecret_AUTH_TYPE_UNSPECIFIED
+}
+
+func (x *DataSourceExternalSecret) GetAuthOption() isDataSourceExternalSecret_AuthOption {
+ if x != nil {
+ return x.AuthOption
+ }
+ return nil
+}
+
+func (x *DataSourceExternalSecret) GetAppRole() *DataSourceExternalSecret_AppRoleAuthOption {
+ if x != nil {
+ if x, ok := x.AuthOption.(*DataSourceExternalSecret_AppRole); ok {
+ return x.AppRole
+ }
+ }
+ return nil
+}
+
+func (x *DataSourceExternalSecret) GetToken() string {
+ if x != nil {
+ if x, ok := x.AuthOption.(*DataSourceExternalSecret_Token); ok {
+ return x.Token
+ }
}
return ""
}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) GetType() DataSourceExternalSecret_AppRoleAuthOption_SecretType {
+func (x *DataSourceExternalSecret) GetEngineName() string {
if x != nil {
- return x.Type
+ return x.EngineName
}
- return DataSourceExternalSecret_AppRoleAuthOption_SECRET_TYPE_UNSPECIFIED
+ return ""
}
-func (x *DataSourceExternalSecret_AppRoleAuthOption) GetMountPath() string {
+func (x *DataSourceExternalSecret) GetSecretName() string {
if x != nil {
- return x.MountPath
+ return x.SecretName
+ }
+ return ""
+}
+
+func (x *DataSourceExternalSecret) GetPasswordKeyName() string {
+ if x != nil {
+ return x.PasswordKeyName
}
return ""
}
+type isDataSourceExternalSecret_AuthOption interface {
+ isDataSourceExternalSecret_AuthOption()
+}
+
+type DataSourceExternalSecret_AppRole struct {
+ AppRole *DataSourceExternalSecret_AppRoleAuthOption `protobuf:"bytes,4,opt,name=app_role,json=appRole,proto3,oneof"`
+}
+
+type DataSourceExternalSecret_Token struct {
+ Token string `protobuf:"bytes,5,opt,name=token,proto3,oneof"`
+}
+
+func (*DataSourceExternalSecret_AppRole) isDataSourceExternalSecret_AuthOption() {}
+
+func (*DataSourceExternalSecret_Token) isDataSourceExternalSecret_AuthOption() {}
+
type DataSourceOptions_ClientSecretCredential struct {
state protoimpl.MessageState `protogen:"open.v1"`
TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
@@ -943,7 +1002,7 @@ type DataSourceOptions_ClientSecretCredential struct {
func (x *DataSourceOptions_ClientSecretCredential) Reset() {
*x = DataSourceOptions_ClientSecretCredential{}
- mi := &file_store_data_source_proto_msgTypes[5]
+ mi := &file_store_data_source_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -955,7 +1014,7 @@ func (x *DataSourceOptions_ClientSecretCredential) String() string {
func (*DataSourceOptions_ClientSecretCredential) ProtoMessage() {}
func (x *DataSourceOptions_ClientSecretCredential) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[5]
+ mi := &file_store_data_source_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -968,7 +1027,7 @@ func (x *DataSourceOptions_ClientSecretCredential) ProtoReflect() protoreflect.M
// Deprecated: Use DataSourceOptions_ClientSecretCredential.ProtoReflect.Descriptor instead.
func (*DataSourceOptions_ClientSecretCredential) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{1, 0}
+ return file_store_data_source_proto_rawDescGZIP(), []int{0, 0}
}
func (x *DataSourceOptions_ClientSecretCredential) GetTenantId() string {
@@ -1002,7 +1061,7 @@ type DataSourceOptions_Address struct {
func (x *DataSourceOptions_Address) Reset() {
*x = DataSourceOptions_Address{}
- mi := &file_store_data_source_proto_msgTypes[6]
+ mi := &file_store_data_source_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1014,7 +1073,7 @@ func (x *DataSourceOptions_Address) String() string {
func (*DataSourceOptions_Address) ProtoMessage() {}
func (x *DataSourceOptions_Address) ProtoReflect() protoreflect.Message {
- mi := &file_store_data_source_proto_msgTypes[6]
+ mi := &file_store_data_source_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1027,7 +1086,7 @@ func (x *DataSourceOptions_Address) ProtoReflect() protoreflect.Message {
// Deprecated: Use DataSourceOptions_Address.ProtoReflect.Descriptor instead.
func (*DataSourceOptions_Address) Descriptor() ([]byte, []int) {
- return file_store_data_source_proto_rawDescGZIP(), []int{1, 1}
+ return file_store_data_source_proto_rawDescGZIP(), []int{0, 1}
}
func (x *DataSourceOptions_Address) GetHost() string {
@@ -1044,209 +1103,305 @@ func (x *DataSourceOptions_Address) GetPort() string {
return ""
}
+type DataSourceExternalSecret_AppRoleAuthOption struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
+ // the secret id for the role without ttl.
+ SecretId string `protobuf:"bytes,2,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"`
+ Type DataSourceExternalSecret_AppRoleAuthOption_SecretType `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.store.DataSourceExternalSecret_AppRoleAuthOption_SecretType" json:"type,omitempty"`
+ // The path where the approle auth method is mounted.
+ MountPath string `protobuf:"bytes,4,opt,name=mount_path,json=mountPath,proto3" json:"mount_path,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) Reset() {
+ *x = DataSourceExternalSecret_AppRoleAuthOption{}
+ mi := &file_store_data_source_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DataSourceExternalSecret_AppRoleAuthOption) ProtoMessage() {}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) ProtoReflect() protoreflect.Message {
+ mi := &file_store_data_source_proto_msgTypes[7]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use DataSourceExternalSecret_AppRoleAuthOption.ProtoReflect.Descriptor instead.
+func (*DataSourceExternalSecret_AppRoleAuthOption) Descriptor() ([]byte, []int) {
+ return file_store_data_source_proto_rawDescGZIP(), []int{3, 0}
+}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) GetRoleId() string {
+ if x != nil {
+ return x.RoleId
+ }
+ return ""
+}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) GetSecretId() string {
+ if x != nil {
+ return x.SecretId
+ }
+ return ""
+}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) GetType() DataSourceExternalSecret_AppRoleAuthOption_SecretType {
+ if x != nil {
+ return x.Type
+ }
+ return DataSourceExternalSecret_AppRoleAuthOption_SECRET_TYPE_UNSPECIFIED
+}
+
+func (x *DataSourceExternalSecret_AppRoleAuthOption) GetMountPath() string {
+ if x != nil {
+ return x.MountPath
+ }
+ return ""
+}
+
var File_store_data_source_proto protoreflect.FileDescriptor
var file_store_data_source_proto_rawDesc = string([]byte{
0x0a, 0x17, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, 0x6f, 0x75,
0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x81, 0x07, 0x0a, 0x18, 0x44, 0x61,
- 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
- 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x54, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74,
- 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53,
- 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65,
- 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03,
- 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x4e,
- 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74,
- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x68,
- 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57,
- 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xc6, 0x11, 0x0a, 0x11, 0x44, 0x61,
+ 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
+ 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
+ 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44,
+ 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
+ 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75,
+ 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75,
+ 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x6f, 0x62, 0x66, 0x75, 0x73,
+ 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x06,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
+ 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74,
+ 0x65, 0x64, 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x10, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x73, 0x6c, 0x4b,
+ 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
+ 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x11, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x73, 0x6c, 0x43, 0x65,
+ 0x72, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
+ 0x5f, 0x73, 0x73, 0x6c, 0x5f, 0x63, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f,
+ 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x53, 0x73, 0x6c, 0x43, 0x61, 0x12, 0x10,
+ 0x0a, 0x03, 0x73, 0x72, 0x76, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x73, 0x72, 0x76,
+ 0x12, 0x37, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64,
+ 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19,
+ 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x07, 0x73, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68,
+ 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68,
+ 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x75, 0x73, 0x65, 0x72,
+ 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x12,
+ 0x36, 0x0a, 0x17, 0x73, 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65,
+ 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x15, 0x73, 0x73, 0x68, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50,
+ 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x73, 0x73, 0x68, 0x5f, 0x6f,
+ 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74,
+ 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x73, 0x73, 0x68,
+ 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74,
+ 0x65, 0x4b, 0x65, 0x79, 0x12, 0x51, 0x0a, 0x25, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b,
+ 0x65, 0x79, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x14, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x22, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x62, 0x66,
+ 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x51, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65,
- 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f,
- 0x6c, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07,
- 0x61, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
- 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65,
- 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d,
- 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6b, 0x65,
- 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61,
- 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x8a, 0x02,
- 0x0a, 0x11, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09,
- 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x08, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49, 0x64, 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70,
- 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65,
+ 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x65, 0x0a, 0x13, 0x61, 0x75,
+ 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70,
+ 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75,
- 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65,
- 0x74, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04,
- 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61,
- 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50,
- 0x61, 0x74, 0x68, 0x22, 0x45, 0x0a, 0x0a, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70,
- 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45,
- 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09,
- 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56,
- 0x49, 0x52, 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x65,
- 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x41, 0x45, 0x43,
- 0x52, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
- 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x5f,
- 0x4b, 0x56, 0x5f, 0x56, 0x32, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x57, 0x53, 0x5f, 0x53,
- 0x45, 0x43, 0x52, 0x45, 0x54, 0x53, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x02,
- 0x12, 0x16, 0x0a, 0x12, 0x47, 0x43, 0x50, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x4d,
- 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x03, 0x22, 0x44, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68,
- 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x48, 0x5f, 0x54, 0x59, 0x50,
- 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x09, 0x0a, 0x05, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x41,
- 0x55, 0x4c, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0d,
- 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xe7, 0x0e,
- 0x0a, 0x11, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x72, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
- 0x52, 0x03, 0x73, 0x72, 0x76, 0x12, 0x37, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x10,
- 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64,
- 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e,
- 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19,
- 0x0a, 0x08, 0x73, 0x73, 0x68, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x73, 0x73, 0x68, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x73, 0x68,
- 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68,
- 0x55, 0x73, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x73, 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75,
- 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18,
- 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x73, 0x73, 0x68, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63,
- 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3b, 0x0a, 0x1a,
- 0x73, 0x73, 0x68, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70,
- 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x17, 0x73, 0x73, 0x68, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50,
- 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x51, 0x0a, 0x25, 0x61, 0x75, 0x74,
- 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x69, 0x76,
- 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74,
- 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x22, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e,
- 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b,
- 0x65, 0x79, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x51, 0x0a, 0x0f,
- 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18,
- 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52,
- 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
- 0x65, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61,
- 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
- 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79,
- 0x70, 0x65, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x74, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
- 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69,
- 0x61, 0x6c, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f,
- 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x6c, 0x69, 0x65,
- 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69,
- 0x61, 0x6c, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72,
- 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x0b,
- 0x73, 0x61, 0x73, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x53, 0x41, 0x53, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x73,
- 0x61, 0x73, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x14, 0x61, 0x64, 0x64,
- 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65,
- 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65,
+ 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, 0x61,
+ 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70,
+ 0x65, 0x12, 0x74, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x17, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x48, 0x00, 0x52,
+ 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65,
+ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x3b, 0x0a, 0x0b, 0x73, 0x61, 0x73, 0x6c, 0x5f,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x41,
+ 0x53, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x73, 0x61, 0x73, 0x6c, 0x43, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x61, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x19, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x13, 0x61,
+ 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
+ 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x73, 0x65,
+ 0x74, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61,
+ 0x53, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10,
+ 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x61, 0x72, 0x65,
+ 0x68, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
+ 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6d,
+ 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f,
+ 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65,
+ 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f,
+ 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77,
+ 0x6f, 0x72, 0x64, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x6d, 0x61, 0x73, 0x74, 0x65,
+ 0x72, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77,
+ 0x6f, 0x72, 0x64, 0x12, 0x4a, 0x0a, 0x0a, 0x72, 0x65, 0x64, 0x69, 0x73, 0x5f, 0x74, 0x79, 0x70,
+ 0x65, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75,
- 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65,
- 0x73, 0x73, 0x52, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x41, 0x64,
- 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x69,
- 0x63, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65,
- 0x70, 0x6c, 0x69, 0x63, 0x61, 0x53, 0x65, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x72, 0x65,
- 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x10, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x10, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18,
- 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a,
- 0x0c, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x13, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x64,
- 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d,
- 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72,
- 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x73, 0x74,
- 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x6d, 0x61,
- 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f,
- 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18,
- 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x66, 0x75, 0x73, 0x63, 0x61, 0x74, 0x65, 0x64,
- 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x4a, 0x0a, 0x0a, 0x72, 0x65, 0x64, 0x69,
- 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61,
- 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
- 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x72, 0x65, 0x64, 0x69, 0x73,
- 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18,
- 0x18, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x18, 0x0a,
- 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
- 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x1b, 0x65, 0x78, 0x74, 0x72,
- 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72,
- 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44,
- 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
- 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
- 0x19, 0x65, 0x78, 0x74, 0x72, 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x77, 0x0a, 0x16, 0x43, 0x6c,
- 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e,
- 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69,
- 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49,
- 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23,
- 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18,
- 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63,
- 0x72, 0x65, 0x74, 0x1a, 0x31, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12,
- 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f,
- 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x4c, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
- 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
- 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7c, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55,
- 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53,
- 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x41,
- 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x47, 0x4f, 0x4f, 0x47,
- 0x4c, 0x45, 0x5f, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x49, 0x41, 0x4d,
- 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x57, 0x53, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x49, 0x41,
- 0x4d, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x49, 0x41, 0x4d,
- 0x10, 0x04, 0x22, 0x52, 0x0a, 0x09, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12,
- 0x1a, 0x0a, 0x16, 0x52, 0x45, 0x44, 0x49, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e,
- 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53,
- 0x54, 0x41, 0x4e, 0x44, 0x41, 0x4c, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53,
- 0x45, 0x4e, 0x54, 0x49, 0x4e, 0x45, 0x4c, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x55,
- 0x53, 0x54, 0x45, 0x52, 0x10, 0x03, 0x42, 0x0f, 0x0a, 0x0d, 0x69, 0x61, 0x6d, 0x5f, 0x65, 0x78,
- 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x53, 0x41, 0x53, 0x4c, 0x43,
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x0a, 0x6b, 0x72, 0x62, 0x5f, 0x63, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4b, 0x65, 0x72, 0x62, 0x65,
- 0x72, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x6b, 0x72, 0x62,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x0b, 0x0a, 0x09, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e,
- 0x69, 0x73, 0x6d, 0x22, 0xe0, 0x01, 0x0a, 0x0e, 0x4b, 0x65, 0x72, 0x62, 0x65, 0x72, 0x6f, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72,
- 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79,
- 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05,
- 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x61,
- 0x6c, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x0c, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64,
- 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64,
- 0x63, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x70, 0x6f, 0x72,
- 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63, 0x50, 0x6f, 0x72, 0x74,
- 0x12, 0x34, 0x0a, 0x16, 0x6b, 0x64, 0x63, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72,
- 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x14, 0x6b, 0x64, 0x63, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
- 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73,
+ 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x72, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x22, 0x20, 0x01, 0x28, 0x08,
+ 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73,
+ 0x74, 0x65, 0x72, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74,
+ 0x65, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x1b, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x63, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
+ 0x72, 0x73, 0x18, 0x24, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, 0x78, 0x74, 0x72,
+ 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d,
+ 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x19, 0x65, 0x78, 0x74, 0x72,
+ 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d,
+ 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x77, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12,
+ 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09,
+ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x1a, 0x31,
+ 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73,
+ 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a,
+ 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72,
+ 0x74, 0x1a, 0x4c, 0x0a, 0x1e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e,
+ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22,
+ 0x7c, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54,
+ 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52,
+ 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x5f, 0x43, 0x4c,
+ 0x4f, 0x55, 0x44, 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x02, 0x12, 0x0f, 0x0a,
+ 0x0b, 0x41, 0x57, 0x53, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x03, 0x12, 0x0d,
+ 0x0a, 0x09, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x04, 0x22, 0x52, 0x0a,
+ 0x09, 0x52, 0x65, 0x64, 0x69, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x45,
+ 0x44, 0x49, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41,
+ 0x4c, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x45, 0x4e, 0x54, 0x49, 0x4e,
+ 0x45, 0x4c, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x10,
+ 0x03, 0x42, 0x0f, 0x0a, 0x0d, 0x69, 0x61, 0x6d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
+ 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x53, 0x41, 0x53, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x12, 0x3f, 0x0a, 0x0a, 0x6b, 0x72, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4b, 0x65, 0x72, 0x62, 0x65, 0x72, 0x6f, 0x73, 0x43, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x6b, 0x72, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x42, 0x0b, 0x0a, 0x09, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x22, 0xe0,
+ 0x01, 0x0a, 0x0e, 0x4b, 0x65, 0x72, 0x62, 0x65, 0x72, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69,
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69,
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x16, 0x0a,
+ 0x06, 0x6b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6b,
+ 0x65, 0x79, 0x74, 0x61, 0x62, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x68, 0x6f, 0x73,
+ 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63, 0x48, 0x6f, 0x73, 0x74,
+ 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x64, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x07, 0x6b, 0x64, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6b,
+ 0x64, 0x63, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6b, 0x64, 0x63,
+ 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
+ 0x6c, 0x22, 0x81, 0x07, 0x0a, 0x18, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x54,
+ 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45,
+ 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x53, 0x65,
+ 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
+ 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x4e, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74,
+ 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75,
+ 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x72, 0x6f,
+ 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x61, 0x70, 0x70, 0x52, 0x6f, 0x6c, 0x65, 0x12,
+ 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00,
+ 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e,
+ 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e,
+ 0x67, 0x69, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x61, 0x73,
+ 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4b, 0x65,
+ 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x8a, 0x02, 0x0a, 0x11, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c,
+ 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x72,
+ 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f,
+ 0x6c, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x69,
+ 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x49,
+ 0x64, 0x12, 0x59, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x45, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72,
+ 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x6f, 0x6c,
+ 0x65, 0x41, 0x75, 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
+ 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x09, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x61, 0x74, 0x68, 0x22, 0x45, 0x0a, 0x0a, 0x53,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x45, 0x43,
+ 0x52, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10,
+ 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56, 0x49, 0x52, 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54,
+ 0x10, 0x02, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65,
+ 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x41, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f,
+ 0x0a, 0x0b, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x4b, 0x56, 0x5f, 0x56, 0x32, 0x10, 0x01, 0x12,
+ 0x17, 0x0a, 0x13, 0x41, 0x57, 0x53, 0x5f, 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x53, 0x5f, 0x4d,
+ 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x43, 0x50, 0x5f,
+ 0x53, 0x45, 0x43, 0x52, 0x45, 0x54, 0x5f, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x52, 0x10, 0x03,
+ 0x22, 0x44, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15,
+ 0x41, 0x55, 0x54, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x4f, 0x4b, 0x45, 0x4e,
+ 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x5f,
+ 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0d, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6f,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x47, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x41, 0x54, 0x41, 0x5f,
+ 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
+ 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12,
+ 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x42, 0x14,
+ 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
@@ -1261,41 +1416,43 @@ func file_store_data_source_proto_rawDescGZIP() []byte {
return file_store_data_source_proto_rawDescData
}
-var file_store_data_source_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
+var file_store_data_source_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
var file_store_data_source_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_store_data_source_proto_goTypes = []any{
- (DataSourceExternalSecret_SecretType)(0), // 0: bytebase.store.DataSourceExternalSecret.SecretType
- (DataSourceExternalSecret_AuthType)(0), // 1: bytebase.store.DataSourceExternalSecret.AuthType
- (DataSourceExternalSecret_AppRoleAuthOption_SecretType)(0), // 2: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
- (DataSourceOptions_AuthenticationType)(0), // 3: bytebase.store.DataSourceOptions.AuthenticationType
- (DataSourceOptions_RedisType)(0), // 4: bytebase.store.DataSourceOptions.RedisType
- (*DataSourceExternalSecret)(nil), // 5: bytebase.store.DataSourceExternalSecret
+ (DataSourceType)(0), // 0: bytebase.store.DataSourceType
+ (DataSourceOptions_AuthenticationType)(0), // 1: bytebase.store.DataSourceOptions.AuthenticationType
+ (DataSourceOptions_RedisType)(0), // 2: bytebase.store.DataSourceOptions.RedisType
+ (DataSourceExternalSecret_SecretType)(0), // 3: bytebase.store.DataSourceExternalSecret.SecretType
+ (DataSourceExternalSecret_AuthType)(0), // 4: bytebase.store.DataSourceExternalSecret.AuthType
+ (DataSourceExternalSecret_AppRoleAuthOption_SecretType)(0), // 5: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
(*DataSourceOptions)(nil), // 6: bytebase.store.DataSourceOptions
(*SASLConfig)(nil), // 7: bytebase.store.SASLConfig
(*KerberosConfig)(nil), // 8: bytebase.store.KerberosConfig
- (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 9: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ (*DataSourceExternalSecret)(nil), // 9: bytebase.store.DataSourceExternalSecret
(*DataSourceOptions_ClientSecretCredential)(nil), // 10: bytebase.store.DataSourceOptions.ClientSecretCredential
(*DataSourceOptions_Address)(nil), // 11: bytebase.store.DataSourceOptions.Address
nil, // 12: bytebase.store.DataSourceOptions.ExtraConnectionParametersEntry
+ (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 13: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
}
var file_store_data_source_proto_depIdxs = []int32{
- 0, // 0: bytebase.store.DataSourceExternalSecret.secret_type:type_name -> bytebase.store.DataSourceExternalSecret.SecretType
- 1, // 1: bytebase.store.DataSourceExternalSecret.auth_type:type_name -> bytebase.store.DataSourceExternalSecret.AuthType
- 9, // 2: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
- 5, // 3: bytebase.store.DataSourceOptions.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
- 3, // 4: bytebase.store.DataSourceOptions.authentication_type:type_name -> bytebase.store.DataSourceOptions.AuthenticationType
- 10, // 5: bytebase.store.DataSourceOptions.client_secret_credential:type_name -> bytebase.store.DataSourceOptions.ClientSecretCredential
- 7, // 6: bytebase.store.DataSourceOptions.sasl_config:type_name -> bytebase.store.SASLConfig
- 11, // 7: bytebase.store.DataSourceOptions.additional_addresses:type_name -> bytebase.store.DataSourceOptions.Address
- 4, // 8: bytebase.store.DataSourceOptions.redis_type:type_name -> bytebase.store.DataSourceOptions.RedisType
- 12, // 9: bytebase.store.DataSourceOptions.extra_connection_parameters:type_name -> bytebase.store.DataSourceOptions.ExtraConnectionParametersEntry
- 8, // 10: bytebase.store.SASLConfig.krb_config:type_name -> bytebase.store.KerberosConfig
- 2, // 11: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
- 12, // [12:12] is the sub-list for method output_type
- 12, // [12:12] is the sub-list for method input_type
- 12, // [12:12] is the sub-list for extension type_name
- 12, // [12:12] is the sub-list for extension extendee
- 0, // [0:12] is the sub-list for field type_name
+ 0, // 0: bytebase.store.DataSourceOptions.type:type_name -> bytebase.store.DataSourceType
+ 9, // 1: bytebase.store.DataSourceOptions.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
+ 1, // 2: bytebase.store.DataSourceOptions.authentication_type:type_name -> bytebase.store.DataSourceOptions.AuthenticationType
+ 10, // 3: bytebase.store.DataSourceOptions.client_secret_credential:type_name -> bytebase.store.DataSourceOptions.ClientSecretCredential
+ 7, // 4: bytebase.store.DataSourceOptions.sasl_config:type_name -> bytebase.store.SASLConfig
+ 11, // 5: bytebase.store.DataSourceOptions.additional_addresses:type_name -> bytebase.store.DataSourceOptions.Address
+ 2, // 6: bytebase.store.DataSourceOptions.redis_type:type_name -> bytebase.store.DataSourceOptions.RedisType
+ 12, // 7: bytebase.store.DataSourceOptions.extra_connection_parameters:type_name -> bytebase.store.DataSourceOptions.ExtraConnectionParametersEntry
+ 8, // 8: bytebase.store.SASLConfig.krb_config:type_name -> bytebase.store.KerberosConfig
+ 3, // 9: bytebase.store.DataSourceExternalSecret.secret_type:type_name -> bytebase.store.DataSourceExternalSecret.SecretType
+ 4, // 10: bytebase.store.DataSourceExternalSecret.auth_type:type_name -> bytebase.store.DataSourceExternalSecret.AuthType
+ 13, // 11: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ 5, // 12: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ 13, // [13:13] is the sub-list for method output_type
+ 13, // [13:13] is the sub-list for method input_type
+ 13, // [13:13] is the sub-list for extension type_name
+ 13, // [13:13] is the sub-list for extension extendee
+ 0, // [0:13] is the sub-list for field type_name
}
func init() { file_store_data_source_proto_init() }
@@ -1304,21 +1461,21 @@ func file_store_data_source_proto_init() {
return
}
file_store_data_source_proto_msgTypes[0].OneofWrappers = []any{
- (*DataSourceExternalSecret_AppRole)(nil),
- (*DataSourceExternalSecret_Token)(nil),
- }
- file_store_data_source_proto_msgTypes[1].OneofWrappers = []any{
(*DataSourceOptions_ClientSecretCredential_)(nil),
}
- file_store_data_source_proto_msgTypes[2].OneofWrappers = []any{
+ file_store_data_source_proto_msgTypes[1].OneofWrappers = []any{
(*SASLConfig_KrbConfig)(nil),
}
+ file_store_data_source_proto_msgTypes[3].OneofWrappers = []any{
+ (*DataSourceExternalSecret_AppRole)(nil),
+ (*DataSourceExternalSecret_Token)(nil),
+ }
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_data_source_proto_rawDesc), len(file_store_data_source_proto_rawDesc)),
- NumEnums: 5,
+ NumEnums: 6,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
diff --git a/proto/store/data_source.proto b/proto/store/data_source.proto
index 484c28cddb..d7f982dcf7 100644
--- a/proto/store/data_source.proto
+++ b/proto/store/data_source.proto
@@ -4,85 +4,44 @@ package bytebase.store;
option go_package = "generated-go/store";
-message DataSourceExternalSecret {
- enum SecretType {
- SAECRET_TYPE_UNSPECIFIED = 0;
- // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
- VAULT_KV_V2 = 1;
- // ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
- AWS_SECRETS_MANAGER = 2;
- // ref: https://cloud.google.com/secret-manager/docs
- GCP_SECRET_MANAGER = 3;
- }
- SecretType secret_type = 1;
- string url = 2;
-
- enum AuthType {
- AUTH_TYPE_UNSPECIFIED = 0;
- // ref: https://developer.hashicorp.com/vault/docs/auth/token
- TOKEN = 1;
- // ref: https://developer.hashicorp.com/vault/docs/auth/approle
- VAULT_APP_ROLE = 2;
- }
- AuthType auth_type = 3;
-
- message AppRoleAuthOption {
- string role_id = 1;
- // the secret id for the role without ttl.
- string secret_id = 2;
-
- enum SecretType {
- SECRET_TYPE_UNSPECIFIED = 0;
- PLAIN = 1;
- ENVIRONMENT = 2;
- }
-
- SecretType type = 3;
-
- // The path where the approle auth method is mounted.
- string mount_path = 4;
- }
-
- oneof auth_option {
- AppRoleAuthOption app_role = 4;
- string token = 5;
- }
-
- // engine name is the name for secret engine.
- string engine_name = 6;
- // the secret name in the engine to store the password.
- string secret_name = 7;
- // the key name for the password.
- string password_key_name = 8;
-}
-
message DataSourceOptions {
+ string id = 1;
+ DataSourceType type = 2;
+ string host = 3;
+ string port = 4;
+ string username = 5;
+ string obfuscated_password = 6;
+ string database = 7;
+ string obfuscated_ssl_key = 8;
+ string obfuscated_ssl_cert = 9;
+ string obfuscated_ssl_ca = 10;
+
// srv is a boolean flag that indicates whether the host is a DNS SRV record.
- bool srv = 1;
+ bool srv = 11;
// authentication_database is the database name to authenticate against, which stores the user credentials.
- string authentication_database = 2;
+ string authentication_database = 12;
// sid and service_name are used for Oracle.
- string sid = 3;
- string service_name = 4;
+ string sid = 13;
+ string service_name = 14;
// SSH related
// The hostname of the SSH server agent.
- string ssh_host = 5;
+ string ssh_host = 15;
// The port of the SSH server agent. It's 22 typically.
- string ssh_port = 6;
+ string ssh_port = 16;
// The user to login the server.
- string ssh_user = 7;
+ string ssh_user = 17;
// The password to login the server. If it's empty string, no password is required.
- string ssh_obfuscated_password = 8;
+ string ssh_obfuscated_password = 18;
// The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").
- string ssh_obfuscated_private_key = 9;
+ string ssh_obfuscated_private_key = 19;
// PKCS#8 private key in PEM format. If it's empty string, no private key is required.
// Used for authentication when connecting to the data source.
- string authentication_private_key_obfuscated = 10;
+ string authentication_private_key_obfuscated = 20;
- DataSourceExternalSecret external_secret = 11;
+ DataSourceExternalSecret external_secret = 21;
enum AuthenticationType {
AUTHENTICATION_UNSPECIFIED = 0;
@@ -92,7 +51,7 @@ message DataSourceOptions {
AZURE_IAM = 4;
}
- AuthenticationType authentication_type = 12;
+ AuthenticationType authentication_type = 22;
message ClientSecretCredential {
string tenant_id = 1;
@@ -100,35 +59,35 @@ message DataSourceOptions {
string client_secret = 3;
}
oneof iam_extension {
- ClientSecretCredential client_secret_credential = 26;
+ ClientSecretCredential client_secret_credential = 23;
}
- SASLConfig sasl_config = 13;
+ SASLConfig sasl_config = 24;
message Address {
string host = 1;
string port = 2;
}
// additional_addresses is used for MongoDB replica set.
- repeated Address additional_addresses = 14;
+ repeated Address additional_addresses = 25;
// replica_set is used for MongoDB replica set.
- string replica_set = 15;
+ string replica_set = 26;
// direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.
- bool direct_connection = 16;
+ bool direct_connection = 27;
// region is the location of where the DB is, works for AWS RDS. For example, us-east-1.
- string region = 17;
+ string region = 28;
// warehouse_id is used by Databricks.
- string warehouse_id = 19;
+ string warehouse_id = 29;
// master_name is the master name used by connecting redis-master via redis sentinel.
- string master_name = 20;
+ string master_name = 30;
// master_username and master_obfuscated_password are master credentials used by redis sentinel mode.
- string master_username = 21;
- string master_obfuscated_password = 22;
+ string master_username = 31;
+ string master_obfuscated_password = 32;
enum RedisType {
REDIS_TYPE_UNSPECIFIED = 0;
@@ -136,17 +95,17 @@ message DataSourceOptions {
SENTINEL = 2;
CLUSTER = 3;
}
- RedisType redis_type = 23;
+ RedisType redis_type = 33;
// Use SSL to connect to the data source. By default, we use system default SSL configuration.
- bool use_ssl = 24;
+ bool use_ssl = 34;
// Cluster is the cluster name for the data source. Used by CockroachDB.
- string cluster = 25;
+ string cluster = 35;
// Extra connection parameters for the database connection.
// For PostgreSQL HA, this can be used to set target_session_attrs=read-write
- map<string, string> extra_connection_parameters = 27;
+ map<string, string> extra_connection_parameters = 36;
}
message SASLConfig {
@@ -164,3 +123,61 @@ message KerberosConfig {
string kdc_port = 6;
string kdc_transport_protocol = 7;
}
+
+enum DataSourceType {
+ DATA_SOURCE_UNSPECIFIED = 0;
+ ADMIN = 1;
+ READ_ONLY = 2;
+}
+
+message DataSourceExternalSecret {
+ enum SecretType {
+ SAECRET_TYPE_UNSPECIFIED = 0;
+ // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
+ VAULT_KV_V2 = 1;
+ // ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
+ AWS_SECRETS_MANAGER = 2;
+ // ref: https://cloud.google.com/secret-manager/docs
+ GCP_SECRET_MANAGER = 3;
+ }
+ SecretType secret_type = 1;
+ string url = 2;
+
+ enum AuthType {
+ AUTH_TYPE_UNSPECIFIED = 0;
+ // ref: https://developer.hashicorp.com/vault/docs/auth/token
+ TOKEN = 1;
+ // ref: https://developer.hashicorp.com/vault/docs/auth/approle
+ VAULT_APP_ROLE = 2;
+ }
+ AuthType auth_type = 3;
+
+ message AppRoleAuthOption {
+ string role_id = 1;
+ // the secret id for the role without ttl.
+ string secret_id = 2;
+
+ enum SecretType {
+ SECRET_TYPE_UNSPECIFIED = 0;
+ PLAIN = 1;
+ ENVIRONMENT = 2;
+ }
+
+ SecretType type = 3;
+
+ // The path where the approle auth method is mounted.
+ string mount_path = 4;
+ }
+
+ oneof auth_option {
+ AppRoleAuthOption app_role = 4;
+ string token = 5;
+ }
+
+ // engine name is the name for secret engine.
+ string engine_name = 6;
+ // the secret name in the engine to store the password.
+ string secret_name = 7;
+ // the key name for the password.
+ string password_key_name = 8;
+}