Skip to content

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

refactor: migrate AUTH_SECRET and WORKSPACE_ID to SystemSetting (#18343)

Danny Xuc142b2c80124
diff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.go
index 5831635e33..cd1e731d0e 100644
--- a/backend/api/v1/setting_service.go
+++ b/backend/api/v1/setting_service.go
@@ -55,8 +55,7 @@ func NewSettingService(
// Backend-only settings that should never be exposed via the API.
var disallowedSettings = []storepb.SettingName{
- storepb.SettingName_AUTH_SECRET, // Internal authentication secret
- storepb.SettingName_WORKSPACE_ID, // Exposed via ActuatorInfo instead
+ storepb.SettingName_SYSTEM, // Internal system settings (auth secret, workspace ID)
storepb.SettingName_ENTERPRISE_LICENSE, // Managed via SubscriptionService
}
@@ -127,13 +126,16 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *connect.Req
if settingName == "" {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("setting name is empty"))
}
- if s.profile.IsFeatureUnavailable(settingName) {
- return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("feature %s is unavailable in current mode", settingName))
- }
apiSettingName, err := convertStringToSettingName(settingName)
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid setting name: %v", err))
}
+ if isSettingDisallowed(apiSettingName) {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("setting is not available"))
+ }
+ if s.profile.IsFeatureUnavailable(settingName) {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("feature %s is unavailable in current mode", settingName))
+ }
existedSetting, err := s.store.GetSettingV2(ctx, apiSettingName)
if err != nil {
return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to find setting %s with error: %v", settingName, err))
diff --git a/backend/api/v1/setting_service_converter.go b/backend/api/v1/setting_service_converter.go
index 2ba633b9e4..8360513369 100644
--- a/backend/api/v1/setting_service_converter.go
+++ b/backend/api/v1/setting_service_converter.go
@@ -175,7 +175,7 @@ func convertStoreSettingNameToV1(storeName storepb.SettingName) v1pb.Setting_Set
return v1pb.Setting_PASSWORD_RESTRICTION
case storepb.SettingName_ENVIRONMENT:
return v1pb.Setting_ENVIRONMENT
- case storepb.SettingName_AUTH_SECRET, storepb.SettingName_WORKSPACE_ID, storepb.SettingName_ENTERPRISE_LICENSE:
+ case storepb.SettingName_SYSTEM, storepb.SettingName_ENTERPRISE_LICENSE:
// Backend-only settings, not exposed in v1 API
default:
}
diff --git a/backend/component/config/profile.go b/backend/component/config/profile.go
index b87009d57e..9fc4881e2a 100644
--- a/backend/component/config/profile.go
+++ b/backend/component/config/profile.go
@@ -64,8 +64,7 @@ func (prof *Profile) UseEmbedDB() bool {
}
var saasFeatureControlMap = map[string]bool{
- storepb.SettingName_WORKSPACE_ID.String(): true,
- storepb.SettingName_AI.String(): true,
+ storepb.SettingName_AI.String(): true,
}
// IsFeatureUnavailable returns if the feature is unavailable in SaaS mode.
diff --git a/backend/generated-go/store/setting.pb.go b/backend/generated-go/store/setting.pb.go
index f1ed1ccbc1..17966123db 100644
--- a/backend/generated-go/store/setting.pb.go
+++ b/backend/generated-go/store/setting.pb.go
@@ -27,8 +27,7 @@ type SettingName int32
const (
SettingName_SETTING_NAME_UNSPECIFIED SettingName = 0
- SettingName_AUTH_SECRET SettingName = 1
- SettingName_WORKSPACE_ID SettingName = 3
+ SettingName_SYSTEM SettingName = 1
SettingName_WORKSPACE_PROFILE SettingName = 4
SettingName_WORKSPACE_APPROVAL SettingName = 5
SettingName_ENTERPRISE_LICENSE SettingName = 7
@@ -44,8 +43,7 @@ const (
var (
SettingName_name = map[int32]string{
0: "SETTING_NAME_UNSPECIFIED",
- 1: "AUTH_SECRET",
- 3: "WORKSPACE_ID",
+ 1: "SYSTEM",
4: "WORKSPACE_PROFILE",
5: "WORKSPACE_APPROVAL",
7: "ENTERPRISE_LICENSE",
@@ -58,8 +56,7 @@ var (
}
SettingName_value = map[string]int32{
"SETTING_NAME_UNSPECIFIED": 0,
- "AUTH_SECRET": 1,
- "WORKSPACE_ID": 3,
+ "SYSTEM": 1,
"WORKSPACE_PROFILE": 4,
"WORKSPACE_APPROVAL": 5,
"ENTERPRISE_LICENSE": 7,
@@ -201,7 +198,7 @@ func (x Announcement_AlertLevel) Number() protoreflect.EnumNumber {
// Deprecated: Use Announcement_AlertLevel.Descriptor instead.
func (Announcement_AlertLevel) EnumDescriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{1, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{2, 0}
}
type WorkspaceApprovalSetting_Rule_Source int32
@@ -256,7 +253,7 @@ func (x WorkspaceApprovalSetting_Rule_Source) Number() protoreflect.EnumNumber {
// Deprecated: Use WorkspaceApprovalSetting_Rule_Source.Descriptor instead.
func (WorkspaceApprovalSetting_Rule_Source) EnumDescriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{2, 0, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{3, 0, 0}
}
type Algorithm_InnerOuterMask_MaskType int32
@@ -305,7 +302,7 @@ func (x Algorithm_InnerOuterMask_MaskType) Number() protoreflect.EnumNumber {
// Deprecated: Use Algorithm_InnerOuterMask_MaskType.Descriptor instead.
func (Algorithm_InnerOuterMask_MaskType) EnumDescriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5, 3, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{6, 3, 0}
}
type AISetting_Provider int32
@@ -360,7 +357,61 @@ func (x AISetting_Provider) Number() protoreflect.EnumNumber {
// Deprecated: Use AISetting_Provider.Descriptor instead.
func (AISetting_Provider) EnumDescriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{8, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{9, 0}
+}
+
+type SystemSetting struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Authentication secret for token signing (32-character random string).
+ AuthSecret string `protobuf:"bytes,1,opt,name=auth_secret,json=authSecret,proto3" json:"auth_secret,omitempty"`
+ // Unique workspace identifier (UUID).
+ WorkspaceId string `protobuf:"bytes,2,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SystemSetting) Reset() {
+ *x = SystemSetting{}
+ mi := &file_store_setting_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SystemSetting) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SystemSetting) ProtoMessage() {}
+
+func (x *SystemSetting) ProtoReflect() protoreflect.Message {
+ mi := &file_store_setting_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SystemSetting.ProtoReflect.Descriptor instead.
+func (*SystemSetting) Descriptor() ([]byte, []int) {
+ return file_store_setting_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *SystemSetting) GetAuthSecret() string {
+ if x != nil {
+ return x.AuthSecret
+ }
+ return ""
+}
+
+func (x *SystemSetting) GetWorkspaceId() string {
+ if x != nil {
+ return x.WorkspaceId
+ }
+ return ""
}
type WorkspaceProfileSetting struct {
@@ -405,7 +456,7 @@ type WorkspaceProfileSetting struct {
func (x *WorkspaceProfileSetting) Reset() {
*x = WorkspaceProfileSetting{}
- mi := &file_store_setting_proto_msgTypes[0]
+ mi := &file_store_setting_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -417,7 +468,7 @@ func (x *WorkspaceProfileSetting) String() string {
func (*WorkspaceProfileSetting) ProtoMessage() {}
func (x *WorkspaceProfileSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[0]
+ mi := &file_store_setting_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -430,7 +481,7 @@ func (x *WorkspaceProfileSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorkspaceProfileSetting.ProtoReflect.Descriptor instead.
func (*WorkspaceProfileSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{0}
+ return file_store_setting_proto_rawDescGZIP(), []int{1}
}
func (x *WorkspaceProfileSetting) GetExternalUrl() string {
@@ -559,7 +610,7 @@ type Announcement struct {
func (x *Announcement) Reset() {
*x = Announcement{}
- mi := &file_store_setting_proto_msgTypes[1]
+ mi := &file_store_setting_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -571,7 +622,7 @@ func (x *Announcement) String() string {
func (*Announcement) ProtoMessage() {}
func (x *Announcement) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[1]
+ mi := &file_store_setting_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -584,7 +635,7 @@ func (x *Announcement) ProtoReflect() protoreflect.Message {
// Deprecated: Use Announcement.ProtoReflect.Descriptor instead.
func (*Announcement) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{1}
+ return file_store_setting_proto_rawDescGZIP(), []int{2}
}
func (x *Announcement) GetLevel() Announcement_AlertLevel {
@@ -617,7 +668,7 @@ type WorkspaceApprovalSetting struct {
func (x *WorkspaceApprovalSetting) Reset() {
*x = WorkspaceApprovalSetting{}
- mi := &file_store_setting_proto_msgTypes[2]
+ mi := &file_store_setting_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -629,7 +680,7 @@ func (x *WorkspaceApprovalSetting) String() string {
func (*WorkspaceApprovalSetting) ProtoMessage() {}
func (x *WorkspaceApprovalSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[2]
+ mi := &file_store_setting_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -642,7 +693,7 @@ func (x *WorkspaceApprovalSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorkspaceApprovalSetting.ProtoReflect.Descriptor instead.
func (*WorkspaceApprovalSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{2}
+ return file_store_setting_proto_rawDescGZIP(), []int{3}
}
func (x *WorkspaceApprovalSetting) GetRules() []*WorkspaceApprovalSetting_Rule {
@@ -661,7 +712,7 @@ type DataClassificationSetting struct {
func (x *DataClassificationSetting) Reset() {
*x = DataClassificationSetting{}
- mi := &file_store_setting_proto_msgTypes[3]
+ mi := &file_store_setting_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -673,7 +724,7 @@ func (x *DataClassificationSetting) String() string {
func (*DataClassificationSetting) ProtoMessage() {}
func (x *DataClassificationSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[3]
+ mi := &file_store_setting_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -686,7 +737,7 @@ func (x *DataClassificationSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use DataClassificationSetting.ProtoReflect.Descriptor instead.
func (*DataClassificationSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{3}
+ return file_store_setting_proto_rawDescGZIP(), []int{4}
}
func (x *DataClassificationSetting) GetConfigs() []*DataClassificationSetting_DataClassificationConfig {
@@ -705,7 +756,7 @@ type SemanticTypeSetting struct {
func (x *SemanticTypeSetting) Reset() {
*x = SemanticTypeSetting{}
- mi := &file_store_setting_proto_msgTypes[4]
+ mi := &file_store_setting_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -717,7 +768,7 @@ func (x *SemanticTypeSetting) String() string {
func (*SemanticTypeSetting) ProtoMessage() {}
func (x *SemanticTypeSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[4]
+ mi := &file_store_setting_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -730,7 +781,7 @@ func (x *SemanticTypeSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use SemanticTypeSetting.ProtoReflect.Descriptor instead.
func (*SemanticTypeSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{4}
+ return file_store_setting_proto_rawDescGZIP(), []int{5}
}
func (x *SemanticTypeSetting) GetTypes() []*SemanticTypeSetting_SemanticType {
@@ -755,7 +806,7 @@ type Algorithm struct {
func (x *Algorithm) Reset() {
*x = Algorithm{}
- mi := &file_store_setting_proto_msgTypes[5]
+ mi := &file_store_setting_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -767,7 +818,7 @@ func (x *Algorithm) String() string {
func (*Algorithm) ProtoMessage() {}
func (x *Algorithm) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[5]
+ mi := &file_store_setting_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -780,7 +831,7 @@ func (x *Algorithm) ProtoReflect() protoreflect.Message {
// Deprecated: Use Algorithm.ProtoReflect.Descriptor instead.
func (*Algorithm) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5}
+ return file_store_setting_proto_rawDescGZIP(), []int{6}
}
func (x *Algorithm) GetMask() isAlgorithm_Mask {
@@ -863,7 +914,7 @@ type AppIMSetting struct {
func (x *AppIMSetting) Reset() {
*x = AppIMSetting{}
- mi := &file_store_setting_proto_msgTypes[6]
+ mi := &file_store_setting_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -875,7 +926,7 @@ func (x *AppIMSetting) String() string {
func (*AppIMSetting) ProtoMessage() {}
func (x *AppIMSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[6]
+ mi := &file_store_setting_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -888,7 +939,7 @@ func (x *AppIMSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting.ProtoReflect.Descriptor instead.
func (*AppIMSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6}
+ return file_store_setting_proto_rawDescGZIP(), []int{7}
}
func (x *AppIMSetting) GetSettings() []*AppIMSetting_IMSetting {
@@ -920,7 +971,7 @@ type PasswordRestrictionSetting struct {
func (x *PasswordRestrictionSetting) Reset() {
*x = PasswordRestrictionSetting{}
- mi := &file_store_setting_proto_msgTypes[7]
+ mi := &file_store_setting_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -932,7 +983,7 @@ func (x *PasswordRestrictionSetting) String() string {
func (*PasswordRestrictionSetting) ProtoMessage() {}
func (x *PasswordRestrictionSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[7]
+ mi := &file_store_setting_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -945,7 +996,7 @@ func (x *PasswordRestrictionSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use PasswordRestrictionSetting.ProtoReflect.Descriptor instead.
func (*PasswordRestrictionSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{7}
+ return file_store_setting_proto_rawDescGZIP(), []int{8}
}
func (x *PasswordRestrictionSetting) GetMinLength() int32 {
@@ -1011,7 +1062,7 @@ type AISetting struct {
func (x *AISetting) Reset() {
*x = AISetting{}
- mi := &file_store_setting_proto_msgTypes[8]
+ mi := &file_store_setting_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1023,7 +1074,7 @@ func (x *AISetting) String() string {
func (*AISetting) ProtoMessage() {}
func (x *AISetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[8]
+ mi := &file_store_setting_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1036,7 +1087,7 @@ func (x *AISetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use AISetting.ProtoReflect.Descriptor instead.
func (*AISetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{8}
+ return file_store_setting_proto_rawDescGZIP(), []int{9}
}
func (x *AISetting) GetEnabled() bool {
@@ -1090,7 +1141,7 @@ type EnvironmentSetting struct {
func (x *EnvironmentSetting) Reset() {
*x = EnvironmentSetting{}
- mi := &file_store_setting_proto_msgTypes[9]
+ mi := &file_store_setting_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1102,7 +1153,7 @@ func (x *EnvironmentSetting) String() string {
func (*EnvironmentSetting) ProtoMessage() {}
func (x *EnvironmentSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[9]
+ mi := &file_store_setting_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1115,7 +1166,7 @@ func (x *EnvironmentSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use EnvironmentSetting.ProtoReflect.Descriptor instead.
func (*EnvironmentSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{9}
+ return file_store_setting_proto_rawDescGZIP(), []int{10}
}
func (x *EnvironmentSetting) GetEnvironments() []*EnvironmentSetting_Environment {
@@ -1136,7 +1187,7 @@ type WorkspaceApprovalSetting_Rule struct {
func (x *WorkspaceApprovalSetting_Rule) Reset() {
*x = WorkspaceApprovalSetting_Rule{}
- mi := &file_store_setting_proto_msgTypes[10]
+ mi := &file_store_setting_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1148,7 +1199,7 @@ func (x *WorkspaceApprovalSetting_Rule) String() string {
func (*WorkspaceApprovalSetting_Rule) ProtoMessage() {}
func (x *WorkspaceApprovalSetting_Rule) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[10]
+ mi := &file_store_setting_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1161,7 +1212,7 @@ func (x *WorkspaceApprovalSetting_Rule) ProtoReflect() protoreflect.Message {
// Deprecated: Use WorkspaceApprovalSetting_Rule.ProtoReflect.Descriptor instead.
func (*WorkspaceApprovalSetting_Rule) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{2, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{3, 0}
}
func (x *WorkspaceApprovalSetting_Rule) GetTemplate() *ApprovalTemplate {
@@ -1203,7 +1254,7 @@ type DataClassificationSetting_DataClassificationConfig struct {
func (x *DataClassificationSetting_DataClassificationConfig) Reset() {
*x = DataClassificationSetting_DataClassificationConfig{}
- mi := &file_store_setting_proto_msgTypes[11]
+ mi := &file_store_setting_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1215,7 +1266,7 @@ func (x *DataClassificationSetting_DataClassificationConfig) String() string {
func (*DataClassificationSetting_DataClassificationConfig) ProtoMessage() {}
func (x *DataClassificationSetting_DataClassificationConfig) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[11]
+ mi := &file_store_setting_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1228,7 +1279,7 @@ func (x *DataClassificationSetting_DataClassificationConfig) ProtoReflect() prot
// Deprecated: Use DataClassificationSetting_DataClassificationConfig.ProtoReflect.Descriptor instead.
func (*DataClassificationSetting_DataClassificationConfig) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{3, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{4, 0}
}
func (x *DataClassificationSetting_DataClassificationConfig) GetId() string {
@@ -1270,7 +1321,7 @@ type DataClassificationSetting_DataClassificationConfig_Level struct {
func (x *DataClassificationSetting_DataClassificationConfig_Level) Reset() {
*x = DataClassificationSetting_DataClassificationConfig_Level{}
- mi := &file_store_setting_proto_msgTypes[12]
+ mi := &file_store_setting_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1282,7 +1333,7 @@ func (x *DataClassificationSetting_DataClassificationConfig_Level) String() stri
func (*DataClassificationSetting_DataClassificationConfig_Level) ProtoMessage() {}
func (x *DataClassificationSetting_DataClassificationConfig_Level) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[12]
+ mi := &file_store_setting_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1295,7 +1346,7 @@ func (x *DataClassificationSetting_DataClassificationConfig_Level) ProtoReflect(
// Deprecated: Use DataClassificationSetting_DataClassificationConfig_Level.ProtoReflect.Descriptor instead.
func (*DataClassificationSetting_DataClassificationConfig_Level) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{3, 0, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{4, 0, 0}
}
func (x *DataClassificationSetting_DataClassificationConfig_Level) GetId() string {
@@ -1332,7 +1383,7 @@ type DataClassificationSetting_DataClassificationConfig_DataClassification struc
func (x *DataClassificationSetting_DataClassificationConfig_DataClassification) Reset() {
*x = DataClassificationSetting_DataClassificationConfig_DataClassification{}
- mi := &file_store_setting_proto_msgTypes[13]
+ mi := &file_store_setting_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1344,7 +1395,7 @@ func (x *DataClassificationSetting_DataClassificationConfig_DataClassification)
func (*DataClassificationSetting_DataClassificationConfig_DataClassification) ProtoMessage() {}
func (x *DataClassificationSetting_DataClassificationConfig_DataClassification) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[13]
+ mi := &file_store_setting_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1357,7 +1408,7 @@ func (x *DataClassificationSetting_DataClassificationConfig_DataClassification)
// Deprecated: Use DataClassificationSetting_DataClassificationConfig_DataClassification.ProtoReflect.Descriptor instead.
func (*DataClassificationSetting_DataClassificationConfig_DataClassification) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{3, 0, 1}
+ return file_store_setting_proto_rawDescGZIP(), []int{4, 0, 1}
}
func (x *DataClassificationSetting_DataClassificationConfig_DataClassification) GetId() string {
@@ -1405,7 +1456,7 @@ type SemanticTypeSetting_SemanticType struct {
func (x *SemanticTypeSetting_SemanticType) Reset() {
*x = SemanticTypeSetting_SemanticType{}
- mi := &file_store_setting_proto_msgTypes[15]
+ mi := &file_store_setting_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1417,7 +1468,7 @@ func (x *SemanticTypeSetting_SemanticType) String() string {
func (*SemanticTypeSetting_SemanticType) ProtoMessage() {}
func (x *SemanticTypeSetting_SemanticType) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[15]
+ mi := &file_store_setting_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1430,7 +1481,7 @@ func (x *SemanticTypeSetting_SemanticType) ProtoReflect() protoreflect.Message {
// Deprecated: Use SemanticTypeSetting_SemanticType.ProtoReflect.Descriptor instead.
func (*SemanticTypeSetting_SemanticType) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{4, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{5, 0}
}
func (x *SemanticTypeSetting_SemanticType) GetId() string {
@@ -1479,7 +1530,7 @@ type Algorithm_FullMask struct {
func (x *Algorithm_FullMask) Reset() {
*x = Algorithm_FullMask{}
- mi := &file_store_setting_proto_msgTypes[16]
+ mi := &file_store_setting_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1491,7 +1542,7 @@ func (x *Algorithm_FullMask) String() string {
func (*Algorithm_FullMask) ProtoMessage() {}
func (x *Algorithm_FullMask) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[16]
+ mi := &file_store_setting_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1504,7 +1555,7 @@ func (x *Algorithm_FullMask) ProtoReflect() protoreflect.Message {
// Deprecated: Use Algorithm_FullMask.ProtoReflect.Descriptor instead.
func (*Algorithm_FullMask) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{6, 0}
}
func (x *Algorithm_FullMask) GetSubstitution() string {
@@ -1525,7 +1576,7 @@ type Algorithm_RangeMask struct {
func (x *Algorithm_RangeMask) Reset() {
*x = Algorithm_RangeMask{}
- mi := &file_store_setting_proto_msgTypes[17]
+ mi := &file_store_setting_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1537,7 +1588,7 @@ func (x *Algorithm_RangeMask) String() string {
func (*Algorithm_RangeMask) ProtoMessage() {}
func (x *Algorithm_RangeMask) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[17]
+ mi := &file_store_setting_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1550,7 +1601,7 @@ func (x *Algorithm_RangeMask) ProtoReflect() protoreflect.Message {
// Deprecated: Use Algorithm_RangeMask.ProtoReflect.Descriptor instead.
func (*Algorithm_RangeMask) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5, 1}
+ return file_store_setting_proto_rawDescGZIP(), []int{6, 1}
}
func (x *Algorithm_RangeMask) GetSlices() []*Algorithm_RangeMask_Slice {
@@ -1570,7 +1621,7 @@ type Algorithm_MD5Mask struct {
func (x *Algorithm_MD5Mask) Reset() {
*x = Algorithm_MD5Mask{}
- mi := &file_store_setting_proto_msgTypes[18]
+ mi := &file_store_setting_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1582,7 +1633,7 @@ func (x *Algorithm_MD5Mask) String() string {
func (*Algorithm_MD5Mask) ProtoMessage() {}
func (x *Algorithm_MD5Mask) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[18]
+ mi := &file_store_setting_proto_msgTypes[19]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1595,7 +1646,7 @@ func (x *Algorithm_MD5Mask) ProtoReflect() protoreflect.Message {
// Deprecated: Use Algorithm_MD5Mask.ProtoReflect.Descriptor instead.
func (*Algorithm_MD5Mask) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5, 2}
+ return file_store_setting_proto_rawDescGZIP(), []int{6, 2}
}
func (x *Algorithm_MD5Mask) GetSalt() string {
@@ -1617,7 +1668,7 @@ type Algorithm_InnerOuterMask struct {
func (x *Algorithm_InnerOuterMask) Reset() {
*x = Algorithm_InnerOuterMask{}
- mi := &file_store_setting_proto_msgTypes[19]
+ mi := &file_store_setting_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1629,7 +1680,7 @@ func (x *Algorithm_InnerOuterMask) String() string {
func (*Algorithm_InnerOuterMask) ProtoMessage() {}
func (x *Algorithm_InnerOuterMask) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[19]
+ mi := &file_store_setting_proto_msgTypes[20]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1642,7 +1693,7 @@ func (x *Algorithm_InnerOuterMask) ProtoReflect() protoreflect.Message {
// Deprecated: Use Algorithm_InnerOuterMask.ProtoReflect.Descriptor instead.
func (*Algorithm_InnerOuterMask) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5, 3}
+ return file_store_setting_proto_rawDescGZIP(), []int{6, 3}
}
func (x *Algorithm_InnerOuterMask) GetPrefixLen() int32 {
@@ -1687,7 +1738,7 @@ type Algorithm_RangeMask_Slice struct {
func (x *Algorithm_RangeMask_Slice) Reset() {
*x = Algorithm_RangeMask_Slice{}
- mi := &file_store_setting_proto_msgTypes[20]
+ mi := &file_store_setting_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1699,7 +1750,7 @@ func (x *Algorithm_RangeMask_Slice) String() string {
func (*Algorithm_RangeMask_Slice) ProtoMessage() {}
func (x *Algorithm_RangeMask_Slice) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[20]
+ mi := &file_store_setting_proto_msgTypes[21]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1712,7 +1763,7 @@ func (x *Algorithm_RangeMask_Slice) ProtoReflect() protoreflect.Message {
// Deprecated: Use Algorithm_RangeMask_Slice.ProtoReflect.Descriptor instead.
func (*Algorithm_RangeMask_Slice) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{5, 1, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{6, 1, 0}
}
func (x *Algorithm_RangeMask_Slice) GetStart() int32 {
@@ -1745,7 +1796,7 @@ type AppIMSetting_Slack struct {
func (x *AppIMSetting_Slack) Reset() {
*x = AppIMSetting_Slack{}
- mi := &file_store_setting_proto_msgTypes[21]
+ mi := &file_store_setting_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1757,7 +1808,7 @@ func (x *AppIMSetting_Slack) String() string {
func (*AppIMSetting_Slack) ProtoMessage() {}
func (x *AppIMSetting_Slack) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[21]
+ mi := &file_store_setting_proto_msgTypes[22]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1770,7 +1821,7 @@ func (x *AppIMSetting_Slack) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_Slack.ProtoReflect.Descriptor instead.
func (*AppIMSetting_Slack) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 0}
}
func (x *AppIMSetting_Slack) GetToken() string {
@@ -1790,7 +1841,7 @@ type AppIMSetting_Feishu struct {
func (x *AppIMSetting_Feishu) Reset() {
*x = AppIMSetting_Feishu{}
- mi := &file_store_setting_proto_msgTypes[22]
+ mi := &file_store_setting_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1802,7 +1853,7 @@ func (x *AppIMSetting_Feishu) String() string {
func (*AppIMSetting_Feishu) ProtoMessage() {}
func (x *AppIMSetting_Feishu) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[22]
+ mi := &file_store_setting_proto_msgTypes[23]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1815,7 +1866,7 @@ func (x *AppIMSetting_Feishu) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_Feishu.ProtoReflect.Descriptor instead.
func (*AppIMSetting_Feishu) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 1}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 1}
}
func (x *AppIMSetting_Feishu) GetAppId() string {
@@ -1843,7 +1894,7 @@ type AppIMSetting_Wecom struct {
func (x *AppIMSetting_Wecom) Reset() {
*x = AppIMSetting_Wecom{}
- mi := &file_store_setting_proto_msgTypes[23]
+ mi := &file_store_setting_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1855,7 +1906,7 @@ func (x *AppIMSetting_Wecom) String() string {
func (*AppIMSetting_Wecom) ProtoMessage() {}
func (x *AppIMSetting_Wecom) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[23]
+ mi := &file_store_setting_proto_msgTypes[24]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1868,7 +1919,7 @@ func (x *AppIMSetting_Wecom) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_Wecom.ProtoReflect.Descriptor instead.
func (*AppIMSetting_Wecom) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 2}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 2}
}
func (x *AppIMSetting_Wecom) GetCorpId() string {
@@ -1902,7 +1953,7 @@ type AppIMSetting_Lark struct {
func (x *AppIMSetting_Lark) Reset() {
*x = AppIMSetting_Lark{}
- mi := &file_store_setting_proto_msgTypes[24]
+ mi := &file_store_setting_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1914,7 +1965,7 @@ func (x *AppIMSetting_Lark) String() string {
func (*AppIMSetting_Lark) ProtoMessage() {}
func (x *AppIMSetting_Lark) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[24]
+ mi := &file_store_setting_proto_msgTypes[25]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1927,7 +1978,7 @@ func (x *AppIMSetting_Lark) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_Lark.ProtoReflect.Descriptor instead.
func (*AppIMSetting_Lark) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 3}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 3}
}
func (x *AppIMSetting_Lark) GetAppId() string {
@@ -1955,7 +2006,7 @@ type AppIMSetting_DingTalk struct {
func (x *AppIMSetting_DingTalk) Reset() {
*x = AppIMSetting_DingTalk{}
- mi := &file_store_setting_proto_msgTypes[25]
+ mi := &file_store_setting_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1967,7 +2018,7 @@ func (x *AppIMSetting_DingTalk) String() string {
func (*AppIMSetting_DingTalk) ProtoMessage() {}
func (x *AppIMSetting_DingTalk) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[25]
+ mi := &file_store_setting_proto_msgTypes[26]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1980,7 +2031,7 @@ func (x *AppIMSetting_DingTalk) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_DingTalk.ProtoReflect.Descriptor instead.
func (*AppIMSetting_DingTalk) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 4}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 4}
}
func (x *AppIMSetting_DingTalk) GetClientId() string {
@@ -2018,7 +2069,7 @@ type AppIMSetting_Teams struct {
func (x *AppIMSetting_Teams) Reset() {
*x = AppIMSetting_Teams{}
- mi := &file_store_setting_proto_msgTypes[26]
+ mi := &file_store_setting_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2030,7 +2081,7 @@ func (x *AppIMSetting_Teams) String() string {
func (*AppIMSetting_Teams) ProtoMessage() {}
func (x *AppIMSetting_Teams) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[26]
+ mi := &file_store_setting_proto_msgTypes[27]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2043,7 +2094,7 @@ func (x *AppIMSetting_Teams) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_Teams.ProtoReflect.Descriptor instead.
func (*AppIMSetting_Teams) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 5}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 5}
}
func (x *AppIMSetting_Teams) GetTenantId() string {
@@ -2085,7 +2136,7 @@ type AppIMSetting_IMSetting struct {
func (x *AppIMSetting_IMSetting) Reset() {
*x = AppIMSetting_IMSetting{}
- mi := &file_store_setting_proto_msgTypes[27]
+ mi := &file_store_setting_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2097,7 +2148,7 @@ func (x *AppIMSetting_IMSetting) String() string {
func (*AppIMSetting_IMSetting) ProtoMessage() {}
func (x *AppIMSetting_IMSetting) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[27]
+ mi := &file_store_setting_proto_msgTypes[28]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2110,7 +2161,7 @@ func (x *AppIMSetting_IMSetting) ProtoReflect() protoreflect.Message {
// Deprecated: Use AppIMSetting_IMSetting.ProtoReflect.Descriptor instead.
func (*AppIMSetting_IMSetting) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{6, 6}
+ return file_store_setting_proto_rawDescGZIP(), []int{7, 6}
}
func (x *AppIMSetting_IMSetting) GetType() ProjectWebhook_Type {
@@ -2237,7 +2288,7 @@ type EnvironmentSetting_Environment struct {
func (x *EnvironmentSetting_Environment) Reset() {
*x = EnvironmentSetting_Environment{}
- mi := &file_store_setting_proto_msgTypes[28]
+ mi := &file_store_setting_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2249,7 +2300,7 @@ func (x *EnvironmentSetting_Environment) String() string {
func (*EnvironmentSetting_Environment) ProtoMessage() {}
func (x *EnvironmentSetting_Environment) ProtoReflect() protoreflect.Message {
- mi := &file_store_setting_proto_msgTypes[28]
+ mi := &file_store_setting_proto_msgTypes[29]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2262,7 +2313,7 @@ func (x *EnvironmentSetting_Environment) ProtoReflect() protoreflect.Message {
// Deprecated: Use EnvironmentSetting_Environment.ProtoReflect.Descriptor instead.
func (*EnvironmentSetting_Environment) Descriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{9, 0}
+ return file_store_setting_proto_rawDescGZIP(), []int{10, 0}
}
func (x *EnvironmentSetting_Environment) GetId() string {
@@ -2297,7 +2348,11 @@ var File_store_setting_proto protoreflect.FileDescriptor
const file_store_setting_proto_rawDesc = "" +
"\n" +
- "\x13store/setting.proto\x12\x0ebytebase.store\x1a\x1egoogle/protobuf/duration.proto\x1a\x16google/type/expr.proto\x1a\x14store/approval.proto\x1a\x1bstore/project_webhook.proto\"\xfa\x06\n" +
+ "\x13store/setting.proto\x12\x0ebytebase.store\x1a\x1egoogle/protobuf/duration.proto\x1a\x16google/type/expr.proto\x1a\x14store/approval.proto\x1a\x1bstore/project_webhook.proto\"S\n" +
+ "\rSystemSetting\x12\x1f\n" +
+ "\vauth_secret\x18\x01 \x01(\tR\n" +
+ "authSecret\x12!\n" +
+ "\fworkspace_id\x18\x02 \x01(\tR\vworkspaceId\"\xfa\x06\n" +
"\x17WorkspaceProfileSetting\x12!\n" +
"\fexternal_url\x18\x01 \x01(\tR\vexternalUrl\x12'\n" +
"\x0fdisallow_signup\x18\x02 \x01(\bR\x0edisallowSignup\x12\x1f\n" +
@@ -2462,11 +2517,11 @@ const file_store_setting_proto_rawDesc = "" +
"\x05color\x18\x04 \x01(\tR\x05color\x1a7\n" +
"\tTagsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\x81\x02\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\xea\x01\n" +
"\vSettingName\x12\x1c\n" +
- "\x18SETTING_NAME_UNSPECIFIED\x10\x00\x12\x0f\n" +
- "\vAUTH_SECRET\x10\x01\x12\x10\n" +
- "\fWORKSPACE_ID\x10\x03\x12\x15\n" +
+ "\x18SETTING_NAME_UNSPECIFIED\x10\x00\x12\n" +
+ "\n" +
+ "\x06SYSTEM\x10\x01\x12\x15\n" +
"\x11WORKSPACE_PROFILE\x10\x04\x12\x16\n" +
"\x12WORKSPACE_APPROVAL\x10\x05\x12\x16\n" +
"\x12ENTERPRISE_LICENSE\x10\a\x12\n" +
@@ -2498,7 +2553,7 @@ func file_store_setting_proto_rawDescGZIP() []byte {
}
var file_store_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
-var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
+var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 31)
var file_store_setting_proto_goTypes = []any{
(SettingName)(0), // 0: bytebase.store.SettingName
(DatabaseChangeMode)(0), // 1: bytebase.store.DatabaseChangeMode
@@ -2506,76 +2561,77 @@ var file_store_setting_proto_goTypes = []any{
(WorkspaceApprovalSetting_Rule_Source)(0), // 3: bytebase.store.WorkspaceApprovalSetting.Rule.Source
(Algorithm_InnerOuterMask_MaskType)(0), // 4: bytebase.store.Algorithm.InnerOuterMask.MaskType
(AISetting_Provider)(0), // 5: bytebase.store.AISetting.Provider
- (*WorkspaceProfileSetting)(nil), // 6: bytebase.store.WorkspaceProfileSetting
- (*Announcement)(nil), // 7: bytebase.store.Announcement
- (*WorkspaceApprovalSetting)(nil), // 8: bytebase.store.WorkspaceApprovalSetting
- (*DataClassificationSetting)(nil), // 9: bytebase.store.DataClassificationSetting
- (*SemanticTypeSetting)(nil), // 10: bytebase.store.SemanticTypeSetting
- (*Algorithm)(nil), // 11: bytebase.store.Algorithm
- (*AppIMSetting)(nil), // 12: bytebase.store.AppIMSetting
- (*PasswordRestrictionSetting)(nil), // 13: bytebase.store.PasswordRestrictionSetting
- (*AISetting)(nil), // 14: bytebase.store.AISetting
- (*EnvironmentSetting)(nil), // 15: bytebase.store.EnvironmentSetting
- (*WorkspaceApprovalSetting_Rule)(nil), // 16: bytebase.store.WorkspaceApprovalSetting.Rule
- (*DataClassificationSetting_DataClassificationConfig)(nil), // 17: bytebase.store.DataClassificationSetting.DataClassificationConfig
- (*DataClassificationSetting_DataClassificationConfig_Level)(nil), // 18: bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
- (*DataClassificationSetting_DataClassificationConfig_DataClassification)(nil), // 19: bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
- nil, // 20: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
- (*SemanticTypeSetting_SemanticType)(nil), // 21: bytebase.store.SemanticTypeSetting.SemanticType
- (*Algorithm_FullMask)(nil), // 22: bytebase.store.Algorithm.FullMask
- (*Algorithm_RangeMask)(nil), // 23: bytebase.store.Algorithm.RangeMask
- (*Algorithm_MD5Mask)(nil), // 24: bytebase.store.Algorithm.MD5Mask
- (*Algorithm_InnerOuterMask)(nil), // 25: bytebase.store.Algorithm.InnerOuterMask
- (*Algorithm_RangeMask_Slice)(nil), // 26: bytebase.store.Algorithm.RangeMask.Slice
- (*AppIMSetting_Slack)(nil), // 27: bytebase.store.AppIMSetting.Slack
- (*AppIMSetting_Feishu)(nil), // 28: bytebase.store.AppIMSetting.Feishu
- (*AppIMSetting_Wecom)(nil), // 29: bytebase.store.AppIMSetting.Wecom
- (*AppIMSetting_Lark)(nil), // 30: bytebase.store.AppIMSetting.Lark
- (*AppIMSetting_DingTalk)(nil), // 31: bytebase.store.AppIMSetting.DingTalk
- (*AppIMSetting_Teams)(nil), // 32: bytebase.store.AppIMSetting.Teams
- (*AppIMSetting_IMSetting)(nil), // 33: bytebase.store.AppIMSetting.IMSetting
- (*EnvironmentSetting_Environment)(nil), // 34: bytebase.store.EnvironmentSetting.Environment
- nil, // 35: bytebase.store.EnvironmentSetting.Environment.TagsEntry
- (*durationpb.Duration)(nil), // 36: google.protobuf.Duration
- (*ApprovalTemplate)(nil), // 37: bytebase.store.ApprovalTemplate
- (*expr.Expr)(nil), // 38: google.type.Expr
- (ProjectWebhook_Type)(0), // 39: bytebase.store.ProjectWebhook.Type
+ (*SystemSetting)(nil), // 6: bytebase.store.SystemSetting
+ (*WorkspaceProfileSetting)(nil), // 7: bytebase.store.WorkspaceProfileSetting
+ (*Announcement)(nil), // 8: bytebase.store.Announcement
+ (*WorkspaceApprovalSetting)(nil), // 9: bytebase.store.WorkspaceApprovalSetting
+ (*DataClassificationSetting)(nil), // 10: bytebase.store.DataClassificationSetting
+ (*SemanticTypeSetting)(nil), // 11: bytebase.store.SemanticTypeSetting
+ (*Algorithm)(nil), // 12: bytebase.store.Algorithm
+ (*AppIMSetting)(nil), // 13: bytebase.store.AppIMSetting
+ (*PasswordRestrictionSetting)(nil), // 14: bytebase.store.PasswordRestrictionSetting
+ (*AISetting)(nil), // 15: bytebase.store.AISetting
+ (*EnvironmentSetting)(nil), // 16: bytebase.store.EnvironmentSetting
+ (*WorkspaceApprovalSetting_Rule)(nil), // 17: bytebase.store.WorkspaceApprovalSetting.Rule
+ (*DataClassificationSetting_DataClassificationConfig)(nil), // 18: bytebase.store.DataClassificationSetting.DataClassificationConfig
+ (*DataClassificationSetting_DataClassificationConfig_Level)(nil), // 19: bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
+ (*DataClassificationSetting_DataClassificationConfig_DataClassification)(nil), // 20: bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
+ nil, // 21: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
+ (*SemanticTypeSetting_SemanticType)(nil), // 22: bytebase.store.SemanticTypeSetting.SemanticType
+ (*Algorithm_FullMask)(nil), // 23: bytebase.store.Algorithm.FullMask
+ (*Algorithm_RangeMask)(nil), // 24: bytebase.store.Algorithm.RangeMask
+ (*Algorithm_MD5Mask)(nil), // 25: bytebase.store.Algorithm.MD5Mask
+ (*Algorithm_InnerOuterMask)(nil), // 26: bytebase.store.Algorithm.InnerOuterMask
+ (*Algorithm_RangeMask_Slice)(nil), // 27: bytebase.store.Algorithm.RangeMask.Slice
+ (*AppIMSetting_Slack)(nil), // 28: bytebase.store.AppIMSetting.Slack
+ (*AppIMSetting_Feishu)(nil), // 29: bytebase.store.AppIMSetting.Feishu
+ (*AppIMSetting_Wecom)(nil), // 30: bytebase.store.AppIMSetting.Wecom
+ (*AppIMSetting_Lark)(nil), // 31: bytebase.store.AppIMSetting.Lark
+ (*AppIMSetting_DingTalk)(nil), // 32: bytebase.store.AppIMSetting.DingTalk
+ (*AppIMSetting_Teams)(nil), // 33: bytebase.store.AppIMSetting.Teams
+ (*AppIMSetting_IMSetting)(nil), // 34: bytebase.store.AppIMSetting.IMSetting
+ (*EnvironmentSetting_Environment)(nil), // 35: bytebase.store.EnvironmentSetting.Environment
+ nil, // 36: bytebase.store.EnvironmentSetting.Environment.TagsEntry
+ (*durationpb.Duration)(nil), // 37: google.protobuf.Duration
+ (*ApprovalTemplate)(nil), // 38: bytebase.store.ApprovalTemplate
+ (*expr.Expr)(nil), // 39: google.type.Expr
+ (ProjectWebhook_Type)(0), // 40: bytebase.store.ProjectWebhook.Type
}
var file_store_setting_proto_depIdxs = []int32{
- 36, // 0: bytebase.store.WorkspaceProfileSetting.token_duration:type_name -> google.protobuf.Duration
- 7, // 1: bytebase.store.WorkspaceProfileSetting.announcement:type_name -> bytebase.store.Announcement
- 36, // 2: bytebase.store.WorkspaceProfileSetting.maximum_role_expiration:type_name -> google.protobuf.Duration
+ 37, // 0: bytebase.store.WorkspaceProfileSetting.token_duration:type_name -> google.protobuf.Duration
+ 8, // 1: bytebase.store.WorkspaceProfileSetting.announcement:type_name -> bytebase.store.Announcement
+ 37, // 2: bytebase.store.WorkspaceProfileSetting.maximum_role_expiration:type_name -> google.protobuf.Duration
1, // 3: bytebase.store.WorkspaceProfileSetting.database_change_mode:type_name -> bytebase.store.DatabaseChangeMode
- 36, // 4: bytebase.store.WorkspaceProfileSetting.inactive_session_timeout:type_name -> google.protobuf.Duration
+ 37, // 4: bytebase.store.WorkspaceProfileSetting.inactive_session_timeout:type_name -> google.protobuf.Duration
2, // 5: bytebase.store.Announcement.level:type_name -> bytebase.store.Announcement.AlertLevel
- 16, // 6: bytebase.store.WorkspaceApprovalSetting.rules:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule
- 17, // 7: bytebase.store.DataClassificationSetting.configs:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig
- 21, // 8: bytebase.store.SemanticTypeSetting.types:type_name -> bytebase.store.SemanticTypeSetting.SemanticType
- 22, // 9: bytebase.store.Algorithm.full_mask:type_name -> bytebase.store.Algorithm.FullMask
- 23, // 10: bytebase.store.Algorithm.range_mask:type_name -> bytebase.store.Algorithm.RangeMask
- 24, // 11: bytebase.store.Algorithm.md5_mask:type_name -> bytebase.store.Algorithm.MD5Mask
- 25, // 12: bytebase.store.Algorithm.inner_outer_mask:type_name -> bytebase.store.Algorithm.InnerOuterMask
- 33, // 13: bytebase.store.AppIMSetting.settings:type_name -> bytebase.store.AppIMSetting.IMSetting
- 36, // 14: bytebase.store.PasswordRestrictionSetting.password_rotation:type_name -> google.protobuf.Duration
+ 17, // 6: bytebase.store.WorkspaceApprovalSetting.rules:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule
+ 18, // 7: bytebase.store.DataClassificationSetting.configs:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig
+ 22, // 8: bytebase.store.SemanticTypeSetting.types:type_name -> bytebase.store.SemanticTypeSetting.SemanticType
+ 23, // 9: bytebase.store.Algorithm.full_mask:type_name -> bytebase.store.Algorithm.FullMask
+ 24, // 10: bytebase.store.Algorithm.range_mask:type_name -> bytebase.store.Algorithm.RangeMask
+ 25, // 11: bytebase.store.Algorithm.md5_mask:type_name -> bytebase.store.Algorithm.MD5Mask
+ 26, // 12: bytebase.store.Algorithm.inner_outer_mask:type_name -> bytebase.store.Algorithm.InnerOuterMask
+ 34, // 13: bytebase.store.AppIMSetting.settings:type_name -> bytebase.store.AppIMSetting.IMSetting
+ 37, // 14: bytebase.store.PasswordRestrictionSetting.password_rotation:type_name -> google.protobuf.Duration
5, // 15: bytebase.store.AISetting.provider:type_name -> bytebase.store.AISetting.Provider
- 34, // 16: bytebase.store.EnvironmentSetting.environments:type_name -> bytebase.store.EnvironmentSetting.Environment
- 37, // 17: bytebase.store.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate
- 38, // 18: bytebase.store.WorkspaceApprovalSetting.Rule.condition:type_name -> google.type.Expr
+ 35, // 16: bytebase.store.EnvironmentSetting.environments:type_name -> bytebase.store.EnvironmentSetting.Environment
+ 38, // 17: bytebase.store.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate
+ 39, // 18: bytebase.store.WorkspaceApprovalSetting.Rule.condition:type_name -> google.type.Expr
3, // 19: bytebase.store.WorkspaceApprovalSetting.Rule.source:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule.Source
- 18, // 20: bytebase.store.DataClassificationSetting.DataClassificationConfig.levels:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
- 20, // 21: bytebase.store.DataClassificationSetting.DataClassificationConfig.classification:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
- 19, // 22: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry.value:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
- 11, // 23: bytebase.store.SemanticTypeSetting.SemanticType.algorithm:type_name -> bytebase.store.Algorithm
- 26, // 24: bytebase.store.Algorithm.RangeMask.slices:type_name -> bytebase.store.Algorithm.RangeMask.Slice
+ 19, // 20: bytebase.store.DataClassificationSetting.DataClassificationConfig.levels:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
+ 21, // 21: bytebase.store.DataClassificationSetting.DataClassificationConfig.classification:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
+ 20, // 22: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry.value:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
+ 12, // 23: bytebase.store.SemanticTypeSetting.SemanticType.algorithm:type_name -> bytebase.store.Algorithm
+ 27, // 24: bytebase.store.Algorithm.RangeMask.slices:type_name -> bytebase.store.Algorithm.RangeMask.Slice
4, // 25: bytebase.store.Algorithm.InnerOuterMask.type:type_name -> bytebase.store.Algorithm.InnerOuterMask.MaskType
- 39, // 26: bytebase.store.AppIMSetting.IMSetting.type:type_name -> bytebase.store.ProjectWebhook.Type
- 27, // 27: bytebase.store.AppIMSetting.IMSetting.slack:type_name -> bytebase.store.AppIMSetting.Slack
- 28, // 28: bytebase.store.AppIMSetting.IMSetting.feishu:type_name -> bytebase.store.AppIMSetting.Feishu
- 29, // 29: bytebase.store.AppIMSetting.IMSetting.wecom:type_name -> bytebase.store.AppIMSetting.Wecom
- 30, // 30: bytebase.store.AppIMSetting.IMSetting.lark:type_name -> bytebase.store.AppIMSetting.Lark
- 31, // 31: bytebase.store.AppIMSetting.IMSetting.dingtalk:type_name -> bytebase.store.AppIMSetting.DingTalk
- 32, // 32: bytebase.store.AppIMSetting.IMSetting.teams:type_name -> bytebase.store.AppIMSetting.Teams
- 35, // 33: bytebase.store.EnvironmentSetting.Environment.tags:type_name -> bytebase.store.EnvironmentSetting.Environment.TagsEntry
+ 40, // 26: bytebase.store.AppIMSetting.IMSetting.type:type_name -> bytebase.store.ProjectWebhook.Type
+ 28, // 27: bytebase.store.AppIMSetting.IMSetting.slack:type_name -> bytebase.store.AppIMSetting.Slack
+ 29, // 28: bytebase.store.AppIMSetting.IMSetting.feishu:type_name -> bytebase.store.AppIMSetting.Feishu
+ 30, // 29: bytebase.store.AppIMSetting.IMSetting.wecom:type_name -> bytebase.store.AppIMSetting.Wecom
+ 31, // 30: bytebase.store.AppIMSetting.IMSetting.lark:type_name -> bytebase.store.AppIMSetting.Lark
+ 32, // 31: bytebase.store.AppIMSetting.IMSetting.dingtalk:type_name -> bytebase.store.AppIMSetting.DingTalk
+ 33, // 32: bytebase.store.AppIMSetting.IMSetting.teams:type_name -> bytebase.store.AppIMSetting.Teams
+ 36, // 33: bytebase.store.EnvironmentSetting.Environment.tags:type_name -> bytebase.store.EnvironmentSetting.Environment.TagsEntry
34, // [34:34] is the sub-list for method output_type
34, // [34:34] is the sub-list for method input_type
34, // [34:34] is the sub-list for extension type_name
@@ -2590,14 +2646,14 @@ func file_store_setting_proto_init() {
}
file_store_approval_proto_init()
file_store_project_webhook_proto_init()
- file_store_setting_proto_msgTypes[5].OneofWrappers = []any{
+ file_store_setting_proto_msgTypes[6].OneofWrappers = []any{
(*Algorithm_FullMask_)(nil),
(*Algorithm_RangeMask_)(nil),
(*Algorithm_Md5Mask)(nil),
(*Algorithm_InnerOuterMask_)(nil),
}
- file_store_setting_proto_msgTypes[13].OneofWrappers = []any{}
- file_store_setting_proto_msgTypes[27].OneofWrappers = []any{
+ file_store_setting_proto_msgTypes[14].OneofWrappers = []any{}
+ file_store_setting_proto_msgTypes[28].OneofWrappers = []any{
(*AppIMSetting_IMSetting_Slack)(nil),
(*AppIMSetting_IMSetting_Feishu)(nil),
(*AppIMSetting_IMSetting_Wecom)(nil),
@@ -2611,7 +2667,7 @@ func file_store_setting_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_setting_proto_rawDesc), len(file_store_setting_proto_rawDesc)),
NumEnums: 6,
- NumMessages: 30,
+ NumMessages: 31,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/backend/generated-go/store/setting_equal.pb.go b/backend/generated-go/store/setting_equal.pb.go
index 152a175875..08402ca9d7 100644
--- a/backend/generated-go/store/setting_equal.pb.go
+++ b/backend/generated-go/store/setting_equal.pb.go
@@ -8,6 +8,22 @@ import (
proto "google.golang.org/protobuf/proto"
)
+func (x *SystemSetting) Equal(y *SystemSetting) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.AuthSecret != y.AuthSecret {
+ return false
+ }
+ if x.WorkspaceId != y.WorkspaceId {
+ return false
+ }
+ return true
+}
+
func (x *WorkspaceProfileSetting) Equal(y *WorkspaceProfileSetting) bool {
if x == y {
return true
diff --git a/backend/migrator/migration/3.13/0012##migrate_system_setting.sql b/backend/migrator/migration/3.13/0012##migrate_system_setting.sql
new file mode 100644
index 0000000000..d75c21d480
--- /dev/null
+++ b/backend/migrator/migration/3.13/0012##migrate_system_setting.sql
@@ -0,0 +1,10 @@
+-- Migrate AUTH_SECRET and WORKSPACE_ID to SYSTEM setting
+INSERT INTO setting (name, value)
+SELECT
+ 'SYSTEM',
+ json_build_object(
+ 'authSecret', (SELECT value FROM setting WHERE name = 'AUTH_SECRET'),
+ 'workspaceId', (SELECT value FROM setting WHERE name = 'WORKSPACE_ID')
+ )::TEXT;
+
+DELETE FROM setting WHERE name IN ('AUTH_SECRET', 'WORKSPACE_ID');
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 06eac04e2e..f4d8c2d380 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -33,7 +33,7 @@ CREATE TABLE principal (
-- Setting
CREATE TABLE setting (
id serial PRIMARY KEY,
- -- name: AUTH_SECRET, WORKSPACE_ID, WORKSPACE_PROFILE, WORKSPACE_APPROVAL,
+ -- name: SYSTEM, WORKSPACE_PROFILE, WORKSPACE_APPROVAL,
-- ENTERPRISE_LICENSE, APP_IM, AI,
-- DATA_CLASSIFICATION, SEMANTIC_TYPES, PASSWORD_RESTRICTION, ENVIRONMENT
-- Enum: SettingName (proto/store/store/setting.proto)
@@ -562,13 +562,16 @@ INSERT INTO setting (name, value) VALUES ('ENVIRONMENT', '{"environments":[{"tit
-- Initialize settings with dynamically generated values
-- Generate random alphanumeric string (0-9, a-z, A-Z) compatible with Go's common.RandomString
--- Uses built-in random() function to pick random characters
-INSERT INTO setting (name, value) VALUES (
- 'AUTH_SECRET',
- (SELECT string_agg(substr('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', floor(random() * 62 + 1)::int, 1), '')
- FROM generate_series(1, 32))
+-- Initialize SYSTEM setting with auth_secret and workspace_id
+INSERT INTO setting (name, value)
+VALUES (
+ 'SYSTEM',
+ json_build_object(
+ 'authSecret', (SELECT string_agg(substr('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', floor(random() * 62 + 1)::int, 1), '')
+ FROM generate_series(1, 32)),
+ 'workspaceId', gen_random_uuid()::text
+ )::TEXT
);
-INSERT INTO setting (name, value) VALUES ('WORKSPACE_ID', gen_random_uuid()::text);
-- Initialize workspace IAM policy
-- Grant workspace member role to allUsers
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index b975073237..3d2d3a10d3 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -12,7 +12,7 @@ import (
func TestLatestVersion(t *testing.T) {
files, err := getSortedVersionedFiles()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.13.11"), *files[len(files)-1].version)
+ require.Equal(t, semver.MustParse("3.13.12"), *files[len(files)-1].version)
}
func TestVersionUnique(t *testing.T) {
diff --git a/backend/store/setting.go b/backend/store/setting.go
index 11bdf09ca2..9ea6f1a96b 100644
--- a/backend/store/setting.go
+++ b/backend/store/setting.go
@@ -79,16 +79,29 @@ func (s *Store) GetAppIMSetting(ctx context.Context) (*storepb.AppIMSetting, err
return payload, nil
}
-// GetWorkspaceID finds the workspace id in setting bb.workspace.id.
-func (s *Store) GetWorkspaceID(ctx context.Context) (string, error) {
- setting, err := s.GetSettingV2(ctx, storepb.SettingName_WORKSPACE_ID)
+func (s *Store) GetSystemSetting(ctx context.Context) (*storepb.SystemSetting, error) {
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_SYSTEM)
if err != nil {
- return "", errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_WORKSPACE_ID)
+ return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_SYSTEM)
}
if setting == nil {
- return "", errors.Errorf("cannot find setting %v", storepb.SettingName_WORKSPACE_ID)
+ return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_SYSTEM)
+ }
+
+ payload := new(storepb.SystemSetting)
+ if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), payload); err != nil {
+ return nil, err
}
- return setting.Value, nil
+ return payload, nil
+}
+
+// GetWorkspaceID finds the workspace id in setting bb.workspace.id.
+func (s *Store) GetWorkspaceID(ctx context.Context) (string, error) {
+ systemSetting, err := s.GetSystemSetting(ctx)
+ if err != nil {
+ return "", errors.Wrap(err, "failed to get system setting")
+ }
+ return systemSetting.WorkspaceId, nil
}
// GetWorkspaceApprovalSetting gets the workspace approval setting.
@@ -230,15 +243,12 @@ func (s *Store) GetSecret(ctx context.Context) (string, error) {
if s.Secret != "" {
return s.Secret, nil
}
- setting, err := s.GetSettingV2(ctx, storepb.SettingName_AUTH_SECRET)
+ systemSetting, err := s.GetSystemSetting(ctx)
if err != nil {
- return "", err
- }
- if setting == nil {
- return "", errors.New("auth secret not found")
+ return "", errors.Wrap(err, "failed to get system setting")
}
- s.Secret = setting.Value
- return setting.Value, nil
+ s.Secret = systemSetting.AuthSecret
+ return systemSetting.AuthSecret, nil
}
// UpsertSettingV2 upserts the setting by name.
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 4a10460c50..d2662428d0 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -280,6 +280,7 @@
- [PasswordRestrictionSetting](#bytebase-store-PasswordRestrictionSetting)
- [SemanticTypeSetting](#bytebase-store-SemanticTypeSetting)
- [SemanticTypeSetting.SemanticType](#bytebase-store-SemanticTypeSetting-SemanticType)
+ - [SystemSetting](#bytebase-store-SystemSetting)
- [WorkspaceApprovalSetting](#bytebase-store-WorkspaceApprovalSetting)
- [WorkspaceApprovalSetting.Rule](#bytebase-store-WorkspaceApprovalSetting-Rule)
- [WorkspaceProfileSetting](#bytebase-store-WorkspaceProfileSetting)
@@ -4569,6 +4570,22 @@ ISSUE_CREATE represents creating an issue. |
+<a name="bytebase-store-SystemSetting"></a>
+
+### SystemSetting
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| auth_secret | [string](#string) | | Authentication secret for token signing (32-character random string). |
+| workspace_id | [string](#string) | | Unique workspace identifier (UUID). |
+
+
+
+
+
+
<a name="bytebase-store-WorkspaceApprovalSetting"></a>
### WorkspaceApprovalSetting
@@ -4696,8 +4713,7 @@ We support three levels of AlertLevel: INFO, WARNING, and ERROR.
| Name | Number | Description |
| ---- | ------ | ----------- |
| SETTING_NAME_UNSPECIFIED | 0 | |
-| AUTH_SECRET | 1 | |
-| WORKSPACE_ID | 3 | |
+| SYSTEM | 1 | |
| WORKSPACE_PROFILE | 4 | |
| WORKSPACE_APPROVAL | 5 | |
| ENTERPRISE_LICENSE | 7 | |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 1476957127..a33a9fa75c 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -1298,6 +1298,10 @@
<a href="#bytebase.store.SemanticTypeSetting.SemanticType"><span class="badge">M</span>SemanticTypeSetting.SemanticType</a>
</li>
+ <li>
+ <a href="#bytebase.store.SystemSetting"><span class="badge">M</span>SystemSetting</a>
+ </li>
+
<li>
<a href="#bytebase.store.WorkspaceApprovalSetting"><span class="badge">M</span>WorkspaceApprovalSetting</a>
</li>
@@ -12036,6 +12040,37 @@ are /[a-z][0-9]-/. </p></td>
+ <h3 id="bytebase.store.SystemSetting">SystemSetting</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>auth_secret</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Authentication secret for token signing (32-character random string). </p></td>
+ </tr>
+
+ <tr>
+ <td>workspace_id</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Unique workspace identifier (UUID). </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.store.WorkspaceApprovalSetting">WorkspaceApprovalSetting</h3>
<p></p>
@@ -12381,17 +12416,11 @@ Default to this mode.</p></td>
</tr>
<tr>
- <td>AUTH_SECRET</td>
+ <td>SYSTEM</td>
<td>1</td>
<td><p></p></td>
</tr>
- <tr>
- <td>WORKSPACE_ID</td>
- <td>3</td>
- <td><p></p></td>
- </tr>
-
<tr>
<td>WORKSPACE_PROFILE</td>
<td>4</td>
diff --git a/proto/store/store/setting.proto b/proto/store/store/setting.proto
index 186b2130e3..93c5364c47 100644
--- a/proto/store/store/setting.proto
+++ b/proto/store/store/setting.proto
@@ -9,10 +9,16 @@ import "store/project_webhook.proto";
option go_package = "generated-go/store";
+message SystemSetting {
+ // Authentication secret for token signing (32-character random string).
+ string auth_secret = 1;
+ // Unique workspace identifier (UUID).
+ string workspace_id = 2;
+}
+
enum SettingName {
SETTING_NAME_UNSPECIFIED = 0;
- AUTH_SECRET = 1;
- WORKSPACE_ID = 3;
+ SYSTEM = 1;
WORKSPACE_PROFILE = 4;
WORKSPACE_APPROVAL = 5;
ENTERPRISE_LICENSE = 7;