Skip to content

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

chore: support vault (#11189)

ecmadao5707eff9c74a
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index a102bbd941..07a4fea9e4 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -200,10 +200,9 @@ func (s *InstanceService) CreateInstance(ctx context.Context, request *v1pb.Crea
return nil, status.Errorf(codes.Internal, err.Error())
}
}
- for _, ds := range instanceMessage.DataSources {
- if err := s.checkDataSource(instanceMessage, ds); err != nil {
- return nil, err
- }
+
+ if err := s.checkInstanceDataSources(instanceMessage, instanceMessage.DataSources); err != nil {
+ return nil, err
}
principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)
@@ -246,10 +245,28 @@ func (s *InstanceService) CreateInstance(ctx context.Context, request *v1pb.Crea
return convertToInstance(instance)
}
+func (s *InstanceService) checkInstanceDataSources(instance *store.InstanceMessage, dataSources []*store.DataSourceMessage) error {
+ dsIDMap := map[string]bool{}
+ for _, ds := range dataSources {
+ 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)
+ }
+ dsIDMap[ds.ID] = true
+ }
+
+ return nil
+}
+
func (s *InstanceService) checkDataSource(instance *store.InstanceMessage, dataSource *store.DataSourceMessage) error {
+ if dataSource.ID == "" {
+ return status.Errorf(codes.InvalidArgument, "data source id is required")
+ }
password, err := common.Unobfuscate(dataSource.ObfuscatedPassword, s.secret)
if err != nil {
- return err
+ return status.Errorf(codes.Internal, err.Error())
}
if err := s.licenseService.IsFeatureEnabledForInstance(api.FeatureExternalSecretManager, instance); err != nil {
@@ -303,10 +320,8 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, request *v1pb.Upda
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, err.Error())
}
- for _, ds := range datasources {
- if err := s.checkDataSource(instance, ds); err != nil {
- return nil, err
- }
+ if err := s.checkInstanceDataSources(instance, datasources); err != nil {
+ return nil, err
}
patch.DataSources = &datasources
case "activation":
@@ -1050,19 +1065,23 @@ func convertToV1DataSourceExternalSecret(externalSecret *storepb.DataSourceExter
}
resp := &v1pb.DataSourceExternalSecret{
- SecretType: secret.SecretType,
- Url: secret.Url,
- AuthType: secret.AuthType,
- EngineName: secret.EngineName,
- SecretName: secret.SecretName,
- KeyName: secret.KeyName,
+ SecretType: secret.SecretType,
+ Url: secret.Url,
+ AuthType: secret.AuthType,
+ EngineName: secret.EngineName,
+ SecretName: secret.SecretName,
+ PasswordKeyName: secret.PasswordKeyName,
}
// clear sensitive data.
switch resp.AuthType {
case v1pb.DataSourceExternalSecret_APP_ROLE:
+ appRole := secret.GetAppRole()
resp.AuthOption = &v1pb.DataSourceExternalSecret_AppRole{
- AppRole: &v1pb.DataSourceExternalSecret_AppRoleAuthOption{},
+ AppRole: &v1pb.DataSourceExternalSecret_AppRoleAuthOption{
+ Type: appRole.Type,
+ MountPath: appRole.MountPath,
+ },
}
case v1pb.DataSourceExternalSecret_TOKEN:
resp.AuthOption = &v1pb.DataSourceExternalSecret_Token{
@@ -1116,6 +1135,19 @@ func convertToStoreDataSourceExternalSecret(externalSecret *v1pb.DataSourceExter
if err := convertV1PbToStorePb(externalSecret, secret); err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert external secret with error: %v", err.Error())
}
+ if secret.Url == "" {
+ return nil, status.Errorf(codes.InvalidArgument, "missing Vault URL")
+ }
+
+ switch secret.AuthType {
+ case storepb.DataSourceExternalSecret_TOKEN:
+ case storepb.DataSourceExternalSecret_APP_ROLE:
+ if secret.GetAppRole() == nil {
+ return nil, status.Errorf(codes.InvalidArgument, "missing Vault app role")
+ }
+ default:
+ return nil, status.Errorf(codes.InvalidArgument, "unsupport auth type: %v", secret.AuthType)
+ }
return secret, nil
}
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index 022ba0d23d..9fa7a5e31f 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -172,7 +172,8 @@ func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.Ins
if err != nil {
return nil, err
}
- updatedPassword, err := secret.ReplaceExternalSecret(password)
+
+ updatedPassword, err := secret.ReplaceExternalSecret(ctx, password, dataSource.ExternalSecret)
if err != nil {
return nil, err
}
diff --git a/backend/component/ghost/config.go b/backend/component/ghost/config.go
index 587793b9fa..0927361f71 100644
--- a/backend/component/ghost/config.go
+++ b/backend/component/ghost/config.go
@@ -1,6 +1,7 @@
package ghost
import (
+ "context"
"fmt"
"strconv"
"strings"
@@ -212,12 +213,12 @@ func GetPostponeFlagFilename(taskID int, taskCreatedTs int64, databaseID int, da
}
// NewMigrationContext is the context for gh-ost migration.
-func NewMigrationContext(taskID int, taskCreatedTs int64, database *store.DatabaseMessage, dataSource *store.DataSourceMessage, secret string, tableName string, statement string, noop bool, flags map[string]string, serverIDOffset uint) (*base.MigrationContext, error) {
+func NewMigrationContext(ctx context.Context, taskID int, taskCreatedTs int64, database *store.DatabaseMessage, dataSource *store.DataSourceMessage, secret string, tableName string, statement string, noop bool, flags map[string]string, serverIDOffset uint) (*base.MigrationContext, error) {
password, err := common.Unobfuscate(dataSource.ObfuscatedPassword, secret)
if err != nil {
return nil, errors.Wrapf(err, "failed to get password")
}
- updatedPassword, err := secretcomp.ReplaceExternalSecret(password)
+ updatedPassword, err := secretcomp.ReplaceExternalSecret(ctx, password, dataSource.ExternalSecret)
if err != nil {
return nil, err
}
diff --git a/backend/component/secret/secret.go b/backend/component/secret/secret.go
index 05e2b3a3f6..dc29d2f989 100644
--- a/backend/component/secret/secret.go
+++ b/backend/component/secret/secret.go
@@ -2,6 +2,7 @@
package secret
import (
+ "context"
"encoding/base64"
"encoding/json"
"net/http"
@@ -9,12 +10,23 @@ import (
"strings"
"github.com/pkg/errors"
+
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
var secretCache = make(map[string]string)
// ReplaceExternalSecret replaces the secret with external secret.
-func ReplaceExternalSecret(secret string) (string, error) {
+func ReplaceExternalSecret(ctx context.Context, secret string, externalSecret *storepb.DataSourceExternalSecret) (string, error) {
+ if externalSecret != nil {
+ // TODO: consider cache?
+ return getSecretFromVault(ctx, externalSecret)
+ }
+
+ return getSecretFromText(secret)
+}
+
+func getSecretFromText(secret string) (string, error) {
ok, secretURL := GetExternalSecretURL(secret)
if !ok {
return secret, nil
diff --git a/backend/component/secret/vault.go b/backend/component/secret/vault.go
new file mode 100644
index 0000000000..c73ef81851
--- /dev/null
+++ b/backend/component/secret/vault.go
@@ -0,0 +1,85 @@
+package secret
+
+import (
+ "context"
+
+ "github.com/pkg/errors"
+
+ vault "github.com/hashicorp/vault/api"
+ "github.com/hashicorp/vault/api/auth/approle"
+
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+)
+
+func getVaultClient(ctx context.Context, externalSecret *storepb.DataSourceExternalSecret) (*vault.Client, error) {
+ config := vault.DefaultConfig()
+ config.Address = externalSecret.Url
+
+ client, err := vault.NewClient(config)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to init vault client: %v", err.Error())
+ }
+
+ var token string
+
+ switch externalSecret.AuthType {
+ case storepb.DataSourceExternalSecret_TOKEN:
+ token = externalSecret.GetToken()
+ case storepb.DataSourceExternalSecret_APP_ROLE:
+ role := externalSecret.GetAppRole()
+ if role == nil {
+ return nil, errors.Errorf("app role is invalid")
+ }
+ appRoleSecret := &approle.SecretID{}
+ switch role.Type {
+ case storepb.DataSourceExternalSecret_AppRoleAuthOption_PLAIN:
+ appRoleSecret.FromString = role.SecretId
+ case storepb.DataSourceExternalSecret_AppRoleAuthOption_ENVIRONMENT:
+ appRoleSecret.FromEnv = role.SecretId
+ }
+
+ opts := []approle.LoginOption{}
+ if role.MountPath != "" {
+ opts = append(opts, approle.WithMountPath(role.MountPath))
+ }
+ appRoleAuth, err := approle.NewAppRoleAuth(
+ role.RoleId,
+ appRoleSecret,
+ opts...,
+ )
+ if err != nil {
+ return nil, err
+ }
+ resp, err := client.Auth().Login(
+ ctx,
+ appRoleAuth,
+ )
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to login with app role: %v", err.Error())
+ }
+ token = resp.Auth.ClientToken
+ }
+
+ client.SetToken(token)
+
+ return client, nil
+}
+
+func getSecretFromVault(ctx context.Context, externalSecret *storepb.DataSourceExternalSecret) (string, error) {
+ client, err := getVaultClient(ctx, externalSecret)
+ if err != nil {
+ return "", err
+ }
+
+ secret, err := client.KVv2(externalSecret.EngineName).Get(ctx, externalSecret.SecretName)
+ if err != nil {
+ return "", errors.Wrapf(err, "failed to get vault secret: %v", err.Error())
+ }
+
+ value, ok := secret.Data[externalSecret.PasswordKeyName].(string)
+ if !ok {
+ return "", errors.Errorf(`failed to get secret value for "%s/%s"`, externalSecret.SecretName, externalSecret.PasswordKeyName)
+ }
+
+ return value, nil
+}
diff --git a/backend/runner/plancheck/ghost_sync_executor.go b/backend/runner/plancheck/ghost_sync_executor.go
index c1bab4e007..8febd68a63 100644
--- a/backend/runner/plancheck/ghost_sync_executor.go
+++ b/backend/runner/plancheck/ghost_sync_executor.go
@@ -102,7 +102,7 @@ func (e *GhostSyncExecutor) Run(ctx context.Context, config *storepb.PlanCheckRu
return nil, common.Wrapf(err, common.Internal, "failed to parse table name from statement, statement: %v", statement)
}
- migrationContext, err := ghost.NewMigrationContext(rand.Intn(10000000), rand.Int63n(10000000), database, adminDataSource, e.secret, tableName, renderedStatement, true, config.GhostFlags, 20000000)
+ migrationContext, err := ghost.NewMigrationContext(ctx, rand.Intn(10000000), rand.Int63n(10000000), database, adminDataSource, e.secret, tableName, renderedStatement, true, config.GhostFlags, 20000000)
if err != nil {
return nil, common.Wrapf(err, common.Internal, "failed to create migration context")
}
diff --git a/backend/runner/taskrun/schema_update_ghost_sync_executor.go b/backend/runner/taskrun/schema_update_ghost_sync_executor.go
index 8ad1af11b9..e3e7c93790 100644
--- a/backend/runner/taskrun/schema_update_ghost_sync_executor.go
+++ b/backend/runner/taskrun/schema_update_ghost_sync_executor.go
@@ -101,7 +101,7 @@ func (exec *SchemaUpdateGhostSyncExecutor) runGhostMigration(ctx context.Context
// To avoid leaking the rendered statement, the error message should use the original statement and not the rendered statement.
renderedStatement := utils.RenderStatement(statement, materials)
- migrationContext, err := ghost.NewMigrationContext(task.ID, task.CreatedTs, database, adminDataSource, exec.secret, tableName, renderedStatement, false, flags, 10000000)
+ migrationContext, err := ghost.NewMigrationContext(ctx, task.ID, task.CreatedTs, database, adminDataSource, exec.secret, tableName, renderedStatement, false, flags, 10000000)
if err != nil {
return true, nil, errors.Wrap(err, "failed to init migrationContext for gh-ost")
}
diff --git a/backend/tests/backup_restore_test.go b/backend/tests/backup_restore_test.go
index 837b955f48..e1c8f07140 100644
--- a/backend/tests/backup_restore_test.go
+++ b/backend/tests/backup_restore_test.go
@@ -436,7 +436,7 @@ func TestPITRToNewDatabaseInAnotherInstance(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: dstConnCfg.Host, Port: dstConnCfg.Port, Username: dstConnCfg.Username}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: dstConnCfg.Host, Port: dstConnCfg.Port, Username: dstConnCfg.Username, Id: "admin"}},
},
})
a.NoError(err)
@@ -584,7 +584,7 @@ func setUpForPITRTest(ctx context.Context, t *testing.T, ctl *controller) (conte
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username, Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/change_history_test.go b/backend/tests/change_history_test.go
index c4a22d2ebc..b3067103f5 100644
--- a/backend/tests/change_history_test.go
+++ b/backend/tests/change_history_test.go
@@ -96,7 +96,7 @@ func TestFilterChangeHistoryByResources(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/data_source_test.go b/backend/tests/data_source_test.go
index ed722bf8c4..1d086ba191 100644
--- a/backend/tests/data_source_test.go
+++ b/backend/tests/data_source_test.go
@@ -178,7 +178,7 @@ func TestExternalSecretManager(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: secretURL}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: secretURL, Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/ghost_test.go b/backend/tests/ghost_test.go
index e99e19a3de..d3a99cf456 100644
--- a/backend/tests/ghost_test.go
+++ b/backend/tests/ghost_test.go
@@ -110,7 +110,7 @@ func TestGhostSchemaUpdate(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
@@ -187,7 +187,7 @@ func TestGhostTenant(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/test",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(port), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(port), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
@@ -205,7 +205,7 @@ func TestGhostTenant(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(port), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(port), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/grouping_change_test.go b/backend/tests/grouping_change_test.go
index b659260a32..32e0487346 100644
--- a/backend/tests/grouping_change_test.go
+++ b/backend/tests/grouping_change_test.go
@@ -155,7 +155,7 @@ func TestCreateDatabaseGroup(t *testing.T) {
Title: prepareInstance.instanceTitle,
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
Activation: true,
},
})
@@ -397,7 +397,7 @@ func TestCreateTableGroup(t *testing.T) {
Title: prepareInstance.instanceTitle,
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
Activation: true,
},
})
@@ -703,7 +703,7 @@ ALTER TABLE singleton ADD COLUMN num INT;`,
Title: prepareInstance.instanceID,
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "root", Password: ""}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "root", Password: "", Id: "admin"}},
Activation: true,
},
})
diff --git a/backend/tests/project_test.go b/backend/tests/project_test.go
index da2cc56510..e9d3ef6fda 100644
--- a/backend/tests/project_test.go
+++ b/backend/tests/project_test.go
@@ -38,7 +38,7 @@ func TestArchiveProject(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/rollback_test.go b/backend/tests/rollback_test.go
index 10afa422de..7dd9f7c1c3 100644
--- a/backend/tests/rollback_test.go
+++ b/backend/tests/rollback_test.go
@@ -47,7 +47,7 @@ func TestCreateRollbackIssueMySQL(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username, Id: "admin"}},
},
})
a.NoError(err)
@@ -196,7 +196,7 @@ func TestCreateRollbackIssueMySQLByPatch(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username, Id: "admin"}},
},
})
a.NoError(err)
@@ -356,7 +356,7 @@ func TestRollbackCanceled(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: connCfg.Host, Port: connCfg.Port, Username: connCfg.Username, Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/schema_update_test.go b/backend/tests/schema_update_test.go
index a8e30cb329..91733f26d2 100644
--- a/backend/tests/schema_update_test.go
+++ b/backend/tests/schema_update_test.go
@@ -87,7 +87,7 @@ func TestSchemaAndDataUpdate(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -434,7 +434,7 @@ func TestVCS(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -788,7 +788,7 @@ func TestVCS_SDL_POSTGRES(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
@@ -1241,7 +1241,7 @@ func TestWildcardInVCSFilePathTemplate(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: environment.Name,
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -1436,7 +1436,7 @@ func TestVCS_SQL_Review(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
@@ -1928,7 +1928,7 @@ CREATE TABLE public.book (
Engine: v1pb.Engine_POSTGRES,
Environment: environment.Name,
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(dbPort), Username: "root"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(dbPort), Username: "root", Id: "admin"}},
},
})
case storepb.Engine_MYSQL:
@@ -1939,7 +1939,7 @@ CREATE TABLE public.book (
Engine: v1pb.Engine_MYSQL,
Environment: environment.Name,
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(dbPort), Username: "root"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(dbPort), Username: "root", Id: "admin"}},
},
})
default:
@@ -2019,7 +2019,7 @@ func TestMarkTaskAsDone(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -2277,7 +2277,7 @@ func TestVCS_SDL_MySQL(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/sensitive_data_test.go b/backend/tests/sensitive_data_test.go
index ab206388cf..7d36e4ce15 100644
--- a/backend/tests/sensitive_data_test.go
+++ b/backend/tests/sensitive_data_test.go
@@ -137,7 +137,7 @@ func TestSensitiveData(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/sql_editor_test.go b/backend/tests/sql_editor_test.go
index 788d8dc2fb..0e3ef88adb 100644
--- a/backend/tests/sql_editor_test.go
+++ b/backend/tests/sql_editor_test.go
@@ -140,7 +140,7 @@ func TestAdminQueryAffectedRows(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "root", Password: ""}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "root", Password: "", Id: "admin"}},
},
})
a.NoError(err)
@@ -152,7 +152,7 @@ func TestAdminQueryAffectedRows(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "root"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "root", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/sql_export_test.go b/backend/tests/sql_export_test.go
index 5ae99d21d1..6bd9dce02e 100644
--- a/backend/tests/sql_export_test.go
+++ b/backend/tests/sql_export_test.go
@@ -109,7 +109,7 @@ func TestSQLExport(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "root", Password: ""}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "root", Password: "", Id: "admin"}},
},
})
a.NoError(err)
@@ -121,7 +121,7 @@ func TestSQLExport(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "root"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "root", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.go
index 039a46d85e..8f14b1ed37 100644
--- a/backend/tests/sql_review_test.go
+++ b/backend/tests/sql_review_test.go
@@ -130,7 +130,7 @@ func TestSQLReviewForPostgreSQL(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
@@ -294,7 +294,7 @@ func TestSQLReviewForMySQL(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/sync_schema_test.go b/backend/tests/sync_schema_test.go
index c72676f2e8..af9ea3c1a6 100644
--- a/backend/tests/sync_schema_test.go
+++ b/backend/tests/sync_schema_test.go
@@ -79,7 +79,7 @@ DROP SCHEMA "schema_a";
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/syncer_test.go b/backend/tests/syncer_test.go
index 02484196f7..c047c4417a 100644
--- a/backend/tests/syncer_test.go
+++ b/backend/tests/syncer_test.go
@@ -191,7 +191,7 @@ func TestSyncerForPostgreSQL(t *testing.T) {
Engine: v1pb.Engine_POSTGRES,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "/tmp", Port: strconv.Itoa(pgPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
@@ -462,7 +462,7 @@ func TestSyncerForMySQL(t *testing.T) {
Engine: v1pb.Engine_MYSQL,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase"}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: "127.0.0.1", Port: strconv.Itoa(mysqlPort), Username: "bytebase", Password: "bytebase", Id: "admin"}},
},
})
a.NoError(err)
diff --git a/backend/tests/tenant_test.go b/backend/tests/tenant_test.go
index 991863ec9b..bc92abdf42 100644
--- a/backend/tests/tenant_test.go
+++ b/backend/tests/tenant_test.go
@@ -82,7 +82,7 @@ func TestTenant(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/test",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -96,7 +96,7 @@ func TestTenant(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -361,7 +361,7 @@ func TestTenantVCS(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/test",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -375,7 +375,7 @@ func TestTenantVCS(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: "environments/prod",
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir, Id: "admin"}},
},
})
a.NoError(err)
@@ -671,7 +671,7 @@ func TestTenantVCS_YAML(t *testing.T) {
Engine: v1pb.Engine_SQLITE,
Environment: testEnvironment.Name,
Activation: true,
- DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir}},
+ DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},
},
})
a.NoError(err)
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
index 6bfed5b74d..c716191fe7 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
@@ -7,7 +7,7 @@
:engine="basicInfo.engine"
:data-source-type="dataSource.type"
/>
- <div class="mt-2 sm:col-span-2 sm:col-start-1">
+ <div class="mt-4 sm:col-span-2 sm:col-start-1">
<label for="username" class="textlabel block">
{{ $t("common.username") }}
</label>
@@ -23,49 +23,254 @@
"
/>
</div>
- <div class="mt-2 sm:col-span-2 sm:col-start-1">
- <div class="flex flex-row items-center space-x-2">
- <label for="password" class="textlabel block">
+ <div class="mt-4 sm:col-span-2 sm:col-start-1">
+ <NRadioGroup
+ v-if="isDev()"
+ class="textlabel mb-2"
+ :value="state.passwordType"
+ @update:value="changePasswordType"
+ >
+ <NRadio value="PLAIN">
+ {{ $t("instance.password-type.password") }}
+ </NRadio>
+ <NRadio value="EXTERNAL_SECRET">
+ {{ $t("instance.password-type.external-secret") }}
+ </NRadio>
+ </NRadioGroup>
+ <div v-if="state.passwordType === 'PLAIN'">
+ <label class="textlabel block">
{{ $t("common.password") }}
</label>
+ <div class="flex space-x-2 text-sm mb-1">
+ <div class="text-gray-400">
+ {{ $t("instance.password-type.password-tip") }}
+ </div>
+ <LearnMoreLink
+ url="https://www.bytebase.com/docs/get-started/instance/#use-secret-manager?source=console"
+ class="ml-1 text-sm"
+ />
+ <FeatureBadge feature="bb.feature.external-secret-manager" />
+ </div>
<NCheckbox
v-if="!isCreating && allowUsingEmptyPassword"
+ :size="'small'"
:checked="dataSource.useEmptyPassword"
:disabled="!allowEdit"
@update:checked="toggleUseEmptyPassword"
>
- {{ $t("common.empty") }}
+ {{ $t("instance.no-password") }}
</NCheckbox>
+ <NInput
+ class="w-full"
+ :input-props="{ autocomplete: 'off' }"
+ :placeholder="
+ dataSource.useEmptyPassword
+ ? $t('instance.no-password')
+ : $t('instance.password-write-only')
+ "
+ :disabled="!allowEdit || dataSource.useEmptyPassword"
+ :value="
+ dataSource.useEmptyPassword
+ ? ''
+ : getSensitiveValue(dataSource.updatedPassword)
+ "
+ @update:value="dataSource.updatedPassword = $event.trim()"
+ />
</div>
- <div class="flex space-x-2 text-sm mb-1">
- <div class="text-gray-400">
- {{ $t("instance.secret-manager-tip") }}
+ <div v-else-if="dataSource.externalSecret" class="space-y-4">
+ <div class="sm:col-span-2 sm:col-start-1">
+ <label class="textlabel block">
+ {{ $t("instance.external-secret.vault-url") }}
+ </label>
+ <BBTextField
+ v-model:value="dataSource.externalSecret.url"
+ :required="true"
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="$t('instance.external-secret.vault-url')"
+ />
+ </div>
+ <!-- App role is not enabled -->
+ <!-- <div class="sm:col-span-2 sm:col-start-1 space-y-2">
+ <label class="textlabel block">
+ {{ $t("instance.external-secret.vault-auth-type.self") }}
+ </label>
+ <NRadioGroup
+ class="textlabel mb-2"
+ :value="dataSource.externalSecret.authType"
+ @update:value="changeExternalSecretAuthType"
+ >
+ <NRadio :value="DataSourceExternalSecret_AuthType.TOKEN">
+ {{ $t("instance.external-secret.vault-auth-type.token.self") }}
+ </NRadio>
+ <NRadio :value="DataSourceExternalSecret_AuthType.APP_ROLE">
+ {{ $t("instance.external-secret.vault-auth-type.app-role.self") }}
+ </NRadio>
+ </NRadioGroup>
+ </div> -->
+ <div
+ v-if="
+ dataSource.externalSecret.authType ===
+ DataSourceExternalSecret_AuthType.TOKEN
+ "
+ class="sm:col-span-2 sm:col-start-1"
+ >
+ <label class="textlabel block">
+ {{ $t("instance.external-secret.vault-auth-type.token.api-token") }}
+ </label>
+ <div class="flex space-x-2 text-sm mb-1">
+ <div class="text-gray-400">
+ {{ $t("instance.external-secret.vault-auth-type.token.tips") }}
+ </div>
+ <LearnMoreLink
+ url="https://developer.hashicorp.com/vault/tutorials/operations/generate-root"
+ class="ml-1 text-sm"
+ />
+ </div>
+ <BBTextField
+ :value="getSensitiveValue(dataSource.externalSecret.token ?? '')"
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="secretInputPlaceholder"
+ @update:value="(val: string) => {
+ const ds = dataSource;
+ ds.externalSecret!.token = val;
+ }"
+ />
+ </div>
+ <div v-else-if="dataSource.externalSecret.appRole" class="space-y-4">
+ <div class="sm:col-span-2 sm:col-start-1">
+ <label class="textlabel block">
+ {{
+ $t("instance.external-secret.vault-auth-type.app-role.role-id")
+ }}
+ </label>
+ <BBTextField
+ :value="
+ getSensitiveValue(dataSource.externalSecret.appRole.roleId)
+ "
+ :required="true"
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="`${$t(
+ 'instance.external-secret.vault-auth-type.app-role.role-id'
+ )} - ${$t('common.write-only')}`"
+ @update:value="(val: string) => {
+ const ds = dataSource;
+ ds.externalSecret!.appRole!.roleId = val;
+ }"
+ />
+ </div>
+ <div class="sm:col-span-2 sm:col-start-1">
+ <label class="textlabel block">
+ {{
+ $t(
+ "instance.external-secret.vault-auth-type.app-role.secret-id"
+ )
+ }}
+ </label>
+ <i18n-t
+ tag="div"
+ keypath="instance.external-secret.vault-auth-type.app-role.secret-tips"
+ class="text-gray-400 text-sm mb-1"
+ >
+ <template #learn_more>
+ <LearnMoreLink
+ url="https://developer.hashicorp.com/vault/tutorials/auth-methods/approle"
+ class="ml-1 text-sm"
+ />
+ </template>
+ </i18n-t>
+ <NRadioGroup
+ v-model:value="dataSource.externalSecret.appRole.type"
+ class="textlabel my-1"
+ >
+ <NRadio
+ :value="
+ DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN
+ "
+ >
+ {{
+ $t(
+ "instance.external-secret.vault-auth-type.app-role.secret-plain-text"
+ )
+ }}
+ </NRadio>
+ <NRadio
+ :value="
+ DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT
+ "
+ >
+ {{
+ $t(
+ "instance.external-secret.vault-auth-type.app-role.secret-env-name"
+ )
+ }}
+ </NRadio>
+ </NRadioGroup>
+ <BBTextField
+ :value="
+ getSensitiveValue(dataSource.externalSecret.appRole.secretId)
+ "
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="secretInputPlaceholder"
+ @update:value="(val: string) => {
+ const ds = dataSource;
+ ds.externalSecret!.appRole!.secretId = val;
+ }"
+ />
+ </div>
+ </div>
+ <div class="sm:col-span-2 sm:col-start-1">
+ <label class="textlabel block">
+ {{ $t("instance.external-secret.vault-secret-engine-name") }}
+ </label>
+ <div class="flex space-x-2 text-sm mb-1 text-gray-400">
+ {{ $t("instance.external-secret.vault-secret-engine-tips") }}
+ </div>
+ <BBTextField
+ v-model:value="dataSource.externalSecret.engineName"
+ :required="true"
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="
+ $t('instance.external-secret.vault-secret-engine-name')
+ "
+ />
+ </div>
+ <div class="sm:col-span-2 sm:col-start-1">
+ <label class="textlabel block">
+ {{ $t("instance.external-secret.vault-secret-name") }}
+ </label>
+ <BBTextField
+ v-model:value="dataSource.externalSecret.secretName"
+ :required="true"
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="$t('instance.external-secret.vault-secret-name')"
+ />
+ </div>
+ <div class="sm:col-span-2 sm:col-start-1">
+ <label class="textlabel block">
+ {{ $t("instance.external-secret.vault-key-name") }}
+ </label>
+ <BBTextField
+ v-model:value="dataSource.externalSecret.passwordKeyName"
+ :required="true"
+ class="mt-1 w-full"
+ :disabled="!allowEdit"
+ :placeholder="$t('instance.external-secret.vault-key-name')"
+ />
</div>
- <LearnMoreLink
- url="https://www.bytebase.com/docs/get-started/instance/#use-secret-manager?source=console"
- class="ml-1 text-sm"
- />
- <FeatureBadge feature="bb.feature.external-secret-manager" />
</div>
- <NInput
- class="mt-1 w-full"
- :input-props="{ autocomplete: 'off' }"
- :placeholder="
- dataSource.useEmptyPassword
- ? $t('instance.no-password')
- : $t('instance.password-write-only')
- "
- :disabled="!allowEdit || dataSource.useEmptyPassword"
- :value="dataSource.useEmptyPassword ? '' : dataSource.updatedPassword"
- @update:value="dataSource.updatedPassword = $event.trim()"
- />
</div>
</template>
<SpannerCredentialInput
v-else
v-model:value="dataSource.updatedPassword"
:write-only="!isCreating"
- class="mt-2 sm:col-span-3 sm:col-start-1"
+ class="mt-4 sm:col-span-3 sm:col-start-1"
/>
<template v-if="basicInfo.engine === Engine.ORACLE">
@@ -77,8 +282,10 @@
</template>
<template v-if="basicInfo.engine === Engine.SNOWFLAKE">
- <div class="mt-2 sm:col-span-2 sm:col-start-1">
- <div class="textlabel block">{{ $t("data-source.ssh.private-key") }}</div>
+ <div class="mt-4 sm:col-span-2 sm:col-start-1">
+ <div class="textlabel block">
+ {{ $t("data-source.ssh.private-key") }}
+ </div>
<div class="flex space-x-2 text-sm mb-1">
<div class="text-gray-400">
{{ $t("data-source.snowflake-keypair-tip") }}
@@ -127,7 +334,7 @@ MIIEvQ...
>
<div
v-if="hasReadonlyReplicaHost"
- class="mt-2 sm:col-span-2 sm:col-start-1"
+ class="mt-4 sm:col-span-2 sm:col-start-1"
>
<div class="flex flex-row items-center space-x-2">
<label for="host" class="textlabel block">
@@ -144,7 +351,7 @@ MIIEvQ...
<div
v-if="hasReadonlyReplicaPort"
- class="mt-2 sm:col-span-2 sm:col-start-1"
+ class="mt-4 sm:col-span-2 sm:col-start-1"
>
<div class="flex flex-row items-center space-x-2">
<label for="port" class="textlabel block">
@@ -161,7 +368,7 @@ MIIEvQ...
</div>
</template>
- <div v-if="showDatabase" class="mt-2 sm:col-span-2 sm:col-start-1">
+ <div v-if="showDatabase" class="mt-4 sm:col-span-2 sm:col-start-1">
<label for="database" class="textlabel block">
{{ $t("common.database") }}
</label>
@@ -173,7 +380,7 @@ MIIEvQ...
/>
</div>
- <div v-if="showSSL" class="mt-2 sm:col-span-3 sm:col-start-1">
+ <div v-if="showSSL" class="mt-4 sm:col-span-3 sm:col-start-1">
<div class="flex flex-row items-center">
<label for="ssl" class="textlabel block">
{{ $t("data-source.ssl-connection") }}
@@ -196,7 +403,7 @@ MIIEvQ...
</template>
<template v-else>
<NButton
- class="!mt-2"
+ class="!mt-4"
:disabled="!allowEdit"
@click.prevent="handleEditSSL"
>
@@ -206,7 +413,7 @@ MIIEvQ...
</template>
</div>
- <div v-if="showSSH" class="mt-2 sm:col-span-3 sm:col-start-1">
+ <div v-if="showSSH" class="mt-4 sm:col-span-3 sm:col-start-1">
<div class="flex flex-row items-center gap-x-1">
<label for="ssh" class="textlabel block">
{{ $t("data-source.ssh-connection") }}
@@ -233,7 +440,7 @@ MIIEvQ...
</template>
<template v-else>
<NButton
- class="!mt-2"
+ class="!mt-4"
:disabled="!allowEdit"
@click.prevent="handleEditSSH"
>
@@ -246,12 +453,20 @@ MIIEvQ...
<script setup lang="ts">
/* eslint-disable vue/no-mutating-props */
-import { NButton, NCheckbox, NInput } from "naive-ui";
-import { watch } from "vue";
+import { NButton, NRadioGroup, NRadio, NCheckbox, NInput } from "naive-ui";
+import { watch, reactive, computed } from "vue";
+import { useI18n } from "vue-i18n";
import { DataSourceOptions } from "@/types/dataSource";
import { Engine } from "@/types/proto/v1/common";
-import { DataSource, DataSourceType } from "@/types/proto/v1/instance_service";
-import { onlyAllowNumber } from "@/utils";
+import {
+ DataSource,
+ DataSourceType,
+ DataSourceExternalSecret,
+ DataSourceExternalSecret_AuthType,
+ DataSourceExternalSecret_SecretType,
+ DataSourceExternalSecret_AppRoleAuthOption_SecretType,
+} from "@/types/proto/v1/instance_service";
+import { onlyAllowNumber, isDev } from "@/utils";
import { EditDataSource } from "../common";
import { useInstanceFormContext } from "../context";
import { useInstanceSpecs } from "../specs";
@@ -259,9 +474,14 @@ import SpannerCredentialInput from "./SpannerCredentialInput.vue";
import SshConnectionForm from "./SshConnectionForm.vue";
import SslCertificateForm from "./SslCertificateForm.vue";
+interface LocalState {
+ passwordType: "PLAIN" | "EXTERNAL_SECRET";
+}
+
const props = defineProps<{
dataSource: EditDataSource;
}>();
+
const {
instance,
isCreating,
@@ -282,6 +502,93 @@ const {
hasReadonlyReplicaPort,
} = useInstanceSpecs();
+const state = reactive<LocalState>({
+ passwordType: "PLAIN",
+});
+const { t } = useI18n();
+
+watch(
+ () => props.dataSource.externalSecret,
+ (externalSecret) => {
+ if (externalSecret) {
+ state.passwordType = "EXTERNAL_SECRET";
+ } else {
+ state.passwordType = "PLAIN";
+ }
+ },
+ { immediate: true, deep: true }
+);
+
+const secretInputPlaceholder = computed(() => {
+ switch (state.passwordType) {
+ case "PLAIN":
+ return `${t("common.password")} - ${t("common.write-only")}`;
+ case "EXTERNAL_SECRET":
+ switch (props.dataSource.externalSecret?.authType) {
+ case DataSourceExternalSecret_AuthType.TOKEN:
+ return `${t(
+ "instance.external-secret.vault-auth-type.token.api-token"
+ )} - ${t("common.write-only")}`;
+ case DataSourceExternalSecret_AuthType.APP_ROLE:
+ switch (props.dataSource.externalSecret.appRole?.type) {
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN:
+ return `${t(
+ "instance.external-secret.vault-auth-type.app-role.secret-id-plain-text"
+ )} - ${t("common.write-only")}`;
+ case DataSourceExternalSecret_AppRoleAuthOption_SecretType.ENVIRONMENT:
+ return `${t(
+ "instance.external-secret.vault-auth-type.app-role.secret-id-environment"
+ )} - ${t("common.write-only")}`;
+ }
+ }
+ }
+
+ return "";
+});
+
+const getSensitiveValue = (val: string) => {
+ return Array.from({ length: val.length })
+ .map((_) => "*")
+ .join("");
+};
+
+const changePasswordType = (passwordType: "PLAIN" | "EXTERNAL_SECRET") => {
+ const ds = props.dataSource;
+ if (passwordType === "EXTERNAL_SECRET") {
+ ds.externalSecret = DataSourceExternalSecret.fromPartial(
+ ds.externalSecret ?? {
+ authType: DataSourceExternalSecret_AuthType.TOKEN,
+ secretType: DataSourceExternalSecret_SecretType.VAULT_KV_V2,
+ token: "",
+ }
+ );
+ } else {
+ ds.externalSecret = undefined;
+ }
+ state.passwordType = passwordType;
+};
+
+// TODO: support change auth type.
+// const changeExternalSecretAuthType = (
+// authType: DataSourceExternalSecret_AuthType
+// ) => {
+// const ds = props.dataSource;
+// if (!ds.externalSecret) {
+// return;
+// }
+// if (authType === DataSourceExternalSecret_AuthType.APP_ROLE) {
+// ds.externalSecret.appRole =
+// DataSourceExternalSecret_AppRoleAuthOption.fromPartial({
+// type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN,
+// });
+// ds.externalSecret.token = undefined;
+// } else {
+// ds.externalSecret.token = "";
+// ds.externalSecret.appRole = undefined;
+// }
+// ds.externalSecret.authType = authType;
+// };
+
const toggleUseEmptyPassword = (on: boolean) => {
const ds = props.dataSource;
ds.useEmptyPassword = on;
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/SslCertificateForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/SslCertificateForm.vue
index fc73363c23..6454008415 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/SslCertificateForm.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/SslCertificateForm.vue
@@ -61,7 +61,7 @@
<script lang="ts" setup>
import { cloneDeep } from "lodash-es";
import { NTabs, NTabPane, NRadio, NRadioGroup } from "naive-ui";
-import { PropType, reactive, watch } from "vue";
+import { reactive, watch } from "vue";
import { useI18n } from "vue-i18n";
import DroppableTextarea from "@/components/misc/DroppableTextarea.vue";
import { Engine } from "@/types/proto/v1/common";
@@ -77,16 +77,10 @@ type LocalState = {
tab: "CA" | "KEY" | "CERT";
};
-const props = defineProps({
- value: {
- type: Object as PropType<WithSslOptions>,
- required: true,
- },
- engineType: {
- type: Object as PropType<Engine>,
- required: true,
- },
-});
+const props = defineProps<{
+ value: WithSslOptions;
+ engineType: Engine;
+}>();
const emit = defineEmits<{
(e: "change", value: WithSslOptions): void;
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 0c172d711f..c22a6da5a7 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1339,7 +1339,36 @@
"type-or-paste-credentials": "Type or paste CREDENTIALS",
"type-or-paste-credentials-write-only": "Type or paste CREDENTIALS - write only",
"password-write-only": "YOUR_DB_PWD - write only",
- "secret-manager-tip": "You can also specify external secret manage endpoint",
+ "password-type": {
+ "password": "Password",
+ "password-tip": "You can also specify external secret manage endpoint",
+ "external-secret": "External secret (Vault)"
+ },
+ "external-secret": {
+ "vault-url": "Vault URL",
+ "vault-auth-type": {
+ "self": "Vault auth type",
+ "token": {
+ "self": "Token",
+ "api-token": "Vault API token",
+ "tips": "A root token without TTL."
+ },
+ "app-role": {
+ "self": "App role",
+ "role-id": "Auth role id",
+ "secret-id": "Auth secret id",
+ "secret-id-plain-text": "Plain text for role secret id",
+ "secret-id-environment": "Environment name for role secret id",
+ "secret-plain-text": "Plain text",
+ "secret-env-name": "Environment name",
+ "secret-tips": "An unwrapped secret id without TTL. You can use plain text, or put it into the environment or local file. {learn_more}"
+ }
+ },
+ "vault-secret-engine-name": "Vault secret engine name",
+ "vault-secret-engine-tips": "Only support KV v2 engine.",
+ "vault-secret-name": "Vault secret name",
+ "vault-key-name": "Vault key name for password"
+ },
"test-connection": "Test Connection",
"ignore-and-create": "Ignore and create",
"add-a-postgresql-sample-instance": "Add a PostgreSQL sample instance instead",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 05ad3d41af..428e5e7b31 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1339,7 +1339,36 @@
"type-or-paste-credentials": "Escriba o pegue las CREDENCIALES",
"type-or-paste-credentials-write-only": "Escriba o pegue las CREDENCIALES - solo escritura",
"password-write-only": "SU_DB_PWD - solo escritura",
- "secret-manager-tip": "También puede especificar un punto final de gestión de secreto externo",
+ "password-type": {
+ "password": "Contraseña",
+ "password-tip": "También puede especificar un punto final de gestión de secreto externo",
+ "external-secret": "Secreto externo (Vault)"
+ },
+ "external-secret": {
+ "vault-url": "Vault URL",
+ "vault-auth-type": {
+ "self": "Vault auth type",
+ "token": {
+ "self": "Simbólico",
+ "api-token": "Vault API token",
+ "tips": "Un token raíz sin TTL."
+ },
+ "app-role": {
+ "self": "App role",
+ "role-id": "Auth role id",
+ "secret-id": "Auth secret id",
+ "secret-id-plain-text": "Texto sin formato para identificación secreta de rol",
+ "secret-id-environment": "Nombre del entorno para la identificación secreta del rol",
+ "secret-plain-text": "Texto sin formato",
+ "secret-env-name": "Nombre del entorno",
+ "secret-tips": "Una identificación secreta desenvuelta sin TTL. Puede utilizar texto sin formato o colocarlo en el entorno o en el archivo local. {learn_more}"
+ }
+ },
+ "vault-secret-engine-name": "Vault secret engine name",
+ "vault-secret-engine-tips": "Solo admite motor KV v2.",
+ "vault-secret-name": "Vault secret name",
+ "vault-key-name": "Vault key name for password"
+ },
"test-connection": "Probar conexión",
"ignore-and-create": "Ignorar y crear",
"add-a-postgresql-sample-instance": "Agregue una instancia de muestra de PostgreSQL en su lugar",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index a8437099d4..9c1ebea312 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1339,7 +1339,36 @@
"type-or-paste-credentials": "CREDENTIALS を入力または貼り付けしてください - 書き込みのみ",
"type-or-paste-credentials-write-only": "YOUR_DB_PWD - 書き込みのみ",
"password-write-only": "外部シークレット管理エンドポイントを指定することもできます",
- "secret-manager-tip": "接続をテストする",
+ "password-type": {
+ "password": "パスワード",
+ "password-tip": "外部シークレット管理エンドポイントを指定することもできます",
+ "external-secret": "外部シークレット (Vault)"
+ },
+ "external-secret": {
+ "vault-url": "Vault URL",
+ "vault-auth-type": {
+ "self": "Vault auth type",
+ "token": {
+ "self": "Token",
+ "api-token": "Vault API token",
+ "tips": "TTL のないルート トークン。"
+ },
+ "app-role": {
+ "self": "App role",
+ "role-id": "Auth role id",
+ "secret-id": "Auth secret id",
+ "secret-id-plain-text": "ロールシークレットIDのプレーンテキスト",
+ "secret-id-environment": "ロールシークレットIDの環境名",
+ "secret-plain-text": "プレーンテキスト",
+ "secret-env-name": "環境名",
+ "secret-tips": "TTL なしのラップされていないシークレット ID。 プレーン テキストを使用することも、環境ファイルまたはローカル ファイルに置くこともできます。{learn_more}"
+ }
+ },
+ "vault-secret-engine-name": "Vault secret engine name",
+ "vault-secret-engine-tips": "KV v2 エンジンのみをサポートします。",
+ "vault-secret-name": "Vault secret name",
+ "vault-key-name": "Vault key name for password"
+ },
"test-connection": "無視して作成する",
"ignore-and-create": "代わりに PostgreSQL のサンプルインスタンスを追加する",
"add-a-postgresql-sample-instance": "PostgreSQL のサンプルインスタンスが正常に追加され、接続情報が入力されました。",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 9da1b4bd37..1e7413bb60 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1339,7 +1339,36 @@
"type-or-paste-credentials": "Nhập hoặc dán THÔNG TIN XÁC NHẬN",
"type-or-paste-credentials-write-only": "Nhập hoặc dán THÔNG TIN XÁC NHẬN - chỉ viết",
"password-write-only": "YOUR_DB_PWD - chỉ viết",
- "secret-manager-tip": "Bạn cũng có thể chỉ định điểm cuối quản lý bí mật bên ngoài",
+ "password-type": {
+ "password": "Mật khẩu",
+ "password-tip": "Bạn cũng có thể chỉ định điểm cuối quản lý bí mật bên ngoài",
+ "external-secret": "Bí mật bên ngoài (Vault)"
+ },
+ "external-secret": {
+ "vault-url": "Vault URL",
+ "vault-auth-type": {
+ "self": "Vault auth type",
+ "token": {
+ "self": "Token",
+ "api-token": "Vault API token",
+ "tips": "Mã thông báo gốc không có TTL."
+ },
+ "app-role": {
+ "self": "App role",
+ "role-id": "Auth role id",
+ "secret-id": "Auth secret id",
+ "secret-id-plain-text": "Văn bản thuần túy cho id bí mật của vai trò",
+ "secret-id-environment": "Tên môi trường cho id bí mật vai trò",
+ "secret-plain-text": "Văn bản thô",
+ "secret-env-name": "Tên môi trường",
+ "secret-tips": "Một id bí mật chưa được gói mà không có TTL. Bạn có thể sử dụng văn bản thuần túy hoặc đặt nó vào môi trường hoặc tệp cục bộ. {learn_more}"
+ }
+ },
+ "vault-secret-engine-name": "Vault secret engine name",
+ "vault-secret-engine-tips": "Chỉ hỗ trợ động cơ KV v2.",
+ "vault-secret-name": "Vault secret name",
+ "vault-key-name": "Vault key name for password"
+ },
"test-connection": "Kiểm tra kết nối",
"ignore-and-create": "Bỏ qua và tạo",
"add-a-postgresql-sample-instance": "Thay vào đó, hãy thêm một phiên bản mẫu PostgreSQL",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 45e57c1211..d5202b4eca 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1338,7 +1338,36 @@
"type-or-paste-credentials": "输入或粘贴 CREDENTIALS",
"type-or-paste-credentials-write-only": "输入或粘贴 CREDENTIALS - 仅写入",
"password-write-only": "YOUR_DB_PWD - 仅写入",
- "secret-manager-tip": "您也可以指定外部的密码管理服务 endpoint",
+ "password-type": {
+ "password": "密码",
+ "password-tip": "您也可以指定外部的密码管理服务 endpoint",
+ "external-secret": "外部密码管理 (Vault)"
+ },
+ "external-secret": {
+ "vault-url": "Vault URL",
+ "vault-auth-type": {
+ "self": "Vault 验证方式",
+ "token": {
+ "self": "Token",
+ "api-token": "Vault API token",
+ "tips": "没有过期时限的根 token"
+ },
+ "app-role": {
+ "self": "App role",
+ "role-id": "Auth role id",
+ "secret-id": "Auth secret id",
+ "secret-id-plain-text": "Secret id 明文",
+ "secret-id-environment": "储存 secret id 的环境变量名",
+ "secret-plain-text": "明文",
+ "secret-env-name": "环境变量名",
+ "secret-tips": "未封装、无有效期限的 secret id,您可以使用明文、环境变量名或文件路径。{learn_more}"
+ }
+ },
+ "vault-secret-engine-name": "Vault secret engine name",
+ "vault-secret-engine-tips": "仅支持 KV v2 储存",
+ "vault-secret-name": "Vault secret name",
+ "vault-key-name": "Vault key name for password"
+ },
"test-connection": "测试连接",
"ignore-and-create": "忽略并创建",
"add-a-postgresql-sample-instance": "添加一个 PostgreSQL 样本实例",
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
index dbdf7a289a..b87dbf5bac 100644
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ b/frontend/src/types/proto/google/protobuf/struct.ts
@@ -8,7 +8,7 @@ export const protobufPackage = "google.protobuf";
* `NullValue` is a singleton enumeration to represent the null value for the
* `Value` type union.
*
- * The JSON representation for `NullValue` is JSON `null`.
+ * The JSON representation for `NullValue` is JSON `null`.
*/
export enum NullValue {
/** NULL_VALUE - Null value. */
diff --git a/frontend/src/types/proto/google/protobuf/timestamp.ts b/frontend/src/types/proto/google/protobuf/timestamp.ts
index 51695e08d0..5781891bc0 100644
--- a/frontend/src/types/proto/google/protobuf/timestamp.ts
+++ b/frontend/src/types/proto/google/protobuf/timestamp.ts
@@ -92,7 +92,7 @@ export const protobufPackage = "google.protobuf";
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
- * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.
*/
export interface Timestamp {
diff --git a/frontend/src/types/proto/store/data_source.ts b/frontend/src/types/proto/store/data_source.ts
index e0fa75970b..19ced14d28 100644
--- a/frontend/src/types/proto/store/data_source.ts
+++ b/frontend/src/types/proto/store/data_source.ts
@@ -17,11 +17,12 @@ export interface DataSourceExternalSecret {
/** the secret name in the engine to store the password. */
secretName: string;
/** the key name for the password. */
- keyName: string;
+ passwordKeyName: string;
}
export enum DataSourceExternalSecret_SecretType {
SAECRET_TYPE_UNSPECIFIED = 0,
+ /** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
VAULT_KV_V2 = 1,
UNRECOGNIZED = -1,
}
@@ -55,7 +56,9 @@ export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExte
export enum DataSourceExternalSecret_AuthType {
AUTH_TYPE_UNSPECIFIED = 0,
+ /** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
TOKEN = 1,
+ /** APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
APP_ROLE = 2,
UNRECOGNIZED = -1,
}
@@ -92,10 +95,56 @@ export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExtern
}
}
-/** app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle */
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 = 0,
+ PLAIN = 1,
+ ENVIRONMENT = 2,
+ UNRECOGNIZED = -1,
+}
+
+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 interface DataSourceOptions {
@@ -136,7 +185,7 @@ function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
token: undefined,
engineName: "",
secretName: "",
- keyName: "",
+ passwordKeyName: "",
};
}
@@ -163,8 +212,8 @@ export const DataSourceExternalSecret = {
if (message.secretName !== "") {
writer.uint32(58).string(message.secretName);
}
- if (message.keyName !== "") {
- writer.uint32(66).string(message.keyName);
+ if (message.passwordKeyName !== "") {
+ writer.uint32(66).string(message.passwordKeyName);
}
return writer;
},
@@ -230,7 +279,7 @@ export const DataSourceExternalSecret = {
break;
}
- message.keyName = reader.string();
+ message.passwordKeyName = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -250,7 +299,7 @@ export const DataSourceExternalSecret = {
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) : "",
- keyName: isSet(object.keyName) ? globalThis.String(object.keyName) : "",
+ passwordKeyName: isSet(object.passwordKeyName) ? globalThis.String(object.passwordKeyName) : "",
};
},
@@ -277,8 +326,8 @@ export const DataSourceExternalSecret = {
if (message.secretName !== "") {
obj.secretName = message.secretName;
}
- if (message.keyName !== "") {
- obj.keyName = message.keyName;
+ if (message.passwordKeyName !== "") {
+ obj.passwordKeyName = message.passwordKeyName;
}
return obj;
},
@@ -297,13 +346,13 @@ export const DataSourceExternalSecret = {
message.token = object.token ?? undefined;
message.engineName = object.engineName ?? "";
message.secretName = object.secretName ?? "";
- message.keyName = object.keyName ?? "";
+ message.passwordKeyName = object.passwordKeyName ?? "";
return message;
},
};
function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
- return { roleId: "", secretId: "" };
+ return { roleId: "", secretId: "", type: 0, mountPath: "" };
}
export const DataSourceExternalSecret_AppRoleAuthOption = {
@@ -314,6 +363,12 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
writer.uint32(18).string(message.secretId);
}
+ if (message.type !== 0) {
+ writer.uint32(24).int32(message.type);
+ }
+ if (message.mountPath !== "") {
+ writer.uint32(34).string(message.mountPath);
+ }
return writer;
},
@@ -338,6 +393,20 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
message.secretId = reader.string();
continue;
+ case 3:
+ if (tag !== 24) {
+ break;
+ }
+
+ message.type = reader.int32() as any;
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.mountPath = reader.string();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -351,6 +420,8 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
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) : 0,
+ mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
};
},
@@ -362,6 +433,12 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
obj.secretId = message.secretId;
}
+ if (message.type !== 0) {
+ obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
+ }
+ if (message.mountPath !== "") {
+ obj.mountPath = message.mountPath;
+ }
return obj;
},
@@ -374,6 +451,8 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
message.roleId = object.roleId ?? "";
message.secretId = object.secretId ?? "";
+ message.type = object.type ?? 0;
+ message.mountPath = object.mountPath ?? "";
return message;
},
};
diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.ts
index 30ed03f758..86eefedaef 100644
--- a/frontend/src/types/proto/v1/instance_service.ts
+++ b/frontend/src/types/proto/v1/instance_service.ts
@@ -289,11 +289,12 @@ export interface DataSourceExternalSecret {
/** the secret name in the engine to store the password. */
secretName: string;
/** the key name for the password. */
- keyName: string;
+ passwordKeyName: string;
}
export enum DataSourceExternalSecret_SecretType {
SAECRET_TYPE_UNSPECIFIED = 0,
+ /** VAULT_KV_V2 - ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 */
VAULT_KV_V2 = 1,
UNRECOGNIZED = -1,
}
@@ -327,7 +328,9 @@ export function dataSourceExternalSecret_SecretTypeToJSON(object: DataSourceExte
export enum DataSourceExternalSecret_AuthType {
AUTH_TYPE_UNSPECIFIED = 0,
+ /** TOKEN - ref: https://developer.hashicorp.com/vault/docs/auth/token */
TOKEN = 1,
+ /** APP_ROLE - ref: https://developer.hashicorp.com/vault/docs/auth/approle */
APP_ROLE = 2,
UNRECOGNIZED = -1,
}
@@ -364,10 +367,56 @@ export function dataSourceExternalSecret_AuthTypeToJSON(object: DataSourceExtern
}
}
-/** app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle */
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 = 0,
+ PLAIN = 1,
+ ENVIRONMENT = 2,
+ UNRECOGNIZED = -1,
+}
+
+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 interface DataSource {
@@ -1952,7 +2001,7 @@ function createBaseDataSourceExternalSecret(): DataSourceExternalSecret {
token: undefined,
engineName: "",
secretName: "",
- keyName: "",
+ passwordKeyName: "",
};
}
@@ -1979,8 +2028,8 @@ export const DataSourceExternalSecret = {
if (message.secretName !== "") {
writer.uint32(58).string(message.secretName);
}
- if (message.keyName !== "") {
- writer.uint32(66).string(message.keyName);
+ if (message.passwordKeyName !== "") {
+ writer.uint32(66).string(message.passwordKeyName);
}
return writer;
},
@@ -2046,7 +2095,7 @@ export const DataSourceExternalSecret = {
break;
}
- message.keyName = reader.string();
+ message.passwordKeyName = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2066,7 +2115,7 @@ export const DataSourceExternalSecret = {
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) : "",
- keyName: isSet(object.keyName) ? globalThis.String(object.keyName) : "",
+ passwordKeyName: isSet(object.passwordKeyName) ? globalThis.String(object.passwordKeyName) : "",
};
},
@@ -2093,8 +2142,8 @@ export const DataSourceExternalSecret = {
if (message.secretName !== "") {
obj.secretName = message.secretName;
}
- if (message.keyName !== "") {
- obj.keyName = message.keyName;
+ if (message.passwordKeyName !== "") {
+ obj.passwordKeyName = message.passwordKeyName;
}
return obj;
},
@@ -2113,13 +2162,13 @@ export const DataSourceExternalSecret = {
message.token = object.token ?? undefined;
message.engineName = object.engineName ?? "";
message.secretName = object.secretName ?? "";
- message.keyName = object.keyName ?? "";
+ message.passwordKeyName = object.passwordKeyName ?? "";
return message;
},
};
function createBaseDataSourceExternalSecret_AppRoleAuthOption(): DataSourceExternalSecret_AppRoleAuthOption {
- return { roleId: "", secretId: "" };
+ return { roleId: "", secretId: "", type: 0, mountPath: "" };
}
export const DataSourceExternalSecret_AppRoleAuthOption = {
@@ -2130,6 +2179,12 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
writer.uint32(18).string(message.secretId);
}
+ if (message.type !== 0) {
+ writer.uint32(24).int32(message.type);
+ }
+ if (message.mountPath !== "") {
+ writer.uint32(34).string(message.mountPath);
+ }
return writer;
},
@@ -2154,6 +2209,20 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
message.secretId = reader.string();
continue;
+ case 3:
+ if (tag !== 24) {
+ break;
+ }
+
+ message.type = reader.int32() as any;
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.mountPath = reader.string();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -2167,6 +2236,8 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
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) : 0,
+ mountPath: isSet(object.mountPath) ? globalThis.String(object.mountPath) : "",
};
},
@@ -2178,6 +2249,12 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
if (message.secretId !== "") {
obj.secretId = message.secretId;
}
+ if (message.type !== 0) {
+ obj.type = dataSourceExternalSecret_AppRoleAuthOption_SecretTypeToJSON(message.type);
+ }
+ if (message.mountPath !== "") {
+ obj.mountPath = message.mountPath;
+ }
return obj;
},
@@ -2190,6 +2267,8 @@ export const DataSourceExternalSecret_AppRoleAuthOption = {
const message = createBaseDataSourceExternalSecret_AppRoleAuthOption();
message.roleId = object.roleId ?? "";
message.secretId = object.secretId ?? "";
+ message.type = object.type ?? 0;
+ message.mountPath = object.mountPath ?? "";
return message;
},
};
diff --git a/go.mod b/go.mod
index db4e276c5e..4383d4bb3a 100644
--- a/go.mod
+++ b/go.mod
@@ -37,6 +37,8 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1
github.com/hashicorp/golang-lru/v2 v2.0.7
+ github.com/hashicorp/vault/api v1.12.1
+ github.com/hashicorp/vault/api/auth/approle v0.6.0
github.com/improbable-eng/grpc-web v0.15.0
github.com/jackc/pgtype v1.14.2
github.com/jackc/pgx/v5 v5.5.4
@@ -101,6 +103,7 @@ require (
github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 // indirect
github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab // indirect
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
+ github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/cloudfoundry/gosigar v1.3.6 // indirect
github.com/cockroachdb/errors v1.8.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
@@ -114,6 +117,7 @@ require (
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect
+ github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-zookeeper/zk v1.0.1 // indirect
@@ -126,7 +130,16 @@ require (
github.com/google/s2a-go v0.1.7 // indirect
github.com/gorilla/sessions v1.2.2 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
+ github.com/hashicorp/errwrap v1.1.0 // indirect
+ github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
+ github.com/hashicorp/go-multierror v1.1.1 // indirect
+ github.com/hashicorp/go-retryablehttp v0.6.6 // indirect
+ github.com/hashicorp/go-rootcerts v1.0.2 // indirect
+ github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
+ github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
+ github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
+ github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
@@ -139,6 +152,8 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
+ github.com/mitchellh/go-homedir v1.1.0 // indirect
+ github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
@@ -148,6 +163,7 @@ require (
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
+ github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/swaggo/files/v2 v2.0.0 // indirect
diff --git a/go.sum b/go.sum
index 7d4f36b71c..ced40f04a5 100644
--- a/go.sum
+++ b/go.sum
@@ -178,6 +178,8 @@ github.com/bytebase/tsql-parser v0.0.0-20231019070007-fc13b1c3c56d h1:ZONgYtlZ74
github.com/bytebase/tsql-parser v0.0.0-20231019070007-fc13b1c3c56d/go.mod h1:RGdpxRQZHTqMjTKZUKGGZduIXu2lPyboIuWsqV7drX8=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
+github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c=
+github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs=
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
@@ -289,6 +291,8 @@ github.com/epiclabs-io/diff3 v0.0.0-20181217103619-05282cece609/go.mod h1:tM499Z
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
+github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
+github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
@@ -325,6 +329,8 @@ github.com/go-faster/errors v0.7.0/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7F
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
+github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
+github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
@@ -369,6 +375,8 @@ github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
+github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-zookeeper/zk v1.0.1 h1:LmXNmSnkNsNKai+aDu6sHRr8ZJzIrHJo8z8Z4sm8cT8=
github.com/go-zookeeper/zk v1.0.1/go.mod h1:gpJdHazfkmlg4V0rt0vYeHYJHSL8hHFwV0qOd+HRTJE=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
@@ -448,6 +456,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -503,12 +512,32 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NM
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
+github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
+github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
+github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
+github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
+github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
+github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs=
+github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
+github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
+github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
+github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
+github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
+github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
+github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
+github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ=
+github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8=
+github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U=
+github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts=
+github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4=
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
+github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=
+github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@@ -521,11 +550,17 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
+github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
+github.com/hashicorp/vault/api v1.12.0/go.mod h1:si+lJCYO7oGkIoNPAN8j3azBLTn9SjMGS+jFaHd1Cck=
+github.com/hashicorp/vault/api v1.12.1 h1:WzGN4X5jrJdNO39g6Sa55djNio3I9DxEBOTmCZE7tm0=
+github.com/hashicorp/vault/api v1.12.1/go.mod h1:1pqP/sErScodde+ybJCyP+ONC4jzEg7Dmawg/QLWo1k=
+github.com/hashicorp/vault/api/auth/approle v0.6.0 h1:ELfFFQlTM/e97WJKu1HvNFa7lQ3tlTwwzrR1NJE1V7Y=
+github.com/hashicorp/vault/api/auth/approle v0.6.0/go.mod h1:CCoIl1xBC3lAWpd1HV+0ovk76Z8b8Mdepyk21h3pGk0=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
@@ -710,6 +745,7 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
+github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@@ -719,6 +755,7 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
+github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
@@ -739,12 +776,17 @@ github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcE
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
+github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
+github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
+github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -927,6 +969,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
+github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
+github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y=
github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10=
@@ -1171,6 +1215,7 @@ golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaE
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
@@ -1180,6 +1225,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
+golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
+golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -1242,6 +1289,7 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -1284,6 +1332,7 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1318,6 +1367,7 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
@@ -1326,6 +1376,8 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
+golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
+golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1343,6 +1395,7 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 4c83d23ae2..5065e53aad 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -81,6 +81,7 @@
- [DataSourceExternalSecret.AppRoleAuthOption](#bytebase-store-DataSourceExternalSecret-AppRoleAuthOption)
- [DataSourceOptions](#bytebase-store-DataSourceOptions)
+ - [DataSourceExternalSecret.AppRoleAuthOption.SecretType](#bytebase-store-DataSourceExternalSecret-AppRoleAuthOption-SecretType)
- [DataSourceExternalSecret.AuthType](#bytebase-store-DataSourceExternalSecret-AuthType)
- [DataSourceExternalSecret.SecretType](#bytebase-store-DataSourceExternalSecret-SecretType)
@@ -1337,7 +1338,7 @@ Used internally for obfuscating the page token.
| token | [string](#string) | | |
| engine_name | [string](#string) | | engine name is the name for secret engine. |
| secret_name | [string](#string) | | the secret name in the engine to store the password. |
-| key_name | [string](#string) | | the key name for the password. |
+| password_key_name | [string](#string) | | the key name for the password. |
@@ -1347,13 +1348,15 @@ Used internally for obfuscating the page token.
<a name="bytebase-store-DataSourceExternalSecret-AppRoleAuthOption"></a>
### DataSourceExternalSecret.AppRoleAuthOption
-app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
+
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| role_id | [string](#string) | | |
-| secret_id | [string](#string) | | |
+| secret_id | [string](#string) | | the secret id for the role without ttl. |
+| type | [DataSourceExternalSecret.AppRoleAuthOption.SecretType](#bytebase-store-DataSourceExternalSecret-AppRoleAuthOption-SecretType) | | |
+| mount_path | [string](#string) | | The path where the approle auth method is mounted. |
@@ -1387,6 +1390,19 @@ app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
+<a name="bytebase-store-DataSourceExternalSecret-AppRoleAuthOption-SecretType"></a>
+
+### DataSourceExternalSecret.AppRoleAuthOption.SecretType
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| SECRET_TYPE_UNSPECIFIED | 0 | |
+| PLAIN | 1 | |
+| ENVIRONMENT | 2 | |
+
+
+
<a name="bytebase-store-DataSourceExternalSecret-AuthType"></a>
### DataSourceExternalSecret.AuthType
@@ -1395,8 +1411,8 @@ app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
| Name | Number | Description |
| ---- | ------ | ----------- |
| AUTH_TYPE_UNSPECIFIED | 0 | |
-| TOKEN | 1 | |
-| APP_ROLE | 2 | |
+| TOKEN | 1 | ref: https://developer.hashicorp.com/vault/docs/auth/token |
+| APP_ROLE | 2 | ref: https://developer.hashicorp.com/vault/docs/auth/approle |
@@ -1408,7 +1424,7 @@ app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
| Name | Number | Description |
| ---- | ------ | ----------- |
| SAECRET_TYPE_UNSPECIFIED | 0 | |
-| VAULT_KV_V2 | 1 | |
+| VAULT_KV_V2 | 1 | ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 78d67b2b9e..9f7c61fe8e 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -485,6 +485,10 @@
</li>
+ <li>
+ <a href="#bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType"><span class="badge">E</span>DataSourceExternalSecret.AppRoleAuthOption.SecretType</a>
+ </li>
+
<li>
<a href="#bytebase.store.DataSourceExternalSecret.AuthType"><span class="badge">E</span>DataSourceExternalSecret.AuthType</a>
</li>
@@ -3732,7 +3736,7 @@ Example: projects/project-id/branches/branch-id. </p></td>
</tr>
<tr>
- <td>key_name</td>
+ <td>password_key_name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>the key name for the password. </p></td>
@@ -3746,7 +3750,7 @@ Example: projects/project-id/branches/branch-id. </p></td>
<h3 id="bytebase.store.DataSourceExternalSecret.AppRoleAuthOption">DataSourceExternalSecret.AppRoleAuthOption</h3>
- <p>app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle</p>
+ <p></p>
<table class="field-table">
@@ -3766,9 +3770,23 @@ Example: projects/project-id/branches/branch-id. </p></td>
<td>secret_id</td>
<td><a href="#string">string</a></td>
<td></td>
+ <td><p>the secret id for the role without ttl. </p></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td><a href="#bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</a></td>
+ <td></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>mount_path</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The path where the approle auth method is mounted. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -3874,6 +3892,35 @@ Used for authentication when connecting to the data source. </p></td>
+ <h3 id="bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SECRET_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PLAIN</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENVIRONMENT</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
<h3 id="bytebase.store.DataSourceExternalSecret.AuthType">DataSourceExternalSecret.AuthType</h3>
<p></p>
<table class="enum-table">
@@ -3891,13 +3938,13 @@ Used for authentication when connecting to the data source. </p></td>
<tr>
<td>TOKEN</td>
<td>1</td>
- <td><p></p></td>
+ <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/token</p></td>
</tr>
<tr>
<td>APP_ROLE</td>
<td>2</td>
- <td><p></p></td>
+ <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/approle</p></td>
</tr>
</tbody>
@@ -3920,7 +3967,7 @@ Used for authentication when connecting to the data source. </p></td>
<tr>
<td>VAULT_KV_V2</td>
<td>1</td>
- <td><p></p></td>
+ <td><p>ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2</p></td>
</tr>
</tbody>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 9200b6d519..3e8da20cad 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -116,6 +116,7 @@
- [UpdateDataSourceRequest](#bytebase-v1-UpdateDataSourceRequest)
- [UpdateInstanceRequest](#bytebase-v1-UpdateInstanceRequest)
+ - [DataSourceExternalSecret.AppRoleAuthOption.SecretType](#bytebase-v1-DataSourceExternalSecret-AppRoleAuthOption-SecretType)
- [DataSourceExternalSecret.AuthType](#bytebase-v1-DataSourceExternalSecret-AuthType)
- [DataSourceExternalSecret.SecretType](#bytebase-v1-DataSourceExternalSecret-SecretType)
- [DataSourceType](#bytebase-v1-DataSourceType)
@@ -2013,7 +2014,7 @@ This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
| token | [string](#string) | | |
| engine_name | [string](#string) | | engine name is the name for secret engine. |
| secret_name | [string](#string) | | the secret name in the engine to store the password. |
-| key_name | [string](#string) | | the key name for the password. |
+| password_key_name | [string](#string) | | the key name for the password. |
@@ -2023,13 +2024,15 @@ This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
<a name="bytebase-v1-DataSourceExternalSecret-AppRoleAuthOption"></a>
### DataSourceExternalSecret.AppRoleAuthOption
-app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
+
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| role_id | [string](#string) | | |
-| secret_id | [string](#string) | | |
+| secret_id | [string](#string) | | the secret id for the role without ttl. |
+| type | [DataSourceExternalSecret.AppRoleAuthOption.SecretType](#bytebase-v1-DataSourceExternalSecret-AppRoleAuthOption-SecretType) | | |
+| mount_path | [string](#string) | | The path where the approle auth method is mounted. |
@@ -2304,6 +2307,19 @@ The instance&#39;s `name` field is used to identify the instance to update. Form
+<a name="bytebase-v1-DataSourceExternalSecret-AppRoleAuthOption-SecretType"></a>
+
+### DataSourceExternalSecret.AppRoleAuthOption.SecretType
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| SECRET_TYPE_UNSPECIFIED | 0 | |
+| PLAIN | 1 | |
+| ENVIRONMENT | 2 | |
+
+
+
<a name="bytebase-v1-DataSourceExternalSecret-AuthType"></a>
### DataSourceExternalSecret.AuthType
@@ -2312,8 +2328,8 @@ The instance&#39;s `name` field is used to identify the instance to update. Form
| Name | Number | Description |
| ---- | ------ | ----------- |
| AUTH_TYPE_UNSPECIFIED | 0 | |
-| TOKEN | 1 | |
-| APP_ROLE | 2 | |
+| TOKEN | 1 | ref: https://developer.hashicorp.com/vault/docs/auth/token |
+| APP_ROLE | 2 | ref: https://developer.hashicorp.com/vault/docs/auth/approle |
@@ -2325,7 +2341,7 @@ The instance&#39;s `name` field is used to identify the instance to update. Form
| Name | Number | Description |
| ---- | ------ | ----------- |
| SAECRET_TYPE_UNSPECIFIED | 0 | |
-| VAULT_KV_V2 | 1 | |
+| VAULT_KV_V2 | 1 | ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2 |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index b15d1947f5..a487f5f92a 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -613,6 +613,10 @@
</li>
+ <li>
+ <a href="#bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType"><span class="badge">E</span>DataSourceExternalSecret.AppRoleAuthOption.SecretType</a>
+ </li>
+
<li>
<a href="#bytebase.v1.DataSourceExternalSecret.AuthType"><span class="badge">E</span>DataSourceExternalSecret.AuthType</a>
</li>
@@ -6302,7 +6306,7 @@ Used for authentication when connecting to the data source. </p></td>
</tr>
<tr>
- <td>key_name</td>
+ <td>password_key_name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>the key name for the password. </p></td>
@@ -6316,7 +6320,7 @@ Used for authentication when connecting to the data source. </p></td>
<h3 id="bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption">DataSourceExternalSecret.AppRoleAuthOption</h3>
- <p>app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle</p>
+ <p></p>
<table class="field-table">
@@ -6336,9 +6340,23 @@ Used for authentication when connecting to the data source. </p></td>
<td>secret_id</td>
<td><a href="#string">string</a></td>
<td></td>
+ <td><p>the secret id for the role without ttl. </p></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td><a href="#bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</a></td>
+ <td></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>mount_path</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The path where the approle auth method is mounted. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -6932,6 +6950,35 @@ Format: instances/{instance} </p></td>
+ <h3 id="bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SECRET_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PLAIN</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENVIRONMENT</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
<h3 id="bytebase.v1.DataSourceExternalSecret.AuthType">DataSourceExternalSecret.AuthType</h3>
<p></p>
<table class="enum-table">
@@ -6949,13 +6996,13 @@ Format: instances/{instance} </p></td>
<tr>
<td>TOKEN</td>
<td>1</td>
- <td><p></p></td>
+ <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/token</p></td>
</tr>
<tr>
<td>APP_ROLE</td>
<td>2</td>
- <td><p></p></td>
+ <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/approle</p></td>
</tr>
</tbody>
@@ -6978,7 +7025,7 @@ Format: instances/{instance} </p></td>
<tr>
<td>VAULT_KV_V2</td>
<td>1</td>
- <td><p></p></td>
+ <td><p>ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2</p></td>
</tr>
</tbody>
diff --git a/proto/generated-go/store/data_source.pb.go b/proto/generated-go/store/data_source.pb.go
index 3c641f1ca7..d5268d334f 100644
--- a/proto/generated-go/store/data_source.pb.go
+++ b/proto/generated-go/store/data_source.pb.go
@@ -24,7 +24,8 @@ type DataSourceExternalSecret_SecretType int32
const (
DataSourceExternalSecret_SAECRET_TYPE_UNSPECIFIED DataSourceExternalSecret_SecretType = 0
- DataSourceExternalSecret_VAULT_KV_V2 DataSourceExternalSecret_SecretType = 1
+ // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
+ DataSourceExternalSecret_VAULT_KV_V2 DataSourceExternalSecret_SecretType = 1
)
// Enum value maps for DataSourceExternalSecret_SecretType.
@@ -70,8 +71,10 @@ type DataSourceExternalSecret_AuthType int32
const (
DataSourceExternalSecret_AUTH_TYPE_UNSPECIFIED DataSourceExternalSecret_AuthType = 0
- DataSourceExternalSecret_TOKEN DataSourceExternalSecret_AuthType = 1
- DataSourceExternalSecret_APP_ROLE DataSourceExternalSecret_AuthType = 2
+ // ref: https://developer.hashicorp.com/vault/docs/auth/token
+ DataSourceExternalSecret_TOKEN DataSourceExternalSecret_AuthType = 1
+ // ref: https://developer.hashicorp.com/vault/docs/auth/approle
+ DataSourceExternalSecret_APP_ROLE DataSourceExternalSecret_AuthType = 2
)
// Enum value maps for DataSourceExternalSecret_AuthType.
@@ -115,6 +118,55 @@ 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}
+}
+
type DataSourceExternalSecret struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -133,7 +185,7 @@ type DataSourceExternalSecret struct {
// 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.
- KeyName string `protobuf:"bytes,8,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"`
+ PasswordKeyName string `protobuf:"bytes,8,opt,name=password_key_name,json=passwordKeyName,proto3" json:"password_key_name,omitempty"`
}
func (x *DataSourceExternalSecret) Reset() {
@@ -224,9 +276,9 @@ func (x *DataSourceExternalSecret) GetSecretName() string {
return ""
}
-func (x *DataSourceExternalSecret) GetKeyName() string {
+func (x *DataSourceExternalSecret) GetPasswordKeyName() string {
if x != nil {
- return x.KeyName
+ return x.PasswordKeyName
}
return ""
}
@@ -385,14 +437,17 @@ func (x *DataSourceOptions) GetExternalSecret() *DataSourceExternalSecret {
return nil
}
-// app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
type DataSourceExternalSecret_AppRoleAuthOption struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
- SecretId string `protobuf:"bytes,2,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"`
+ 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"`
}
func (x *DataSourceExternalSecret_AppRoleAuthOption) Reset() {
@@ -441,12 +496,26 @@ func (x *DataSourceExternalSecret_AppRoleAuthOption) GetSecretId() string {
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 = []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, 0xf7, 0x04, 0x0a, 0x18, 0x44, 0x61,
+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xca, 0x06, 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,
@@ -471,56 +540,69 @@ var file_store_data_source_proto_rawDesc = []byte{
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, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x49, 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, 0x22, 0x3b, 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, 0x22, 0x3e, 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, 0x0c, 0x0a, 0x08, 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, 0xff, 0x03, 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, 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,
+ 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, 0x3b, 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, 0x22, 0x3e, 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, 0x0c, 0x0a, 0x08, 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, 0xff, 0x03, 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, 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 (
@@ -535,25 +617,27 @@ 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, 2)
+var file_store_data_source_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_store_data_source_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_store_data_source_proto_goTypes = []interface{}{
- (DataSourceExternalSecret_SecretType)(0), // 0: bytebase.store.DataSourceExternalSecret.SecretType
- (DataSourceExternalSecret_AuthType)(0), // 1: bytebase.store.DataSourceExternalSecret.AuthType
- (*DataSourceExternalSecret)(nil), // 2: bytebase.store.DataSourceExternalSecret
- (*DataSourceOptions)(nil), // 3: bytebase.store.DataSourceOptions
- (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 4: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ (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
+ (*DataSourceExternalSecret)(nil), // 3: bytebase.store.DataSourceExternalSecret
+ (*DataSourceOptions)(nil), // 4: bytebase.store.DataSourceOptions
+ (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 5: 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
- 4, // 2: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
- 2, // 3: bytebase.store.DataSourceOptions.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
- 4, // [4:4] is the sub-list for method output_type
- 4, // [4:4] is the sub-list for method input_type
- 4, // [4:4] is the sub-list for extension type_name
- 4, // [4:4] is the sub-list for extension extendee
- 0, // [0:4] is the sub-list for field type_name
+ 5, // 2: bytebase.store.DataSourceExternalSecret.app_role:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption
+ 3, // 3: bytebase.store.DataSourceOptions.external_secret:type_name -> bytebase.store.DataSourceExternalSecret
+ 2, // 4: bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ 5, // [5:5] is the sub-list for method output_type
+ 5, // [5:5] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
}
func init() { file_store_data_source_proto_init() }
@@ -608,7 +692,7 @@ func file_store_data_source_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_data_source_proto_rawDesc,
- NumEnums: 2,
+ NumEnums: 3,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
diff --git a/proto/generated-go/v1/instance_service.pb.go b/proto/generated-go/v1/instance_service.pb.go
index 78ccc89fb9..4a48c63db7 100644
--- a/proto/generated-go/v1/instance_service.pb.go
+++ b/proto/generated-go/v1/instance_service.pb.go
@@ -77,7 +77,8 @@ type DataSourceExternalSecret_SecretType int32
const (
DataSourceExternalSecret_SAECRET_TYPE_UNSPECIFIED DataSourceExternalSecret_SecretType = 0
- DataSourceExternalSecret_VAULT_KV_V2 DataSourceExternalSecret_SecretType = 1
+ // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
+ DataSourceExternalSecret_VAULT_KV_V2 DataSourceExternalSecret_SecretType = 1
)
// Enum value maps for DataSourceExternalSecret_SecretType.
@@ -123,8 +124,10 @@ type DataSourceExternalSecret_AuthType int32
const (
DataSourceExternalSecret_AUTH_TYPE_UNSPECIFIED DataSourceExternalSecret_AuthType = 0
- DataSourceExternalSecret_TOKEN DataSourceExternalSecret_AuthType = 1
- DataSourceExternalSecret_APP_ROLE DataSourceExternalSecret_AuthType = 2
+ // ref: https://developer.hashicorp.com/vault/docs/auth/token
+ DataSourceExternalSecret_TOKEN DataSourceExternalSecret_AuthType = 1
+ // ref: https://developer.hashicorp.com/vault/docs/auth/approle
+ DataSourceExternalSecret_APP_ROLE DataSourceExternalSecret_AuthType = 2
)
// Enum value maps for DataSourceExternalSecret_AuthType.
@@ -168,6 +171,55 @@ func (DataSourceExternalSecret_AuthType) EnumDescriptor() ([]byte, []int) {
return file_v1_instance_service_proto_rawDescGZIP(), []int{19, 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_v1_instance_service_proto_enumTypes[3].Descriptor()
+}
+
+func (DataSourceExternalSecret_AppRoleAuthOption_SecretType) Type() protoreflect.EnumType {
+ return &file_v1_instance_service_proto_enumTypes[3]
+}
+
+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_v1_instance_service_proto_rawDescGZIP(), []int{19, 0, 0}
+}
+
type GetInstanceRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -1350,7 +1402,7 @@ type DataSourceExternalSecret struct {
// 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.
- KeyName string `protobuf:"bytes,8,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"`
+ PasswordKeyName string `protobuf:"bytes,8,opt,name=password_key_name,json=passwordKeyName,proto3" json:"password_key_name,omitempty"`
}
func (x *DataSourceExternalSecret) Reset() {
@@ -1441,9 +1493,9 @@ func (x *DataSourceExternalSecret) GetSecretName() string {
return ""
}
-func (x *DataSourceExternalSecret) GetKeyName() string {
+func (x *DataSourceExternalSecret) GetPasswordKeyName() string {
if x != nil {
- return x.KeyName
+ return x.PasswordKeyName
}
return ""
}
@@ -1763,14 +1815,17 @@ func (x *InstanceResource) GetActivation() bool {
return false
}
-// app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
type DataSourceExternalSecret_AppRoleAuthOption struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RoleId string `protobuf:"bytes,1,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"`
- SecretId string `protobuf:"bytes,2,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"`
+ 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.v1.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"`
}
func (x *DataSourceExternalSecret_AppRoleAuthOption) Reset() {
@@ -1819,6 +1874,20 @@ func (x *DataSourceExternalSecret_AppRoleAuthOption) GetSecretId() string {
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_v1_instance_service_proto protoreflect.FileDescriptor
var file_v1_instance_service_proto_rawDesc = []byte{
@@ -1978,7 +2047,7 @@ var file_v1_instance_service_proto_rawDesc = []byte{
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62,
0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61,
0x6e, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x73, 0x22, 0xf8, 0x04, 0x0a, 0x18, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72,
+ 0x6f, 0x6e, 0x73, 0x22, 0xc8, 0x06, 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, 0x51, 0x0a, 0x0b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
@@ -2002,14 +2071,27 @@ var file_v1_instance_service_proto_rawDesc = []byte{
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, 0x19, 0x0a, 0x08,
- 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
- 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x49, 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, 0x22, 0x3b, 0x0a, 0x0a, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65,
+ 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, 0x87, 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, 0x56, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x42, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 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, 0x3b, 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, 0x22,
@@ -2212,95 +2294,97 @@ func file_v1_instance_service_proto_rawDescGZIP() []byte {
return file_v1_instance_service_proto_rawDescData
}
-var file_v1_instance_service_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
+var file_v1_instance_service_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
var file_v1_instance_service_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
var file_v1_instance_service_proto_goTypes = []interface{}{
- (DataSourceType)(0), // 0: bytebase.v1.DataSourceType
- (DataSourceExternalSecret_SecretType)(0), // 1: bytebase.v1.DataSourceExternalSecret.SecretType
- (DataSourceExternalSecret_AuthType)(0), // 2: bytebase.v1.DataSourceExternalSecret.AuthType
- (*GetInstanceRequest)(nil), // 3: bytebase.v1.GetInstanceRequest
- (*ListInstancesRequest)(nil), // 4: bytebase.v1.ListInstancesRequest
- (*ListInstancesResponse)(nil), // 5: bytebase.v1.ListInstancesResponse
- (*SearchInstancesRequest)(nil), // 6: bytebase.v1.SearchInstancesRequest
- (*SearchInstancesResponse)(nil), // 7: bytebase.v1.SearchInstancesResponse
- (*CreateInstanceRequest)(nil), // 8: bytebase.v1.CreateInstanceRequest
- (*UpdateInstanceRequest)(nil), // 9: bytebase.v1.UpdateInstanceRequest
- (*DeleteInstanceRequest)(nil), // 10: bytebase.v1.DeleteInstanceRequest
- (*UndeleteInstanceRequest)(nil), // 11: bytebase.v1.UndeleteInstanceRequest
- (*SyncInstanceRequest)(nil), // 12: bytebase.v1.SyncInstanceRequest
- (*SyncInstanceResponse)(nil), // 13: bytebase.v1.SyncInstanceResponse
- (*BatchSyncInstanceRequest)(nil), // 14: bytebase.v1.BatchSyncInstanceRequest
- (*BatchSyncInstanceResponse)(nil), // 15: bytebase.v1.BatchSyncInstanceResponse
- (*AddDataSourceRequest)(nil), // 16: bytebase.v1.AddDataSourceRequest
- (*RemoveDataSourceRequest)(nil), // 17: bytebase.v1.RemoveDataSourceRequest
- (*UpdateDataSourceRequest)(nil), // 18: bytebase.v1.UpdateDataSourceRequest
- (*SyncSlowQueriesRequest)(nil), // 19: bytebase.v1.SyncSlowQueriesRequest
- (*InstanceOptions)(nil), // 20: bytebase.v1.InstanceOptions
- (*Instance)(nil), // 21: bytebase.v1.Instance
- (*DataSourceExternalSecret)(nil), // 22: bytebase.v1.DataSourceExternalSecret
- (*DataSource)(nil), // 23: bytebase.v1.DataSource
- (*InstanceResource)(nil), // 24: bytebase.v1.InstanceResource
- (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 25: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
- (*fieldmaskpb.FieldMask)(nil), // 26: google.protobuf.FieldMask
- (*durationpb.Duration)(nil), // 27: google.protobuf.Duration
- (State)(0), // 28: bytebase.v1.State
- (Engine)(0), // 29: bytebase.v1.Engine
- (*emptypb.Empty)(nil), // 30: google.protobuf.Empty
+ (DataSourceType)(0), // 0: bytebase.v1.DataSourceType
+ (DataSourceExternalSecret_SecretType)(0), // 1: bytebase.v1.DataSourceExternalSecret.SecretType
+ (DataSourceExternalSecret_AuthType)(0), // 2: bytebase.v1.DataSourceExternalSecret.AuthType
+ (DataSourceExternalSecret_AppRoleAuthOption_SecretType)(0), // 3: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ (*GetInstanceRequest)(nil), // 4: bytebase.v1.GetInstanceRequest
+ (*ListInstancesRequest)(nil), // 5: bytebase.v1.ListInstancesRequest
+ (*ListInstancesResponse)(nil), // 6: bytebase.v1.ListInstancesResponse
+ (*SearchInstancesRequest)(nil), // 7: bytebase.v1.SearchInstancesRequest
+ (*SearchInstancesResponse)(nil), // 8: bytebase.v1.SearchInstancesResponse
+ (*CreateInstanceRequest)(nil), // 9: bytebase.v1.CreateInstanceRequest
+ (*UpdateInstanceRequest)(nil), // 10: bytebase.v1.UpdateInstanceRequest
+ (*DeleteInstanceRequest)(nil), // 11: bytebase.v1.DeleteInstanceRequest
+ (*UndeleteInstanceRequest)(nil), // 12: bytebase.v1.UndeleteInstanceRequest
+ (*SyncInstanceRequest)(nil), // 13: bytebase.v1.SyncInstanceRequest
+ (*SyncInstanceResponse)(nil), // 14: bytebase.v1.SyncInstanceResponse
+ (*BatchSyncInstanceRequest)(nil), // 15: bytebase.v1.BatchSyncInstanceRequest
+ (*BatchSyncInstanceResponse)(nil), // 16: bytebase.v1.BatchSyncInstanceResponse
+ (*AddDataSourceRequest)(nil), // 17: bytebase.v1.AddDataSourceRequest
+ (*RemoveDataSourceRequest)(nil), // 18: bytebase.v1.RemoveDataSourceRequest
+ (*UpdateDataSourceRequest)(nil), // 19: bytebase.v1.UpdateDataSourceRequest
+ (*SyncSlowQueriesRequest)(nil), // 20: bytebase.v1.SyncSlowQueriesRequest
+ (*InstanceOptions)(nil), // 21: bytebase.v1.InstanceOptions
+ (*Instance)(nil), // 22: bytebase.v1.Instance
+ (*DataSourceExternalSecret)(nil), // 23: bytebase.v1.DataSourceExternalSecret
+ (*DataSource)(nil), // 24: bytebase.v1.DataSource
+ (*InstanceResource)(nil), // 25: bytebase.v1.InstanceResource
+ (*DataSourceExternalSecret_AppRoleAuthOption)(nil), // 26: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
+ (*fieldmaskpb.FieldMask)(nil), // 27: google.protobuf.FieldMask
+ (*durationpb.Duration)(nil), // 28: google.protobuf.Duration
+ (State)(0), // 29: bytebase.v1.State
+ (Engine)(0), // 30: bytebase.v1.Engine
+ (*emptypb.Empty)(nil), // 31: google.protobuf.Empty
}
var file_v1_instance_service_proto_depIdxs = []int32{
- 21, // 0: bytebase.v1.ListInstancesResponse.instances:type_name -> bytebase.v1.Instance
- 21, // 1: bytebase.v1.SearchInstancesResponse.instances:type_name -> bytebase.v1.Instance
- 21, // 2: bytebase.v1.CreateInstanceRequest.instance:type_name -> bytebase.v1.Instance
- 21, // 3: bytebase.v1.UpdateInstanceRequest.instance:type_name -> bytebase.v1.Instance
- 26, // 4: bytebase.v1.UpdateInstanceRequest.update_mask:type_name -> google.protobuf.FieldMask
- 12, // 5: bytebase.v1.BatchSyncInstanceRequest.requests:type_name -> bytebase.v1.SyncInstanceRequest
- 23, // 6: bytebase.v1.AddDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
- 23, // 7: bytebase.v1.RemoveDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
- 23, // 8: bytebase.v1.UpdateDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
- 26, // 9: bytebase.v1.UpdateDataSourceRequest.update_mask:type_name -> google.protobuf.FieldMask
- 27, // 10: bytebase.v1.InstanceOptions.sync_interval:type_name -> google.protobuf.Duration
- 28, // 11: bytebase.v1.Instance.state:type_name -> bytebase.v1.State
- 29, // 12: bytebase.v1.Instance.engine:type_name -> bytebase.v1.Engine
- 23, // 13: bytebase.v1.Instance.data_sources:type_name -> bytebase.v1.DataSource
- 20, // 14: bytebase.v1.Instance.options:type_name -> bytebase.v1.InstanceOptions
+ 22, // 0: bytebase.v1.ListInstancesResponse.instances:type_name -> bytebase.v1.Instance
+ 22, // 1: bytebase.v1.SearchInstancesResponse.instances:type_name -> bytebase.v1.Instance
+ 22, // 2: bytebase.v1.CreateInstanceRequest.instance:type_name -> bytebase.v1.Instance
+ 22, // 3: bytebase.v1.UpdateInstanceRequest.instance:type_name -> bytebase.v1.Instance
+ 27, // 4: bytebase.v1.UpdateInstanceRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 13, // 5: bytebase.v1.BatchSyncInstanceRequest.requests:type_name -> bytebase.v1.SyncInstanceRequest
+ 24, // 6: bytebase.v1.AddDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
+ 24, // 7: bytebase.v1.RemoveDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
+ 24, // 8: bytebase.v1.UpdateDataSourceRequest.data_source:type_name -> bytebase.v1.DataSource
+ 27, // 9: bytebase.v1.UpdateDataSourceRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 28, // 10: bytebase.v1.InstanceOptions.sync_interval:type_name -> google.protobuf.Duration
+ 29, // 11: bytebase.v1.Instance.state:type_name -> bytebase.v1.State
+ 30, // 12: bytebase.v1.Instance.engine:type_name -> bytebase.v1.Engine
+ 24, // 13: bytebase.v1.Instance.data_sources:type_name -> bytebase.v1.DataSource
+ 21, // 14: bytebase.v1.Instance.options:type_name -> bytebase.v1.InstanceOptions
1, // 15: bytebase.v1.DataSourceExternalSecret.secret_type:type_name -> bytebase.v1.DataSourceExternalSecret.SecretType
2, // 16: bytebase.v1.DataSourceExternalSecret.auth_type:type_name -> bytebase.v1.DataSourceExternalSecret.AuthType
- 25, // 17: bytebase.v1.DataSourceExternalSecret.app_role:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
+ 26, // 17: bytebase.v1.DataSourceExternalSecret.app_role:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption
0, // 18: bytebase.v1.DataSource.type:type_name -> bytebase.v1.DataSourceType
- 22, // 19: bytebase.v1.DataSource.external_secret:type_name -> bytebase.v1.DataSourceExternalSecret
- 29, // 20: bytebase.v1.InstanceResource.engine:type_name -> bytebase.v1.Engine
- 23, // 21: bytebase.v1.InstanceResource.data_sources:type_name -> bytebase.v1.DataSource
- 3, // 22: bytebase.v1.InstanceService.GetInstance:input_type -> bytebase.v1.GetInstanceRequest
- 4, // 23: bytebase.v1.InstanceService.ListInstances:input_type -> bytebase.v1.ListInstancesRequest
- 6, // 24: bytebase.v1.InstanceService.SearchInstances:input_type -> bytebase.v1.SearchInstancesRequest
- 8, // 25: bytebase.v1.InstanceService.CreateInstance:input_type -> bytebase.v1.CreateInstanceRequest
- 9, // 26: bytebase.v1.InstanceService.UpdateInstance:input_type -> bytebase.v1.UpdateInstanceRequest
- 10, // 27: bytebase.v1.InstanceService.DeleteInstance:input_type -> bytebase.v1.DeleteInstanceRequest
- 11, // 28: bytebase.v1.InstanceService.UndeleteInstance:input_type -> bytebase.v1.UndeleteInstanceRequest
- 12, // 29: bytebase.v1.InstanceService.SyncInstance:input_type -> bytebase.v1.SyncInstanceRequest
- 14, // 30: bytebase.v1.InstanceService.BatchSyncInstance:input_type -> bytebase.v1.BatchSyncInstanceRequest
- 16, // 31: bytebase.v1.InstanceService.AddDataSource:input_type -> bytebase.v1.AddDataSourceRequest
- 17, // 32: bytebase.v1.InstanceService.RemoveDataSource:input_type -> bytebase.v1.RemoveDataSourceRequest
- 18, // 33: bytebase.v1.InstanceService.UpdateDataSource:input_type -> bytebase.v1.UpdateDataSourceRequest
- 19, // 34: bytebase.v1.InstanceService.SyncSlowQueries:input_type -> bytebase.v1.SyncSlowQueriesRequest
- 21, // 35: bytebase.v1.InstanceService.GetInstance:output_type -> bytebase.v1.Instance
- 5, // 36: bytebase.v1.InstanceService.ListInstances:output_type -> bytebase.v1.ListInstancesResponse
- 7, // 37: bytebase.v1.InstanceService.SearchInstances:output_type -> bytebase.v1.SearchInstancesResponse
- 21, // 38: bytebase.v1.InstanceService.CreateInstance:output_type -> bytebase.v1.Instance
- 21, // 39: bytebase.v1.InstanceService.UpdateInstance:output_type -> bytebase.v1.Instance
- 30, // 40: bytebase.v1.InstanceService.DeleteInstance:output_type -> google.protobuf.Empty
- 21, // 41: bytebase.v1.InstanceService.UndeleteInstance:output_type -> bytebase.v1.Instance
- 13, // 42: bytebase.v1.InstanceService.SyncInstance:output_type -> bytebase.v1.SyncInstanceResponse
- 15, // 43: bytebase.v1.InstanceService.BatchSyncInstance:output_type -> bytebase.v1.BatchSyncInstanceResponse
- 21, // 44: bytebase.v1.InstanceService.AddDataSource:output_type -> bytebase.v1.Instance
- 21, // 45: bytebase.v1.InstanceService.RemoveDataSource:output_type -> bytebase.v1.Instance
- 21, // 46: bytebase.v1.InstanceService.UpdateDataSource:output_type -> bytebase.v1.Instance
- 30, // 47: bytebase.v1.InstanceService.SyncSlowQueries:output_type -> google.protobuf.Empty
- 35, // [35:48] is the sub-list for method output_type
- 22, // [22:35] is the sub-list for method input_type
- 22, // [22:22] is the sub-list for extension type_name
- 22, // [22:22] is the sub-list for extension extendee
- 0, // [0:22] is the sub-list for field type_name
+ 23, // 19: bytebase.v1.DataSource.external_secret:type_name -> bytebase.v1.DataSourceExternalSecret
+ 30, // 20: bytebase.v1.InstanceResource.engine:type_name -> bytebase.v1.Engine
+ 24, // 21: bytebase.v1.InstanceResource.data_sources:type_name -> bytebase.v1.DataSource
+ 3, // 22: bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.type:type_name -> bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType
+ 4, // 23: bytebase.v1.InstanceService.GetInstance:input_type -> bytebase.v1.GetInstanceRequest
+ 5, // 24: bytebase.v1.InstanceService.ListInstances:input_type -> bytebase.v1.ListInstancesRequest
+ 7, // 25: bytebase.v1.InstanceService.SearchInstances:input_type -> bytebase.v1.SearchInstancesRequest
+ 9, // 26: bytebase.v1.InstanceService.CreateInstance:input_type -> bytebase.v1.CreateInstanceRequest
+ 10, // 27: bytebase.v1.InstanceService.UpdateInstance:input_type -> bytebase.v1.UpdateInstanceRequest
+ 11, // 28: bytebase.v1.InstanceService.DeleteInstance:input_type -> bytebase.v1.DeleteInstanceRequest
+ 12, // 29: bytebase.v1.InstanceService.UndeleteInstance:input_type -> bytebase.v1.UndeleteInstanceRequest
+ 13, // 30: bytebase.v1.InstanceService.SyncInstance:input_type -> bytebase.v1.SyncInstanceRequest
+ 15, // 31: bytebase.v1.InstanceService.BatchSyncInstance:input_type -> bytebase.v1.BatchSyncInstanceRequest
+ 17, // 32: bytebase.v1.InstanceService.AddDataSource:input_type -> bytebase.v1.AddDataSourceRequest
+ 18, // 33: bytebase.v1.InstanceService.RemoveDataSource:input_type -> bytebase.v1.RemoveDataSourceRequest
+ 19, // 34: bytebase.v1.InstanceService.UpdateDataSource:input_type -> bytebase.v1.UpdateDataSourceRequest
+ 20, // 35: bytebase.v1.InstanceService.SyncSlowQueries:input_type -> bytebase.v1.SyncSlowQueriesRequest
+ 22, // 36: bytebase.v1.InstanceService.GetInstance:output_type -> bytebase.v1.Instance
+ 6, // 37: bytebase.v1.InstanceService.ListInstances:output_type -> bytebase.v1.ListInstancesResponse
+ 8, // 38: bytebase.v1.InstanceService.SearchInstances:output_type -> bytebase.v1.SearchInstancesResponse
+ 22, // 39: bytebase.v1.InstanceService.CreateInstance:output_type -> bytebase.v1.Instance
+ 22, // 40: bytebase.v1.InstanceService.UpdateInstance:output_type -> bytebase.v1.Instance
+ 31, // 41: bytebase.v1.InstanceService.DeleteInstance:output_type -> google.protobuf.Empty
+ 22, // 42: bytebase.v1.InstanceService.UndeleteInstance:output_type -> bytebase.v1.Instance
+ 14, // 43: bytebase.v1.InstanceService.SyncInstance:output_type -> bytebase.v1.SyncInstanceResponse
+ 16, // 44: bytebase.v1.InstanceService.BatchSyncInstance:output_type -> bytebase.v1.BatchSyncInstanceResponse
+ 22, // 45: bytebase.v1.InstanceService.AddDataSource:output_type -> bytebase.v1.Instance
+ 22, // 46: bytebase.v1.InstanceService.RemoveDataSource:output_type -> bytebase.v1.Instance
+ 22, // 47: bytebase.v1.InstanceService.UpdateDataSource:output_type -> bytebase.v1.Instance
+ 31, // 48: bytebase.v1.InstanceService.SyncSlowQueries:output_type -> google.protobuf.Empty
+ 36, // [36:49] is the sub-list for method output_type
+ 23, // [23:36] is the sub-list for method input_type
+ 23, // [23:23] is the sub-list for extension type_name
+ 23, // [23:23] is the sub-list for extension extendee
+ 0, // [0:23] is the sub-list for field type_name
}
func init() { file_v1_instance_service_proto_init() }
@@ -2596,7 +2680,7 @@ func file_v1_instance_service_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_instance_service_proto_rawDesc,
- NumEnums: 3,
+ NumEnums: 4,
NumMessages: 23,
NumExtensions: 0,
NumServices: 1,
diff --git a/proto/store/data_source.proto b/proto/store/data_source.proto
index 139bb63ead..0dcbb0edf1 100644
--- a/proto/store/data_source.proto
+++ b/proto/store/data_source.proto
@@ -7,6 +7,7 @@ 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;
}
SecretType secret_type = 1;
@@ -14,15 +15,28 @@ message DataSourceExternalSecret {
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
APP_ROLE = 2;
}
AuthType auth_type = 3;
- // app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
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 {
@@ -35,7 +49,7 @@ message DataSourceExternalSecret {
// the secret name in the engine to store the password.
string secret_name = 7;
// the key name for the password.
- string key_name = 8;
+ string password_key_name = 8;
}
message DataSourceOptions {
diff --git a/proto/v1/instance_service.proto b/proto/v1/instance_service.proto
index 3277da5f7a..17d4e817a3 100644
--- a/proto/v1/instance_service.proto
+++ b/proto/v1/instance_service.proto
@@ -308,6 +308,7 @@ message Instance {
message DataSourceExternalSecret {
enum SecretType {
SAECRET_TYPE_UNSPECIFIED = 0;
+ // ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
VAULT_KV_V2 = 1;
}
SecretType secret_type = 1;
@@ -315,15 +316,28 @@ message DataSourceExternalSecret {
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
APP_ROLE = 2;
}
AuthType auth_type = 3;
- // app role auth method: https://developer.hashicorp.com/vault/docs/auth/approle
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 {
@@ -336,7 +350,7 @@ message DataSourceExternalSecret {
// the secret name in the engine to store the password.
string secret_name = 7;
// the key name for the password.
- string key_name = 8;
+ string password_key_name = 8;
}
message DataSource {