Skip to content

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

refactor(setting): get restriction setting from actuator (#18790)

ecmadao5512fb92a701
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index 8043650f3e..ae4b275b47 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -6336,18 +6336,10 @@ components:
type: boolean
title: need_admin_setup
description: Whether the Bytebase instance requires initial admin setup.
- disallowSignup:
- type: boolean
- title: disallow_signup
- description: Whether self-service user signup is disabled.
lastActiveTime:
title: last_active_time
description: The last time any API call was made, refreshed on each request.
$ref: '#/components/schemas/google.protobuf.Timestamp'
- require2fa:
- type: boolean
- title: require_2fa
- description: Whether two-factor authentication is required for all users.
workspaceId:
type: string
title: workspace_id
@@ -6362,14 +6354,6 @@ components:
type: string
title: unlicensed_features
description: List of features that are not licensed.
- disallowPasswordSignin:
- type: boolean
- title: disallow_password_signin
- description: Whether password-based signin is disabled (except for workspace admins).
- passwordRestriction:
- title: password_restriction
- description: Password complexity and restriction requirements.
- $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting.PasswordRestriction'
docker:
type: boolean
title: docker
@@ -6398,6 +6382,17 @@ components:
type: boolean
title: external_url_from_flag
description: Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
+ announcement:
+ title: announcement
+ description: The setting of custom announcement
+ $ref: '#/components/schemas/bytebase.v1.Announcement'
+ enableMetricCollection:
+ type: boolean
+ title: enable_metric_collection
+ description: Whether to enable metric collection for the workspace.
+ restriction:
+ title: restriction
+ $ref: '#/components/schemas/bytebase.v1.Restriction'
title: ActuatorInfo
additionalProperties: false
description: |-
@@ -13915,6 +13910,53 @@ components:
title: ResourcePackage
additionalProperties: false
description: Custom branding resources for the Bytebase instance.
+ bytebase.v1.Restriction:
+ type: object
+ properties:
+ disallowSignup:
+ type: boolean
+ title: disallow_signup
+ description: Whether self-service user signup is disabled.
+ require2fa:
+ type: boolean
+ title: require_2fa
+ description: Whether two-factor authentication is required for all users.
+ disallowPasswordSignin:
+ type: boolean
+ title: disallow_password_signin
+ description: Whether password-based signin is disabled (except for workspace admins).
+ passwordRestriction:
+ title: password_restriction
+ description: Password complexity and restriction requirements.
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting.PasswordRestriction'
+ watermark:
+ type: boolean
+ title: watermark
+ description: Whether to display watermark on pages.
+ databaseChangeMode:
+ title: database_change_mode
+ description: The workspace database change mode.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseChangeMode'
+ inactiveSessionTimeout:
+ title: inactive_session_timeout
+ description: The session expiration time if not activity detected for the user. Value <= 0 means no limit.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ domains:
+ type: array
+ items:
+ type: string
+ title: domains
+ description: The workspace domain, e.g., bytebase.com.
+ enforceIdentityDomain:
+ type: boolean
+ title: enforce_identity_domain
+ description: Only user and group from the domains can be created and login.
+ maximumRoleExpiration:
+ title: maximum_role_expiration
+ description: The max duration for role expired.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ title: Restriction
+ additionalProperties: false
bytebase.v1.ReviewConfig:
type: object
properties:
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.go
index ae7da33dd4..812e92963a 100644
--- a/backend/api/v1/actuator_service.go
+++ b/backend/api/v1/actuator_service.go
@@ -168,6 +168,18 @@ func (s *ActuatorService) getServerInfo(ctx context.Context) (*v1pb.ActuatorInfo
externalURL = s.profile.ExternalURL
}
+ restriction := &v1pb.Restriction{
+ DisallowSignup: setting.DisallowSignup || s.profile.SaaS,
+ Require_2Fa: setting.Require_2Fa,
+ DisallowPasswordSignin: setting.DisallowPasswordSignin,
+ PasswordRestriction: passwordSetting,
+ Watermark: setting.GetWatermark(),
+ InactiveSessionTimeout: setting.GetInactiveSessionTimeout(),
+ DatabaseChangeMode: v1pb.DatabaseChangeMode(setting.DatabaseChangeMode),
+ Domains: setting.GetDomains(),
+ MaximumRoleExpiration: setting.GetMaximumRoleExpiration(),
+ }
+
serverInfo := v1pb.ActuatorInfo{
Version: s.profile.Version,
GitCommit: s.profile.GitCommit,
@@ -175,17 +187,16 @@ func (s *ActuatorService) getServerInfo(ctx context.Context) (*v1pb.ActuatorInfo
Demo: s.profile.Demo,
NeedAdminSetup: activeEndUserCount == 0,
ExternalUrl: externalURL,
- DisallowSignup: setting.DisallowSignup || s.profile.SaaS,
- Require_2Fa: setting.Require_2Fa,
LastActiveTime: timestamppb.New(time.Unix(s.profile.LastActiveTS.Load(), 0)),
WorkspaceId: workspaceID,
Debug: s.profile.RuntimeDebug.Load(),
Docker: s.profile.IsDocker,
UnlicensedFeatures: unlicensedFeaturesString,
- DisallowPasswordSignin: setting.DisallowPasswordSignin,
- PasswordRestriction: passwordSetting,
EnableSample: hasSampleInstances,
ExternalUrlFromFlag: s.profile.ExternalURL != "",
+ Announcement: convertToV1Announcement(setting.Announcement),
+ EnableMetricCollection: setting.GetEnableMetricCollection(),
+ Restriction: restriction,
}
stats, err := s.store.StatUsers(ctx)
diff --git a/backend/api/v1/setting_service_converter.go b/backend/api/v1/setting_service_converter.go
index 6924902fc4..0102ef2b82 100644
--- a/backend/api/v1/setting_service_converter.go
+++ b/backend/api/v1/setting_service_converter.go
@@ -278,6 +278,28 @@ func convertWorkspaceProfileSetting(v1Setting *v1pb.WorkspaceProfileSetting) *st
return storeSetting
}
+func convertToV1Announcement(announcement *storepb.WorkspaceProfileSetting_Announcement) *v1pb.Announcement {
+ if announcement != nil {
+ v1Announcement := &v1pb.Announcement{
+ Text: announcement.Text,
+ Link: announcement.Link,
+ }
+ switch announcement.Level {
+ case storepb.WorkspaceProfileSetting_Announcement_ALERT_LEVEL_UNSPECIFIED:
+ v1Announcement.Level = v1pb.Announcement_ALERT_LEVEL_UNSPECIFIED
+ case storepb.WorkspaceProfileSetting_Announcement_INFO:
+ v1Announcement.Level = v1pb.Announcement_INFO
+ case storepb.WorkspaceProfileSetting_Announcement_WARNING:
+ v1Announcement.Level = v1pb.Announcement_WARNING
+ case storepb.WorkspaceProfileSetting_Announcement_CRITICAL:
+ v1Announcement.Level = v1pb.Announcement_CRITICAL
+ default:
+ }
+ return v1Announcement
+ }
+ return nil
+}
+
func convertToWorkspaceProfileSetting(storeSetting *storepb.WorkspaceProfileSetting) *v1pb.WorkspaceProfileSetting {
if storeSetting == nil {
return nil
@@ -301,24 +323,7 @@ func convertToWorkspaceProfileSetting(storeSetting *storepb.WorkspaceProfileSett
DirectorySyncToken: storeSetting.DirectorySyncToken,
BrandingLogo: storeSetting.BrandingLogo,
PasswordRestriction: convertToPasswordRestrictionSetting(storeSetting.PasswordRestriction),
- }
-
- if storeSetting.Announcement != nil {
- v1Setting.Announcement = &v1pb.Announcement{
- Text: storeSetting.Announcement.Text,
- Link: storeSetting.Announcement.Link,
- }
- switch storeSetting.Announcement.Level {
- case storepb.WorkspaceProfileSetting_Announcement_ALERT_LEVEL_UNSPECIFIED:
- v1Setting.Announcement.Level = v1pb.Announcement_ALERT_LEVEL_UNSPECIFIED
- case storepb.WorkspaceProfileSetting_Announcement_INFO:
- v1Setting.Announcement.Level = v1pb.Announcement_INFO
- case storepb.WorkspaceProfileSetting_Announcement_WARNING:
- v1Setting.Announcement.Level = v1pb.Announcement_WARNING
- case storepb.WorkspaceProfileSetting_Announcement_CRITICAL:
- v1Setting.Announcement.Level = v1pb.Announcement_CRITICAL
- default:
- }
+ Announcement: convertToV1Announcement(storeSetting.Announcement),
}
return v1Setting
diff --git a/backend/generated-go/v1/actuator_service.pb.go b/backend/generated-go/v1/actuator_service.pb.go
index 41bfcec35a..66753df733 100644
--- a/backend/generated-go/v1/actuator_service.pb.go
+++ b/backend/generated-go/v1/actuator_service.pb.go
@@ -10,6 +10,7 @@ import (
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ durationpb "google.golang.org/protobuf/types/known/durationpb"
emptypb "google.golang.org/protobuf/types/known/emptypb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
@@ -284,6 +285,132 @@ func (*DeleteCacheRequest) Descriptor() ([]byte, []int) {
return file_v1_actuator_service_proto_rawDescGZIP(), []int{5}
}
+type Restriction struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Whether self-service user signup is disabled.
+ DisallowSignup bool `protobuf:"varint,1,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"`
+ // Whether two-factor authentication is required for all users.
+ Require_2Fa bool `protobuf:"varint,2,opt,name=require_2fa,json=require2fa,proto3" json:"require_2fa,omitempty"`
+ // Whether password-based signin is disabled (except for workspace admins).
+ DisallowPasswordSignin bool `protobuf:"varint,3,opt,name=disallow_password_signin,json=disallowPasswordSignin,proto3" json:"disallow_password_signin,omitempty"`
+ // Password complexity and restriction requirements.
+ PasswordRestriction *WorkspaceProfileSetting_PasswordRestriction `protobuf:"bytes,4,opt,name=password_restriction,json=passwordRestriction,proto3" json:"password_restriction,omitempty"`
+ // Whether to display watermark on pages.
+ Watermark bool `protobuf:"varint,5,opt,name=watermark,proto3" json:"watermark,omitempty"`
+ // The workspace database change mode.
+ DatabaseChangeMode DatabaseChangeMode `protobuf:"varint,6,opt,name=database_change_mode,json=databaseChangeMode,proto3,enum=bytebase.v1.DatabaseChangeMode" json:"database_change_mode,omitempty"`
+ // The session expiration time if not activity detected for the user. Value <= 0 means no limit.
+ InactiveSessionTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=inactive_session_timeout,json=inactiveSessionTimeout,proto3" json:"inactive_session_timeout,omitempty"`
+ // The workspace domain, e.g., bytebase.com.
+ Domains []string `protobuf:"bytes,8,rep,name=domains,proto3" json:"domains,omitempty"`
+ // Only user and group from the domains can be created and login.
+ EnforceIdentityDomain bool `protobuf:"varint,9,opt,name=enforce_identity_domain,json=enforceIdentityDomain,proto3" json:"enforce_identity_domain,omitempty"`
+ // The max duration for role expired.
+ MaximumRoleExpiration *durationpb.Duration `protobuf:"bytes,10,opt,name=maximum_role_expiration,json=maximumRoleExpiration,proto3" json:"maximum_role_expiration,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *Restriction) Reset() {
+ *x = Restriction{}
+ mi := &file_v1_actuator_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *Restriction) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Restriction) ProtoMessage() {}
+
+func (x *Restriction) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_actuator_service_proto_msgTypes[6]
+ 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 Restriction.ProtoReflect.Descriptor instead.
+func (*Restriction) Descriptor() ([]byte, []int) {
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *Restriction) GetDisallowSignup() bool {
+ if x != nil {
+ return x.DisallowSignup
+ }
+ return false
+}
+
+func (x *Restriction) GetRequire_2Fa() bool {
+ if x != nil {
+ return x.Require_2Fa
+ }
+ return false
+}
+
+func (x *Restriction) GetDisallowPasswordSignin() bool {
+ if x != nil {
+ return x.DisallowPasswordSignin
+ }
+ return false
+}
+
+func (x *Restriction) GetPasswordRestriction() *WorkspaceProfileSetting_PasswordRestriction {
+ if x != nil {
+ return x.PasswordRestriction
+ }
+ return nil
+}
+
+func (x *Restriction) GetWatermark() bool {
+ if x != nil {
+ return x.Watermark
+ }
+ return false
+}
+
+func (x *Restriction) GetDatabaseChangeMode() DatabaseChangeMode {
+ if x != nil {
+ return x.DatabaseChangeMode
+ }
+ return DatabaseChangeMode_DATABASE_CHANGE_MODE_UNSPECIFIED
+}
+
+func (x *Restriction) GetInactiveSessionTimeout() *durationpb.Duration {
+ if x != nil {
+ return x.InactiveSessionTimeout
+ }
+ return nil
+}
+
+func (x *Restriction) GetDomains() []string {
+ if x != nil {
+ return x.Domains
+ }
+ return nil
+}
+
+func (x *Restriction) GetEnforceIdentityDomain() bool {
+ if x != nil {
+ return x.EnforceIdentityDomain
+ }
+ return false
+}
+
+func (x *Restriction) GetMaximumRoleExpiration() *durationpb.Duration {
+ if x != nil {
+ return x.MaximumRoleExpiration
+ }
+ return nil
+}
+
// System information and configuration for the Bytebase instance.
// Actuator concept is similar to the Spring Boot Actuator.
type ActuatorInfo struct {
@@ -306,22 +433,14 @@ type ActuatorInfo struct {
ExternalUrl string `protobuf:"bytes,8,opt,name=external_url,json=externalUrl,proto3" json:"external_url,omitempty"`
// Whether the Bytebase instance requires initial admin setup.
NeedAdminSetup bool `protobuf:"varint,9,opt,name=need_admin_setup,json=needAdminSetup,proto3" json:"need_admin_setup,omitempty"`
- // Whether self-service user signup is disabled.
- DisallowSignup bool `protobuf:"varint,10,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"`
// The last time any API call was made, refreshed on each request.
LastActiveTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=last_active_time,json=lastActiveTime,proto3" json:"last_active_time,omitempty"`
- // Whether two-factor authentication is required for all users.
- Require_2Fa bool `protobuf:"varint,12,opt,name=require_2fa,json=require2fa,proto3" json:"require_2fa,omitempty"`
// The unique identifier for the workspace.
WorkspaceId string `protobuf:"bytes,13,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
// Whether debug mode is enabled.
Debug bool `protobuf:"varint,14,opt,name=debug,proto3" json:"debug,omitempty"`
// List of features that are not licensed.
UnlicensedFeatures []string `protobuf:"bytes,15,rep,name=unlicensed_features,json=unlicensedFeatures,proto3" json:"unlicensed_features,omitempty"`
- // Whether password-based signin is disabled (except for workspace admins).
- DisallowPasswordSignin bool `protobuf:"varint,16,opt,name=disallow_password_signin,json=disallowPasswordSignin,proto3" json:"disallow_password_signin,omitempty"`
- // Password complexity and restriction requirements.
- PasswordRestriction *WorkspaceProfileSetting_PasswordRestriction `protobuf:"bytes,17,opt,name=password_restriction,json=passwordRestriction,proto3" json:"password_restriction,omitempty"`
// Whether the Bytebase instance is running in Docker.
Docker bool `protobuf:"varint,18,opt,name=docker,proto3" json:"docker,omitempty"`
// Statistics about users in the system.
@@ -334,13 +453,18 @@ type ActuatorInfo struct {
EnableSample bool `protobuf:"varint,22,opt,name=enable_sample,json=enableSample,proto3" json:"enable_sample,omitempty"`
// Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
ExternalUrlFromFlag bool `protobuf:"varint,23,opt,name=external_url_from_flag,json=externalUrlFromFlag,proto3" json:"external_url_from_flag,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The setting of custom announcement
+ Announcement *Announcement `protobuf:"bytes,24,opt,name=announcement,proto3" json:"announcement,omitempty"`
+ // Whether to enable metric collection for the workspace.
+ EnableMetricCollection bool `protobuf:"varint,25,opt,name=enable_metric_collection,json=enableMetricCollection,proto3" json:"enable_metric_collection,omitempty"`
+ Restriction *Restriction `protobuf:"bytes,26,opt,name=restriction,proto3" json:"restriction,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ActuatorInfo) Reset() {
*x = ActuatorInfo{}
- mi := &file_v1_actuator_service_proto_msgTypes[6]
+ mi := &file_v1_actuator_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -352,7 +476,7 @@ func (x *ActuatorInfo) String() string {
func (*ActuatorInfo) ProtoMessage() {}
func (x *ActuatorInfo) ProtoReflect() protoreflect.Message {
- mi := &file_v1_actuator_service_proto_msgTypes[6]
+ mi := &file_v1_actuator_service_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -365,7 +489,7 @@ func (x *ActuatorInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActuatorInfo.ProtoReflect.Descriptor instead.
func (*ActuatorInfo) Descriptor() ([]byte, []int) {
- return file_v1_actuator_service_proto_rawDescGZIP(), []int{6}
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{7}
}
func (x *ActuatorInfo) GetVersion() string {
@@ -431,13 +555,6 @@ func (x *ActuatorInfo) GetNeedAdminSetup() bool {
return false
}
-func (x *ActuatorInfo) GetDisallowSignup() bool {
- if x != nil {
- return x.DisallowSignup
- }
- return false
-}
-
func (x *ActuatorInfo) GetLastActiveTime() *timestamppb.Timestamp {
if x != nil {
return x.LastActiveTime
@@ -445,13 +562,6 @@ func (x *ActuatorInfo) GetLastActiveTime() *timestamppb.Timestamp {
return nil
}
-func (x *ActuatorInfo) GetRequire_2Fa() bool {
- if x != nil {
- return x.Require_2Fa
- }
- return false
-}
-
func (x *ActuatorInfo) GetWorkspaceId() string {
if x != nil {
return x.WorkspaceId
@@ -473,20 +583,6 @@ func (x *ActuatorInfo) GetUnlicensedFeatures() []string {
return nil
}
-func (x *ActuatorInfo) GetDisallowPasswordSignin() bool {
- if x != nil {
- return x.DisallowPasswordSignin
- }
- return false
-}
-
-func (x *ActuatorInfo) GetPasswordRestriction() *WorkspaceProfileSetting_PasswordRestriction {
- if x != nil {
- return x.PasswordRestriction
- }
- return nil
-}
-
func (x *ActuatorInfo) GetDocker() bool {
if x != nil {
return x.Docker
@@ -529,6 +625,27 @@ func (x *ActuatorInfo) GetExternalUrlFromFlag() bool {
return false
}
+func (x *ActuatorInfo) GetAnnouncement() *Announcement {
+ if x != nil {
+ return x.Announcement
+ }
+ return nil
+}
+
+func (x *ActuatorInfo) GetEnableMetricCollection() bool {
+ if x != nil {
+ return x.EnableMetricCollection
+ }
+ return false
+}
+
+func (x *ActuatorInfo) GetRestriction() *Restriction {
+ if x != nil {
+ return x.Restriction
+ }
+ return nil
+}
+
// User statistics by type and state.
type ActuatorInfo_StatUser struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -544,7 +661,7 @@ type ActuatorInfo_StatUser struct {
func (x *ActuatorInfo_StatUser) Reset() {
*x = ActuatorInfo_StatUser{}
- mi := &file_v1_actuator_service_proto_msgTypes[7]
+ mi := &file_v1_actuator_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -556,7 +673,7 @@ func (x *ActuatorInfo_StatUser) String() string {
func (*ActuatorInfo_StatUser) ProtoMessage() {}
func (x *ActuatorInfo_StatUser) ProtoReflect() protoreflect.Message {
- mi := &file_v1_actuator_service_proto_msgTypes[7]
+ mi := &file_v1_actuator_service_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -569,7 +686,7 @@ func (x *ActuatorInfo_StatUser) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActuatorInfo_StatUser.ProtoReflect.Descriptor instead.
func (*ActuatorInfo_StatUser) Descriptor() ([]byte, []int) {
- return file_v1_actuator_service_proto_rawDescGZIP(), []int{6, 0}
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{7, 0}
}
func (x *ActuatorInfo_StatUser) GetUserType() UserType {
@@ -597,7 +714,7 @@ var File_v1_actuator_service_proto protoreflect.FileDescriptor
const file_v1_actuator_service_proto_rawDesc = "" +
"\n" +
- "\x19v1/actuator_service.proto\x12\vbytebase.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\x1a\x0fv1/common.proto\x1a\x18v1/setting_service.proto\x1a\x15v1/user_service.proto\"\x1b\n" +
+ "\x19v1/actuator_service.proto\x12\vbytebase.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\x1a\x0fv1/common.proto\x1a\x18v1/setting_service.proto\x1a\x15v1/user_service.proto\"\x1b\n" +
"\x19GetResourcePackageRequest\"%\n" +
"\x0fResourcePackage\x12\x12\n" +
"\x04logo\x18\x01 \x01(\fR\x04logo\"\x14\n" +
@@ -608,7 +725,20 @@ const file_v1_actuator_service_proto_rawDesc = "" +
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x03\xe0A\x02R\n" +
"updateMask\x12#\n" +
"\rallow_missing\x18\x03 \x01(\bR\fallowMissing\"\x14\n" +
- "\x12DeleteCacheRequest\"\xb0\t\n" +
+ "\x12DeleteCacheRequest\"\x9b\x05\n" +
+ "\vRestriction\x12,\n" +
+ "\x0fdisallow_signup\x18\x01 \x01(\bB\x03\xe0A\x03R\x0edisallowSignup\x12$\n" +
+ "\vrequire_2fa\x18\x02 \x01(\bB\x03\xe0A\x03R\n" +
+ "require2fa\x12=\n" +
+ "\x18disallow_password_signin\x18\x03 \x01(\bB\x03\xe0A\x03R\x16disallowPasswordSignin\x12p\n" +
+ "\x14password_restriction\x18\x04 \x01(\v28.bytebase.v1.WorkspaceProfileSetting.PasswordRestrictionB\x03\xe0A\x03R\x13passwordRestriction\x12!\n" +
+ "\twatermark\x18\x05 \x01(\bB\x03\xe0A\x03R\twatermark\x12V\n" +
+ "\x14database_change_mode\x18\x06 \x01(\x0e2\x1f.bytebase.v1.DatabaseChangeModeB\x03\xe0A\x03R\x12databaseChangeMode\x12X\n" +
+ "\x18inactive_session_timeout\x18\a \x01(\v2\x19.google.protobuf.DurationB\x03\xe0A\x03R\x16inactiveSessionTimeout\x12\x1d\n" +
+ "\adomains\x18\b \x03(\tB\x03\xe0A\x03R\adomains\x12;\n" +
+ "\x17enforce_identity_domain\x18\t \x01(\bB\x03\xe0A\x03R\x15enforceIdentityDomain\x12V\n" +
+ "\x17maximum_role_expiration\x18\n" +
+ " \x01(\v2\x19.google.protobuf.DurationB\x03\xe0A\x03R\x15maximumRoleExpiration\"\x87\t\n" +
"\fActuatorInfo\x12\x1d\n" +
"\aversion\x18\x01 \x01(\tB\x03\xe0A\x03R\aversion\x12\"\n" +
"\n" +
@@ -619,28 +749,26 @@ const file_v1_actuator_service_proto_rawDesc = "" +
"\x04host\x18\x06 \x01(\tB\x03\xe0A\x03R\x04host\x12\x17\n" +
"\x04port\x18\a \x01(\tB\x03\xe0A\x03R\x04port\x12&\n" +
"\fexternal_url\x18\b \x01(\tB\x03\xe0A\x03R\vexternalUrl\x12-\n" +
- "\x10need_admin_setup\x18\t \x01(\bB\x03\xe0A\x03R\x0eneedAdminSetup\x12,\n" +
- "\x0fdisallow_signup\x18\n" +
- " \x01(\bB\x03\xe0A\x03R\x0edisallowSignup\x12I\n" +
- "\x10last_active_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\x0elastActiveTime\x12$\n" +
- "\vrequire_2fa\x18\f \x01(\bB\x03\xe0A\x03R\n" +
- "require2fa\x12&\n" +
+ "\x10need_admin_setup\x18\t \x01(\bB\x03\xe0A\x03R\x0eneedAdminSetup\x12I\n" +
+ "\x10last_active_time\x18\v \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\x0elastActiveTime\x12&\n" +
"\fworkspace_id\x18\r \x01(\tB\x03\xe0A\x03R\vworkspaceId\x12\x14\n" +
"\x05debug\x18\x0e \x01(\bR\x05debug\x124\n" +
- "\x13unlicensed_features\x18\x0f \x03(\tB\x03\xe0A\x03R\x12unlicensedFeatures\x12=\n" +
- "\x18disallow_password_signin\x18\x10 \x01(\bB\x03\xe0A\x03R\x16disallowPasswordSignin\x12p\n" +
- "\x14password_restriction\x18\x11 \x01(\v28.bytebase.v1.WorkspaceProfileSetting.PasswordRestrictionB\x03\xe0A\x03R\x13passwordRestriction\x12\x1b\n" +
+ "\x13unlicensed_features\x18\x0f \x03(\tB\x03\xe0A\x03R\x12unlicensedFeatures\x12\x1b\n" +
"\x06docker\x18\x12 \x01(\bB\x03\xe0A\x03R\x06docker\x12F\n" +
"\n" +
"user_stats\x18\x13 \x03(\v2\".bytebase.v1.ActuatorInfo.StatUserB\x03\xe0A\x03R\tuserStats\x12=\n" +
"\x18activated_instance_count\x18\x14 \x01(\x05B\x03\xe0A\x03R\x16activatedInstanceCount\x125\n" +
"\x14total_instance_count\x18\x15 \x01(\x05B\x03\xe0A\x03R\x12totalInstanceCount\x12(\n" +
"\renable_sample\x18\x16 \x01(\bB\x03\xe0A\x03R\fenableSample\x128\n" +
- "\x16external_url_from_flag\x18\x17 \x01(\bB\x03\xe0A\x03R\x13externalUrlFromFlag\x1a~\n" +
+ "\x16external_url_from_flag\x18\x17 \x01(\bB\x03\xe0A\x03R\x13externalUrlFromFlag\x12B\n" +
+ "\fannouncement\x18\x18 \x01(\v2\x19.bytebase.v1.AnnouncementB\x03\xe0A\x03R\fannouncement\x12=\n" +
+ "\x18enable_metric_collection\x18\x19 \x01(\bB\x03\xe0A\x03R\x16enableMetricCollection\x12?\n" +
+ "\vrestriction\x18\x1a \x01(\v2\x18.bytebase.v1.RestrictionB\x03\xe0A\x03R\vrestriction\x1a~\n" +
"\bStatUser\x122\n" +
"\tuser_type\x18\x01 \x01(\x0e2\x15.bytebase.v1.UserTypeR\buserType\x12(\n" +
"\x05state\x18\x02 \x01(\x0e2\x12.bytebase.v1.StateR\x05state\x12\x14\n" +
- "\x05count\x18\x03 \x01(\x05R\x05count2\xa4\x05\n" +
+ "\x05count\x18\x03 \x01(\x05R\x05countJ\x04\b\n" +
+ "\x10\vJ\x04\b\f\x10\rJ\x04\b\x10\x10\x11J\x04\b\x11\x10\x122\xa4\x05\n" +
"\x0fActuatorService\x12s\n" +
"\x0fGetActuatorInfo\x12#.bytebase.v1.GetActuatorInfoRequest\x1a\x19.bytebase.v1.ActuatorInfo\" \xdaA\x00\x80\xea0\x01\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/actuator/info\x12\xaa\x01\n" +
"\x12UpdateActuatorInfo\x12&.bytebase.v1.UpdateActuatorInfoRequest\x1a\x19.bytebase.v1.ActuatorInfo\"Q\xdaA\x14actuator,update_mask\x8a\xea0\x0fbb.settings.set\x90\xea0\x01\x82\xd3\xe4\x93\x02\x1d:\bactuator2\x11/v1/actuator/info\x12\x82\x01\n" +
@@ -661,7 +789,7 @@ func file_v1_actuator_service_proto_rawDescGZIP() []byte {
return file_v1_actuator_service_proto_rawDescData
}
-var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
+var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_v1_actuator_service_proto_goTypes = []any{
(*GetResourcePackageRequest)(nil), // 0: bytebase.v1.GetResourcePackageRequest
(*ResourcePackage)(nil), // 1: bytebase.v1.ResourcePackage
@@ -669,38 +797,47 @@ var file_v1_actuator_service_proto_goTypes = []any{
(*GetActuatorInfoRequest)(nil), // 3: bytebase.v1.GetActuatorInfoRequest
(*UpdateActuatorInfoRequest)(nil), // 4: bytebase.v1.UpdateActuatorInfoRequest
(*DeleteCacheRequest)(nil), // 5: bytebase.v1.DeleteCacheRequest
- (*ActuatorInfo)(nil), // 6: bytebase.v1.ActuatorInfo
- (*ActuatorInfo_StatUser)(nil), // 7: bytebase.v1.ActuatorInfo.StatUser
- (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask
- (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
+ (*Restriction)(nil), // 6: bytebase.v1.Restriction
+ (*ActuatorInfo)(nil), // 7: bytebase.v1.ActuatorInfo
+ (*ActuatorInfo_StatUser)(nil), // 8: bytebase.v1.ActuatorInfo.StatUser
+ (*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask
(*WorkspaceProfileSetting_PasswordRestriction)(nil), // 10: bytebase.v1.WorkspaceProfileSetting.PasswordRestriction
- (UserType)(0), // 11: bytebase.v1.UserType
- (State)(0), // 12: bytebase.v1.State
- (*emptypb.Empty)(nil), // 13: google.protobuf.Empty
+ (DatabaseChangeMode)(0), // 11: bytebase.v1.DatabaseChangeMode
+ (*durationpb.Duration)(nil), // 12: google.protobuf.Duration
+ (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
+ (*Announcement)(nil), // 14: bytebase.v1.Announcement
+ (UserType)(0), // 15: bytebase.v1.UserType
+ (State)(0), // 16: bytebase.v1.State
+ (*emptypb.Empty)(nil), // 17: google.protobuf.Empty
}
var file_v1_actuator_service_proto_depIdxs = []int32{
- 6, // 0: bytebase.v1.UpdateActuatorInfoRequest.actuator:type_name -> bytebase.v1.ActuatorInfo
- 8, // 1: bytebase.v1.UpdateActuatorInfoRequest.update_mask:type_name -> google.protobuf.FieldMask
- 9, // 2: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
- 10, // 3: bytebase.v1.ActuatorInfo.password_restriction:type_name -> bytebase.v1.WorkspaceProfileSetting.PasswordRestriction
- 7, // 4: bytebase.v1.ActuatorInfo.user_stats:type_name -> bytebase.v1.ActuatorInfo.StatUser
- 11, // 5: bytebase.v1.ActuatorInfo.StatUser.user_type:type_name -> bytebase.v1.UserType
- 12, // 6: bytebase.v1.ActuatorInfo.StatUser.state:type_name -> bytebase.v1.State
- 3, // 7: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
- 4, // 8: bytebase.v1.ActuatorService.UpdateActuatorInfo:input_type -> bytebase.v1.UpdateActuatorInfoRequest
- 2, // 9: bytebase.v1.ActuatorService.SetupSample:input_type -> bytebase.v1.SetupSampleRequest
- 5, // 10: bytebase.v1.ActuatorService.DeleteCache:input_type -> bytebase.v1.DeleteCacheRequest
- 0, // 11: bytebase.v1.ActuatorService.GetResourcePackage:input_type -> bytebase.v1.GetResourcePackageRequest
- 6, // 12: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
- 6, // 13: bytebase.v1.ActuatorService.UpdateActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
- 13, // 14: bytebase.v1.ActuatorService.SetupSample:output_type -> google.protobuf.Empty
- 13, // 15: bytebase.v1.ActuatorService.DeleteCache:output_type -> google.protobuf.Empty
- 1, // 16: bytebase.v1.ActuatorService.GetResourcePackage:output_type -> bytebase.v1.ResourcePackage
- 12, // [12:17] is the sub-list for method output_type
- 7, // [7:12] is the sub-list for method input_type
- 7, // [7:7] is the sub-list for extension type_name
- 7, // [7:7] is the sub-list for extension extendee
- 0, // [0:7] is the sub-list for field type_name
+ 7, // 0: bytebase.v1.UpdateActuatorInfoRequest.actuator:type_name -> bytebase.v1.ActuatorInfo
+ 9, // 1: bytebase.v1.UpdateActuatorInfoRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 10, // 2: bytebase.v1.Restriction.password_restriction:type_name -> bytebase.v1.WorkspaceProfileSetting.PasswordRestriction
+ 11, // 3: bytebase.v1.Restriction.database_change_mode:type_name -> bytebase.v1.DatabaseChangeMode
+ 12, // 4: bytebase.v1.Restriction.inactive_session_timeout:type_name -> google.protobuf.Duration
+ 12, // 5: bytebase.v1.Restriction.maximum_role_expiration:type_name -> google.protobuf.Duration
+ 13, // 6: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
+ 8, // 7: bytebase.v1.ActuatorInfo.user_stats:type_name -> bytebase.v1.ActuatorInfo.StatUser
+ 14, // 8: bytebase.v1.ActuatorInfo.announcement:type_name -> bytebase.v1.Announcement
+ 6, // 9: bytebase.v1.ActuatorInfo.restriction:type_name -> bytebase.v1.Restriction
+ 15, // 10: bytebase.v1.ActuatorInfo.StatUser.user_type:type_name -> bytebase.v1.UserType
+ 16, // 11: bytebase.v1.ActuatorInfo.StatUser.state:type_name -> bytebase.v1.State
+ 3, // 12: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
+ 4, // 13: bytebase.v1.ActuatorService.UpdateActuatorInfo:input_type -> bytebase.v1.UpdateActuatorInfoRequest
+ 2, // 14: bytebase.v1.ActuatorService.SetupSample:input_type -> bytebase.v1.SetupSampleRequest
+ 5, // 15: bytebase.v1.ActuatorService.DeleteCache:input_type -> bytebase.v1.DeleteCacheRequest
+ 0, // 16: bytebase.v1.ActuatorService.GetResourcePackage:input_type -> bytebase.v1.GetResourcePackageRequest
+ 7, // 17: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
+ 7, // 18: bytebase.v1.ActuatorService.UpdateActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
+ 17, // 19: bytebase.v1.ActuatorService.SetupSample:output_type -> google.protobuf.Empty
+ 17, // 20: bytebase.v1.ActuatorService.DeleteCache:output_type -> google.protobuf.Empty
+ 1, // 21: bytebase.v1.ActuatorService.GetResourcePackage:output_type -> bytebase.v1.ResourcePackage
+ 17, // [17:22] is the sub-list for method output_type
+ 12, // [12:17] is the sub-list for method input_type
+ 12, // [12:12] is the sub-list for extension type_name
+ 12, // [12:12] is the sub-list for extension extendee
+ 0, // [0:12] is the sub-list for field type_name
}
func init() { file_v1_actuator_service_proto_init() }
@@ -718,7 +855,7 @@ func file_v1_actuator_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_actuator_service_proto_rawDesc), len(file_v1_actuator_service_proto_rawDesc)),
NumEnums: 0,
- NumMessages: 8,
+ NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/backend/generated-go/v1/actuator_service_equal.pb.go b/backend/generated-go/v1/actuator_service_equal.pb.go
index f15c4f78df..0297ecc33b 100644
--- a/backend/generated-go/v1/actuator_service_equal.pb.go
+++ b/backend/generated-go/v1/actuator_service_equal.pb.go
@@ -84,6 +84,51 @@ func (x *DeleteCacheRequest) Equal(y *DeleteCacheRequest) bool {
return true
}
+func (x *Restriction) Equal(y *Restriction) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.DisallowSignup != y.DisallowSignup {
+ return false
+ }
+ if x.Require_2Fa != y.Require_2Fa {
+ return false
+ }
+ if x.DisallowPasswordSignin != y.DisallowPasswordSignin {
+ return false
+ }
+ if !x.PasswordRestriction.Equal(y.PasswordRestriction) {
+ return false
+ }
+ if x.Watermark != y.Watermark {
+ return false
+ }
+ if x.DatabaseChangeMode != y.DatabaseChangeMode {
+ return false
+ }
+ if p, q := x.InactiveSessionTimeout, y.InactiveSessionTimeout; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
+ return false
+ }
+ if len(x.Domains) != len(y.Domains) {
+ return false
+ }
+ for i := 0; i < len(x.Domains); i++ {
+ if x.Domains[i] != y.Domains[i] {
+ return false
+ }
+ }
+ if x.EnforceIdentityDomain != y.EnforceIdentityDomain {
+ return false
+ }
+ if p, q := x.MaximumRoleExpiration, y.MaximumRoleExpiration; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
+ return false
+ }
+ return true
+}
+
func (x *ActuatorInfo_StatUser) Equal(y *ActuatorInfo_StatUser) bool {
if x == y {
return true
@@ -137,15 +182,9 @@ func (x *ActuatorInfo) Equal(y *ActuatorInfo) bool {
if x.NeedAdminSetup != y.NeedAdminSetup {
return false
}
- if x.DisallowSignup != y.DisallowSignup {
- return false
- }
if p, q := x.LastActiveTime, y.LastActiveTime; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
return false
}
- if x.Require_2Fa != y.Require_2Fa {
- return false
- }
if x.WorkspaceId != y.WorkspaceId {
return false
}
@@ -160,12 +199,6 @@ func (x *ActuatorInfo) Equal(y *ActuatorInfo) bool {
return false
}
}
- if x.DisallowPasswordSignin != y.DisallowPasswordSignin {
- return false
- }
- if !x.PasswordRestriction.Equal(y.PasswordRestriction) {
- return false
- }
if x.Docker != y.Docker {
return false
}
@@ -189,5 +222,14 @@ func (x *ActuatorInfo) Equal(y *ActuatorInfo) bool {
if x.ExternalUrlFromFlag != y.ExternalUrlFromFlag {
return false
}
+ if !x.Announcement.Equal(y.Announcement) {
+ return false
+ }
+ if x.EnableMetricCollection != y.EnableMetricCollection {
+ return false
+ }
+ if !x.Restriction.Equal(y.Restriction) {
+ return false
+ }
return true
}
diff --git a/frontend/src/components/EmailInput.vue b/frontend/src/components/EmailInput.vue
index 26daff5de1..1a9598d5af 100644
--- a/frontend/src/components/EmailInput.vue
+++ b/frontend/src/components/EmailInput.vue
@@ -24,7 +24,7 @@
<script lang="ts" setup>
import { NInput, NInputGroup, NInputGroupLabel, NSelect } from "naive-ui";
import { computed, reactive, watch, watchEffect } from "vue";
-import { useSettingV1Store } from "@/store";
+import { useActuatorV1Store } from "@/store";
interface LocalState {
// The full email value.
@@ -62,19 +62,19 @@ const state: LocalState = reactive({
shortValue: props.value.split("@")[0],
domain: props.value.split("@")[1],
});
-const settingV1Store = useSettingV1Store();
+const actuatorStore = useActuatorV1Store();
const enforceDomain = computed(() => {
return (
- (settingV1Store.workspaceProfileSetting?.enforceIdentityDomain ?? false) ||
+ (actuatorStore.restriction.enforceIdentityDomain ?? false) ||
props.showDomain
);
});
const domainSelectOptions = computed(() => {
- const domains = (
- settingV1Store.workspaceProfileSetting?.domains ?? []
- ).filter((domain) => domain && domain.trim() !== "");
+ const domains = (actuatorStore.restriction.domains ?? []).filter(
+ (domain) => domain && domain.trim() !== ""
+ );
if (domains.length === 0 && props.fallbackDomain) {
domains.push(props.fallbackDomain);
}
diff --git a/frontend/src/components/ExpirationSelector.vue b/frontend/src/components/ExpirationSelector.vue
index 3214550ca1..deb9391ba8 100644
--- a/frontend/src/components/ExpirationSelector.vue
+++ b/frontend/src/components/ExpirationSelector.vue
@@ -51,7 +51,7 @@ import dayjs from "dayjs";
import { NDatePicker, NSelect } from "naive-ui";
import { computed, reactive, watch } from "vue";
import { useI18n } from "vue-i18n";
-import { useSettingV1Store } from "@/store";
+import { useActuatorV1Store } from "@/store";
import { PresetRoleType } from "@/types";
interface ExpirationOption {
@@ -74,7 +74,7 @@ const emit = defineEmits<{
}>();
const { t } = useI18n();
-const settingV1Store = useSettingV1Store();
+const actuatorStore = useActuatorV1Store();
// Remember the last selected expiration option
const lastSelectedExpiration = useLocalStorage<number>(
@@ -105,11 +105,8 @@ const maximumRoleExpiration = computed(() => {
if (props.role === PresetRoleType.PROJECT_OWNER) {
return undefined;
}
- const seconds = settingV1Store.workspaceProfileSetting?.maximumRoleExpiration
- ?.seconds
- ? Number(
- settingV1Store.workspaceProfileSetting.maximumRoleExpiration.seconds
- )
+ const seconds = actuatorStore.restriction.maximumRoleExpiration?.seconds
+ ? Number(actuatorStore.restriction.maximumRoleExpiration.seconds)
: undefined;
if (!seconds) {
return undefined;
diff --git a/frontend/src/components/GeneralSetting/BrandingSetting.vue b/frontend/src/components/GeneralSetting/BrandingSetting.vue
index ee22a69235..9dc88db0ff 100644
--- a/frontend/src/components/GeneralSetting/BrandingSetting.vue
+++ b/frontend/src/components/GeneralSetting/BrandingSetting.vue
@@ -102,13 +102,13 @@ const convertFileToBase64 = (file: File) =>
const settingV1Store = useSettingV1Store();
const state = reactive<LocalState>({
- logoUrl: settingV1Store.brandingLogo,
+ logoUrl: settingV1Store.workspaceProfileSetting?.brandingLogo,
loading: false,
showFeatureModal: false,
});
const allowSave = computed((): boolean => {
- return state.logoUrl !== settingV1Store.brandingLogo;
+ return state.logoUrl !== settingV1Store.workspaceProfileSetting?.brandingLogo;
});
const hasBrandingFeature = featureToRef(PlanFeature.FEATURE_CUSTOM_LOGO);
@@ -146,6 +146,7 @@ defineExpose({
title: props.title,
isDirty: allowSave,
update: uploadLogo,
- revert: () => (state.logoUrl = settingV1Store.brandingLogo),
+ revert: () =>
+ (state.logoUrl = settingV1Store.workspaceProfileSetting?.brandingLogo),
});
</script>
diff --git a/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue b/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
index c44943aa8a..8559c41b71 100644
--- a/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
@@ -139,7 +139,7 @@ defineExpose({
}
},
revert: () => {
- Object.assign(state, initialState.value);
+ Object.assign(state, cloneDeep(initialState.value));
},
});
</script>
diff --git a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
index 53a123bc31..a9b117439f 100644
--- a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
@@ -229,7 +229,7 @@ defineExpose({
});
},
revert: () => {
- Object.assign(state, passwordRestrictionSetting.value);
+ Object.assign(state, cloneDeep(passwordRestrictionSetting.value));
},
});
</script>
diff --git a/frontend/src/components/InstanceForm/InstanceForm.vue b/frontend/src/components/InstanceForm/InstanceForm.vue
index ce82863125..108eb7d3f9 100644
--- a/frontend/src/components/InstanceForm/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm/InstanceForm.vue
@@ -13,7 +13,7 @@
<script lang="ts" setup>
import { computed, onMounted, toRef, watch } from "vue";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
-import { useActuatorV1Store, useSettingV1Store } from "@/store";
+import { useActuatorV1Store } from "@/store";
import { Engine } from "@/types/proto-es/v1/common_pb";
import type { Instance } from "@/types/proto-es/v1/instance_service_pb";
import { FeatureModal } from "../FeatureGuard";
@@ -29,7 +29,6 @@ const emit = defineEmits<{
(event: "dismiss"): void;
}>();
-const settingV1Store = useSettingV1Store();
const actuatorStore = useActuatorV1Store();
const instance = toRef(props, "instance");
@@ -55,7 +54,6 @@ onMounted(async () => {
adminDataSource.value.srv = false;
adminDataSource.value.authenticationDatabase = "";
}
- await settingV1Store.fetchSettingList();
});
watch(
diff --git a/frontend/src/components/ProfileBrandingLogo.vue b/frontend/src/components/ProfileBrandingLogo.vue
index 5f7f9e5795..5b72ae2d80 100644
--- a/frontend/src/components/ProfileBrandingLogo.vue
+++ b/frontend/src/components/ProfileBrandingLogo.vue
@@ -14,9 +14,9 @@
<script lang="ts" setup>
import { computed } from "vue";
-import { useSettingV1Store } from "@/store/modules/v1/setting";
+import { useActuatorV1Store } from "@/store";
const customBrandingLogo = computed((): string | undefined => {
- return useSettingV1Store().brandingLogo;
+ return useActuatorV1Store().brandingLogo;
});
</script>
diff --git a/frontend/src/components/User/Settings/AADSyncDrawer.vue b/frontend/src/components/User/Settings/AADSyncDrawer.vue
index e6c1f9e1d7..df691ab7c1 100644
--- a/frontend/src/components/User/Settings/AADSyncDrawer.vue
+++ b/frontend/src/components/User/Settings/AADSyncDrawer.vue
@@ -140,7 +140,7 @@ const workspaceId = computed(() => {
});
const externalUrl = computed(() => {
- return settingV1Store.workspaceProfileSetting?.externalUrl;
+ return actuatorStore.serverInfo?.externalUrl;
});
const scimUrl = computed(() => {
diff --git a/frontend/src/components/User/Settings/CreateUserDrawer.vue b/frontend/src/components/User/Settings/CreateUserDrawer.vue
index bc3399f74b..eabc2be483 100644
--- a/frontend/src/components/User/Settings/CreateUserDrawer.vue
+++ b/frontend/src/components/User/Settings/CreateUserDrawer.vue
@@ -344,7 +344,7 @@ import { Drawer, DrawerContent } from "@/components/v2";
import { RoleSelect } from "@/components/v2/Select";
import {
pushNotification,
- useSettingV1Store,
+ useActuatorV1Store,
useUserStore,
useWorkspaceV1Store,
} from "@/store";
@@ -387,7 +387,6 @@ const emit = defineEmits<{
const workspaceStore = useWorkspaceV1Store();
const { t } = useI18n();
-const settingV1Store = useSettingV1Store();
const userStore = useUserStore();
const userPasswordRef = ref<InstanceType<typeof UserPassword>>();
@@ -603,7 +602,7 @@ watch(
);
const passwordRestrictionSetting = computed(
- () => settingV1Store.passwordRestriction
+ () => useActuatorV1Store().restriction.passwordRestriction
);
const allowConfirm = computed(() => {
diff --git a/frontend/src/components/User/Settings/UserPassword.vue b/frontend/src/components/User/Settings/UserPassword.vue
index cb150a73fe..fdd5c6c450 100644
--- a/frontend/src/components/User/Settings/UserPassword.vue
+++ b/frontend/src/components/User/Settings/UserPassword.vue
@@ -115,7 +115,7 @@ const props = withDefaults(
defineProps<{
password: string;
passwordConfirm: string;
- passwordRestriction: WorkspaceProfileSetting_PasswordRestriction;
+ passwordRestriction?: WorkspaceProfileSetting_PasswordRestriction;
showLearnMore?: boolean;
}>(),
{
@@ -133,35 +133,36 @@ const { t } = useI18n();
const router = useRouter();
const passwordCheck = computed(() => {
+ const minLength = props.passwordRestriction?.minLength ?? 8;
const check: { text: string; matched: boolean }[] = [
{
text: t("settings.general.workspace.password-restriction.min-length", {
- min: props.passwordRestriction.minLength,
+ min: minLength,
}),
- matched: props.password.length >= props.passwordRestriction.minLength,
+ matched: props.password.length >= minLength,
},
];
- if (props.passwordRestriction.requireNumber) {
+ if (props.passwordRestriction?.requireNumber) {
check.push({
text: t("settings.general.workspace.password-restriction.require-number"),
matched: /[0-9]+/.test(props.password),
});
}
- if (props.passwordRestriction.requireUppercaseLetter) {
+ if (props.passwordRestriction?.requireUppercaseLetter) {
check.push({
text: t(
"settings.general.workspace.password-restriction.require-uppercase-letter"
),
matched: /[A-Z]+/.test(props.password),
});
- } else if (props.passwordRestriction.requireLetter) {
+ } else if (props.passwordRestriction?.requireLetter) {
check.push({
text: t("settings.general.workspace.password-restriction.require-letter"),
matched: /[a-zA-Z]+/.test(props.password),
});
}
- if (props.passwordRestriction.requireSpecialCharacter) {
+ if (props.passwordRestriction?.requireSpecialCharacter) {
check.push({
text: t(
"settings.general.workspace.password-restriction.require-special-character"
diff --git a/frontend/src/components/misc/Watermark.vue b/frontend/src/components/misc/Watermark.vue
index 8a746e75d3..0d3486b9b5 100644
--- a/frontend/src/components/misc/Watermark.vue
+++ b/frontend/src/components/misc/Watermark.vue
@@ -41,7 +41,6 @@ import {
useActuatorV1Store,
useCurrentUserV1,
} from "@/store";
-import { useSettingV1Store } from "@/store/modules/v1/setting";
import { UNKNOWN_USER_NAME } from "@/types";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
@@ -50,13 +49,10 @@ const SIZE = 16;
const PADDING = 6;
const currentUserV1 = useCurrentUserV1();
+const actuatorStore = useActuatorV1Store();
const version = computed(
- () =>
- useActuatorV1Store().version +
- "-" +
- useActuatorV1Store().gitCommitBE.substring(0, 7)
+ () => actuatorStore.version + "-" + actuatorStore.gitCommitBE.substring(0, 7)
);
-const settingStore = useSettingV1Store();
const hasWatermarkFeature = featureToRef(PlanFeature.FEATURE_WATERMARK);
const lines = computed(() => {
@@ -64,7 +60,7 @@ const lines = computed(() => {
const uid = extractUserId(user.name);
if (user.name === UNKNOWN_USER_NAME) return [];
if (!hasWatermarkFeature.value) return [];
- if (!settingStore.workspaceProfileSetting?.watermark) return [];
+ if (!actuatorStore.restriction.watermark) return [];
const lines: string[] = [];
lines.push(`${user.title} (${uid})`);
diff --git a/frontend/src/composables/usePriorBackupTelemetry.ts b/frontend/src/composables/usePriorBackupTelemetry.ts
index 0fc528508b..44ab57320d 100644
--- a/frontend/src/composables/usePriorBackupTelemetry.ts
+++ b/frontend/src/composables/usePriorBackupTelemetry.ts
@@ -3,7 +3,6 @@ import {
useActuatorV1Store,
useCurrentUserV1,
useDatabaseV1Store,
- useSettingV1Store,
} from "@/store";
import { Engine } from "@/types/proto-es/v1/common_pb";
import type { Plan } from "@/types/proto-es/v1/plan_service_pb";
@@ -57,13 +56,12 @@ export async function trackPriorBackupOnTaskRun(
}
// Respect user's metric collection preference
- const settingStore = useSettingV1Store();
- if (settingStore.workspaceProfileSetting?.enableMetricCollection === false) {
+ const actuatorStore = useActuatorV1Store();
+ if (actuatorStore.serverInfo?.enableMetricCollection === false) {
return;
}
try {
- const actuatorStore = useActuatorV1Store();
const currentUser = useCurrentUserV1();
const workspaceId = actuatorStore.info?.workspaceId;
diff --git a/frontend/src/customAppProfile.ts b/frontend/src/customAppProfile.ts
index bedda3f506..b1924f9be9 100644
--- a/frontend/src/customAppProfile.ts
+++ b/frontend/src/customAppProfile.ts
@@ -1,23 +1,11 @@
import { computed } from "vue";
import { locale } from "./plugins/i18n";
-import { useActuatorV1Store, useSettingByName } from "./store";
+import { useActuatorV1Store } from "./store";
import { defaultAppProfile } from "./types";
-import {
- DatabaseChangeMode,
- Setting_SettingName,
-} from "./types/proto-es/v1/setting_service_pb";
+import { DatabaseChangeMode } from "./types/proto-es/v1/setting_service_pb";
export const overrideAppProfile = () => {
- const setting = useSettingByName(Setting_SettingName.WORKSPACE_PROFILE);
- const databaseChangeMode = computed(() => {
- if (setting.value?.value?.value?.case === "workspaceProfile") {
- const mode = setting.value.value.value.value.databaseChangeMode;
- if (mode === DatabaseChangeMode.EDITOR) return DatabaseChangeMode.EDITOR;
- }
- return DatabaseChangeMode.PIPELINE;
- });
-
- overrideAppFeatures(databaseChangeMode.value);
+ overrideAppFeatures();
// Override app language.
const query = new URLSearchParams(window.location.search);
@@ -27,17 +15,21 @@ export const overrideAppProfile = () => {
}
};
-const overrideAppFeatures = (
- databaseChangeMode: DatabaseChangeMode.PIPELINE | DatabaseChangeMode.EDITOR
-) => {
+const overrideAppFeatures = () => {
const actuatorStore = useActuatorV1Store();
+ const databaseChangeMode = computed(() => {
+ const mode = actuatorStore.restriction.databaseChangeMode;
+ if (mode === DatabaseChangeMode.EDITOR) return DatabaseChangeMode.EDITOR;
+ return DatabaseChangeMode.PIPELINE;
+ });
+
actuatorStore.appProfile = defaultAppProfile();
actuatorStore.overrideAppFeatures({
- "bb.feature.database-change-mode": databaseChangeMode,
+ "bb.feature.database-change-mode": databaseChangeMode.value,
});
- if (databaseChangeMode === DatabaseChangeMode.EDITOR) {
+ if (databaseChangeMode.value === DatabaseChangeMode.EDITOR) {
actuatorStore.overrideAppFeatures({
"bb.feature.hide-quick-start": true,
"bb.feature.hide-help": true,
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index dbf0f62293..ea9f8f2984 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -197,7 +197,7 @@ router.beforeEach((to, from, next) => {
const currentUserV1 = useCurrentUserV1();
if (
hasFeature(PlanFeature.FEATURE_TWO_FA) &&
- actuatorStore.serverInfo?.require2fa &&
+ actuatorStore.restriction.require2fa &&
currentUserV1.value &&
!currentUserV1.value.mfaEnabled &&
to.name !== AUTH_2FA_SETUP_MODULE // Prevent redirect loop
diff --git a/frontend/src/store/modules/v1/actuator.ts b/frontend/src/store/modules/v1/actuator.ts
index 13eb3b3da7..f91808b6ed 100644
--- a/frontend/src/store/modules/v1/actuator.ts
+++ b/frontend/src/store/modules/v1/actuator.ts
@@ -16,8 +16,8 @@ import type {
ActuatorInfo,
ResourcePackage,
} from "@/types/proto-es/v1/actuator_service_pb";
+import { RestrictionSchema } from "@/types/proto-es/v1/actuator_service_pb";
import { State } from "@/types/proto-es/v1/common_pb";
-import { WorkspaceProfileSetting_PasswordRestrictionSchema } from "@/types/proto-es/v1/setting_service_pb";
import { UserType } from "@/types/proto-es/v1/user_service_pb";
import { semverCompare } from "@/utils";
@@ -93,12 +93,8 @@ export const useActuatorV1Store = defineStore("actuator_v1", () => {
return url === "" || url === EXTERNAL_URL_PLACEHOLDER;
});
- const disallowSignup = computed(
- () => serverInfo.value?.disallowSignup || false
- );
-
- const disallowPasswordSignin = computed(
- () => serverInfo.value?.disallowPasswordSignin || false
+ const restriction = computed(
+ () => serverInfo.value?.restriction ?? create(RestrictionSchema, {})
);
const hasNewRelease = computed(() => {
@@ -112,16 +108,6 @@ export const useActuatorV1Store = defineStore("actuator_v1", () => {
);
});
- const passwordRestriction = computed(() => {
- return (
- serverInfo.value?.passwordRestriction ??
- create(WorkspaceProfileSetting_PasswordRestrictionSchema, {
- minLength: 8,
- requireLetter: true,
- })
- );
- });
-
const activatedInstanceCount = computed(
() => serverInfo.value?.activatedInstanceCount ?? 0
);
@@ -306,10 +292,8 @@ export const useActuatorV1Store = defineStore("actuator_v1", () => {
isSaaSMode,
needAdminSetup,
needConfigureExternalUrl,
- disallowSignup,
- disallowPasswordSignin,
hasNewRelease,
- passwordRestriction,
+ restriction,
activatedInstanceCount,
totalInstanceCount,
inactiveUserCount,
diff --git a/frontend/src/store/modules/v1/auth.ts b/frontend/src/store/modules/v1/auth.ts
index ed81e44031..4efab7012e 100644
--- a/frontend/src/store/modules/v1/auth.ts
+++ b/frontend/src/store/modules/v1/auth.ts
@@ -14,21 +14,13 @@ import {
} from "@/router/auth";
import { SETUP_MODULE } from "@/router/setup";
import { SQL_EDITOR_HOME_MODULE } from "@/router/sqlEditor";
-import {
- useActuatorV1Store,
- useAppFeature,
- useSettingV1Store,
- useUserStore,
-} from "@/store";
+import { useActuatorV1Store, useAppFeature, useUserStore } from "@/store";
import { UNKNOWN_USER_NAME, unknownUser } from "@/types";
import {
type LoginRequest,
LoginRequestSchema,
} from "@/types/proto-es/v1/auth_service_pb";
-import {
- DatabaseChangeMode,
- Setting_SettingName,
-} from "@/types/proto-es/v1/setting_service_pb";
+import { DatabaseChangeMode } from "@/types/proto-es/v1/setting_service_pb";
import type { User } from "@/types/proto-es/v1/user_service_pb";
import {
CreateUserRequestSchema,
@@ -120,15 +112,11 @@ export const useAuthStore = defineStore("auth_v1", () => {
}
setRequireResetPassword(resp.requireResetPassword);
- await useSettingV1Store().getOrFetchSettingByName(
- Setting_SettingName.WORKSPACE_PROFILE,
- true // silent
- );
+ await actuatorStore.fetchServerInfo();
// After user login, we need to reset the auth session key.
authSessionKey.value = uniqueId();
if (actuatorStore.needAdminSetup) {
- await actuatorStore.fetchServerInfo();
actuatorStore.onboardingState.isOnboarding = true;
return router.replace({
name: SETUP_MODULE,
diff --git a/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts b/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts
index d912b23734..68b6518a09 100644
--- a/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/actuator_service_pb.d.ts
@@ -4,8 +4,8 @@
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import type { Message } from "@bufbuild/protobuf";
-import type { EmptySchema, FieldMask, Timestamp } from "@bufbuild/protobuf/wkt";
-import type { WorkspaceProfileSetting_PasswordRestriction } from "./setting_service_pb";
+import type { Duration, EmptySchema, FieldMask, Timestamp } from "@bufbuild/protobuf/wkt";
+import type { Announcement, DatabaseChangeMode, WorkspaceProfileSetting_PasswordRestriction } from "./setting_service_pb";
import type { UserType } from "./user_service_pb";
import type { State } from "./common_pb";
@@ -125,6 +125,87 @@ export declare type DeleteCacheRequest = Message<"bytebase.v1.DeleteCacheRequest
*/
export declare const DeleteCacheRequestSchema: GenMessage<DeleteCacheRequest>;
+/**
+ * @generated from message bytebase.v1.Restriction
+ */
+export declare type Restriction = Message<"bytebase.v1.Restriction"> & {
+ /**
+ * Whether self-service user signup is disabled.
+ *
+ * @generated from field: bool disallow_signup = 1;
+ */
+ disallowSignup: boolean;
+
+ /**
+ * Whether two-factor authentication is required for all users.
+ *
+ * @generated from field: bool require_2fa = 2;
+ */
+ require2fa: boolean;
+
+ /**
+ * Whether password-based signin is disabled (except for workspace admins).
+ *
+ * @generated from field: bool disallow_password_signin = 3;
+ */
+ disallowPasswordSignin: boolean;
+
+ /**
+ * Password complexity and restriction requirements.
+ *
+ * @generated from field: bytebase.v1.WorkspaceProfileSetting.PasswordRestriction password_restriction = 4;
+ */
+ passwordRestriction?: WorkspaceProfileSetting_PasswordRestriction;
+
+ /**
+ * Whether to display watermark on pages.
+ *
+ * @generated from field: bool watermark = 5;
+ */
+ watermark: boolean;
+
+ /**
+ * The workspace database change mode.
+ *
+ * @generated from field: bytebase.v1.DatabaseChangeMode database_change_mode = 6;
+ */
+ databaseChangeMode: DatabaseChangeMode;
+
+ /**
+ * The session expiration time if not activity detected for the user. Value <= 0 means no limit.
+ *
+ * @generated from field: google.protobuf.Duration inactive_session_timeout = 7;
+ */
+ inactiveSessionTimeout?: Duration;
+
+ /**
+ * The workspace domain, e.g., bytebase.com.
+ *
+ * @generated from field: repeated string domains = 8;
+ */
+ domains: string[];
+
+ /**
+ * Only user and group from the domains can be created and login.
+ *
+ * @generated from field: bool enforce_identity_domain = 9;
+ */
+ enforceIdentityDomain: boolean;
+
+ /**
+ * The max duration for role expired.
+ *
+ * @generated from field: google.protobuf.Duration maximum_role_expiration = 10;
+ */
+ maximumRoleExpiration?: Duration;
+};
+
+/**
+ * Describes the message bytebase.v1.Restriction.
+ * Use `create(RestrictionSchema)` to create a new message.
+ */
+export declare const RestrictionSchema: GenMessage<Restriction>;
+
/**
* System information and configuration for the Bytebase instance.
* Actuator concept is similar to the Spring Boot Actuator.
@@ -195,13 +276,6 @@ export declare type ActuatorInfo = Message<"bytebase.v1.ActuatorInfo"> & {
*/
needAdminSetup: boolean;
- /**
- * Whether self-service user signup is disabled.
- *
- * @generated from field: bool disallow_signup = 10;
- */
- disallowSignup: boolean;
-
/**
* The last time any API call was made, refreshed on each request.
*
@@ -209,13 +283,6 @@ export declare type ActuatorInfo = Message<"bytebase.v1.ActuatorInfo"> & {
*/
lastActiveTime?: Timestamp;
- /**
- * Whether two-factor authentication is required for all users.
- *
- * @generated from field: bool require_2fa = 12;
- */
- require2fa: boolean;
-
/**
* The unique identifier for the workspace.
*
@@ -237,20 +304,6 @@ export declare type ActuatorInfo = Message<"bytebase.v1.ActuatorInfo"> & {
*/
unlicensedFeatures: string[];
- /**
- * Whether password-based signin is disabled (except for workspace admins).
- *
- * @generated from field: bool disallow_password_signin = 16;
- */
- disallowPasswordSignin: boolean;
-
- /**
- * Password complexity and restriction requirements.
- *
- * @generated from field: bytebase.v1.WorkspaceProfileSetting.PasswordRestriction password_restriction = 17;
- */
- passwordRestriction?: WorkspaceProfileSetting_PasswordRestriction;
-
/**
* Whether the Bytebase instance is running in Docker.
*
@@ -292,6 +345,25 @@ export declare type ActuatorInfo = Message<"bytebase.v1.ActuatorInfo"> & {
* @generated from field: bool external_url_from_flag = 23;
*/
externalUrlFromFlag: boolean;
+
+ /**
+ * The setting of custom announcement
+ *
+ * @generated from field: bytebase.v1.Announcement announcement = 24;
+ */
+ announcement?: Announcement;
+
+ /**
+ * Whether to enable metric collection for the workspace.
+ *
+ * @generated from field: bool enable_metric_collection = 25;
+ */
+ enableMetricCollection: boolean;
+
+ /**
+ * @generated from field: bytebase.v1.Restriction restriction = 26;
+ */
+ restriction?: Restriction;
};
/**
diff --git a/frontend/src/types/proto-es/v1/actuator_service_pb.js b/frontend/src/types/proto-es/v1/actuator_service_pb.js
index e9b5f9ce29..12c584d0db 100644
--- a/frontend/src/types/proto-es/v1/actuator_service_pb.js
+++ b/frontend/src/types/proto-es/v1/actuator_service_pb.js
@@ -6,7 +6,7 @@ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2
import { file_google_api_annotations } from "../google/api/annotations_pb";
import { file_google_api_client } from "../google/api/client_pb";
import { file_google_api_field_behavior } from "../google/api/field_behavior_pb";
-import { file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
+import { file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
import { file_v1_annotation } from "./annotation_pb";
import { file_v1_common } from "./common_pb";
import { file_v1_setting_service } from "./setting_service_pb";
@@ -16,7 +16,7 @@ import { file_v1_user_service } from "./user_service_pb";
* Describes the file v1/actuator_service.proto.
*/
export const file_v1_actuator_service = /*@__PURE__*/
- fileDesc("Chl2MS9hY3R1YXRvcl9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSIbChlHZXRSZXNvdXJjZVBhY2thZ2VSZXF1ZXN0Ih8KD1Jlc291cmNlUGFja2FnZRIMCgRsb2dvGAEgASgMIhQKElNldHVwU2FtcGxlUmVxdWVzdCIYChZHZXRBY3R1YXRvckluZm9SZXF1ZXN0IpoBChlVcGRhdGVBY3R1YXRvckluZm9SZXF1ZXN0EjAKCGFjdHVhdG9yGAEgASgLMhkuYnl0ZWJhc2UudjEuQWN0dWF0b3JJbmZvQgPgQQISNAoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrQgPgQQISFQoNYWxsb3dfbWlzc2luZxgDIAEoCCIUChJEZWxldGVDYWNoZVJlcXVlc3Qi4gYKDEFjdHVhdG9ySW5mbxIUCgd2ZXJzaW9uGAEgASgJQgPgQQMSFwoKZ2l0X2NvbW1pdBgCIAEoCUID4EEDEhUKCHJlYWRvbmx5GAMgASgIQgPgQQMSEQoEc2FhcxgEIAEoCEID4EEDEhEKBGRlbW8YBSABKAhCA+BBAxIRCgRob3N0GAYgASgJQgPgQQMSEQoEcG9ydBgHIAEoCUID4EEDEhkKDGV4dGVybmFsX3VybBgIIAEoCUID4EEDEh0KEG5lZWRfYWRtaW5fc2V0dXAYCSABKAhCA+BBAxIcCg9kaXNhbGxvd19zaWdudXAYCiABKAhCA+BBAxI5ChBsYXN0X2FjdGl2ZV90aW1lGAsgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEID4EEDEhgKC3JlcXVpcmVfMmZhGAwgASgIQgPgQQMSGQoMd29ya3NwYWNlX2lkGA0gASgJQgPgQQMSDQoFZGVidWcYDiABKAgSIAoTdW5saWNlbnNlZF9mZWF0dXJlcxgPIAMoCUID4EEDEiUKGGRpc2FsbG93X3Bhc3N3b3JkX3NpZ25pbhgQIAEoCEID4EEDElsKFHBhc3N3b3JkX3Jlc3RyaWN0aW9uGBEgASgLMjguYnl0ZWJhc2UudjEuV29ya3NwYWNlUHJvZmlsZVNldHRpbmcuUGFzc3dvcmRSZXN0cmljdGlvbkID4EEDEhMKBmRvY2tlchgSIAEoCEID4EEDEjsKCnVzZXJfc3RhdHMYEyADKAsyIi5ieXRlYmFzZS52MS5BY3R1YXRvckluZm8uU3RhdFVzZXJCA+BBAxIlChhhY3RpdmF0ZWRfaW5zdGFuY2VfY291bnQYFCABKAVCA+BBAxIhChR0b3RhbF9pbnN0YW5jZV9jb3VudBgVIAEoBUID4EEDEhoKDWVuYWJsZV9zYW1wbGUYFiABKAhCA+BBAxIjChZleHRlcm5hbF91cmxfZnJvbV9mbGFnGBcgASgIQgPgQQMaZgoIU3RhdFVzZXISKAoJdXNlcl90eXBlGAEgASgOMhUuYnl0ZWJhc2UudjEuVXNlclR5cGUSIQoFc3RhdGUYAiABKA4yEi5ieXRlYmFzZS52MS5TdGF0ZRINCgVjb3VudBgDIAEoBTKkBQoPQWN0dWF0b3JTZXJ2aWNlEnMKD0dldEFjdHVhdG9ySW5mbxIjLmJ5dGViYXNlLnYxLkdldEFjdHVhdG9ySW5mb1JlcXVlc3QaGS5ieXRlYmFzZS52MS5BY3R1YXRvckluZm8iINpBAIDqMAGC0+STAhMSES92MS9hY3R1YXRvci9pbmZvEqoBChJVcGRhdGVBY3R1YXRvckluZm8SJi5ieXRlYmFzZS52MS5VcGRhdGVBY3R1YXRvckluZm9SZXF1ZXN0GhkuYnl0ZWJhc2UudjEuQWN0dWF0b3JJbmZvIlHaQRRhY3R1YXRvcix1cGRhdGVfbWFza4rqMA9iYi5zZXR0aW5ncy5zZXSQ6jABgtPkkwIdOghhY3R1YXRvcjIRL3YxL2FjdHVhdG9yL2luZm8SggEKC1NldHVwU2FtcGxlEh8uYnl0ZWJhc2UudjEuU2V0dXBTYW1wbGVSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IjqK6jASYmIucHJvamVjdHMuY3JlYXRlkOowAYLT5JMCGiIYL3YxL2FjdHVhdG9yOnNldHVwU2FtcGxlEmYKC0RlbGV0ZUNhY2hlEh8uYnl0ZWJhc2UudjEuRGVsZXRlQ2FjaGVSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Ih6A6jABgtPkkwIUKhIvdjEvYWN0dWF0b3IvY2FjaGUSgQEKEkdldFJlc291cmNlUGFja2FnZRImLmJ5dGViYXNlLnYxLkdldFJlc291cmNlUGFja2FnZVJlcXVlc3QaHC5ieXRlYmFzZS52MS5SZXNvdXJjZVBhY2thZ2UiJdpBAIDqMAGC0+STAhgSFi92MS9hY3R1YXRvci9yZXNvdXJjZXNCqgEKD2NvbS5ieXRlYmFzZS52MUIUQWN0dWF0b3JTZXJ2aWNlUHJvdG9QAVo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MaICA0JYWKoCC0J5dGViYXNlLlYxygILQnl0ZWJhc2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_setting_service, file_v1_user_service]);
+ fileDesc("Chl2MS9hY3R1YXRvcl9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSIbChlHZXRSZXNvdXJjZVBhY2thZ2VSZXF1ZXN0Ih8KD1Jlc291cmNlUGFja2FnZRIMCgRsb2dvGAEgASgMIhQKElNldHVwU2FtcGxlUmVxdWVzdCIYChZHZXRBY3R1YXRvckluZm9SZXF1ZXN0IpoBChlVcGRhdGVBY3R1YXRvckluZm9SZXF1ZXN0EjAKCGFjdHVhdG9yGAEgASgLMhkuYnl0ZWJhc2UudjEuQWN0dWF0b3JJbmZvQgPgQQISNAoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrQgPgQQISFQoNYWxsb3dfbWlzc2luZxgDIAEoCCIUChJEZWxldGVDYWNoZVJlcXVlc3Qi5AMKC1Jlc3RyaWN0aW9uEhwKD2Rpc2FsbG93X3NpZ251cBgBIAEoCEID4EEDEhgKC3JlcXVpcmVfMmZhGAIgASgIQgPgQQMSJQoYZGlzYWxsb3dfcGFzc3dvcmRfc2lnbmluGAMgASgIQgPgQQMSWwoUcGFzc3dvcmRfcmVzdHJpY3Rpb24YBCABKAsyOC5ieXRlYmFzZS52MS5Xb3Jrc3BhY2VQcm9maWxlU2V0dGluZy5QYXNzd29yZFJlc3RyaWN0aW9uQgPgQQMSFgoJd2F0ZXJtYXJrGAUgASgIQgPgQQMSQgoUZGF0YWJhc2VfY2hhbmdlX21vZGUYBiABKA4yHy5ieXRlYmFzZS52MS5EYXRhYmFzZUNoYW5nZU1vZGVCA+BBAxJAChhpbmFjdGl2ZV9zZXNzaW9uX3RpbWVvdXQYByABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CA+BBAxIUCgdkb21haW5zGAggAygJQgPgQQMSJAoXZW5mb3JjZV9pZGVudGl0eV9kb21haW4YCSABKAhCA+BBAxI/ChdtYXhpbXVtX3JvbGVfZXhwaXJhdGlvbhgKIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkID4EEDIs8GCgxBY3R1YXRvckluZm8SFAoHdmVyc2lvbhgBIAEoCUID4EEDEhcKCmdpdF9jb21taXQYAiABKAlCA+BBAxIVCghyZWFkb25seRgDIAEoCEID4EEDEhEKBHNhYXMYBCABKAhCA+BBAxIRCgRkZW1vGAUgASgIQgPgQQMSEQoEaG9zdBgGIAEoCUID4EEDEhEKBHBvcnQYByABKAlCA+BBAxIZCgxleHRlcm5hbF91cmwYCCABKAlCA+BBAxIdChBuZWVkX2FkbWluX3NldHVwGAkgASgIQgPgQQMSOQoQbGFzdF9hY3RpdmVfdGltZRgLIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBCA+BBAxIZCgx3b3Jrc3BhY2VfaWQYDSABKAlCA+BBAxINCgVkZWJ1ZxgOIAEoCBIgChN1bmxpY2Vuc2VkX2ZlYXR1cmVzGA8gAygJQgPgQQMSEwoGZG9ja2VyGBIgASgIQgPgQQMSOwoKdXNlcl9zdGF0cxgTIAMoCzIiLmJ5dGViYXNlLnYxLkFjdHVhdG9ySW5mby5TdGF0VXNlckID4EEDEiUKGGFjdGl2YXRlZF9pbnN0YW5jZV9jb3VudBgUIAEoBUID4EEDEiEKFHRvdGFsX2luc3RhbmNlX2NvdW50GBUgASgFQgPgQQMSGgoNZW5hYmxlX3NhbXBsZRgWIAEoCEID4EEDEiMKFmV4dGVybmFsX3VybF9mcm9tX2ZsYWcYFyABKAhCA+BBAxI0Cgxhbm5vdW5jZW1lbnQYGCABKAsyGS5ieXRlYmFzZS52MS5Bbm5vdW5jZW1lbnRCA+BBAxIlChhlbmFibGVfbWV0cmljX2NvbGxlY3Rpb24YGSABKAhCA+BBAxIyCgtyZXN0cmljdGlvbhgaIAEoCzIYLmJ5dGViYXNlLnYxLlJlc3RyaWN0aW9uQgPgQQMaZgoIU3RhdFVzZXISKAoJdXNlcl90eXBlGAEgASgOMhUuYnl0ZWJhc2UudjEuVXNlclR5cGUSIQoFc3RhdGUYAiABKA4yEi5ieXRlYmFzZS52MS5TdGF0ZRINCgVjb3VudBgDIAEoBUoECAoQC0oECAwQDUoECBAQEUoECBEQEjKkBQoPQWN0dWF0b3JTZXJ2aWNlEnMKD0dldEFjdHVhdG9ySW5mbxIjLmJ5dGViYXNlLnYxLkdldEFjdHVhdG9ySW5mb1JlcXVlc3QaGS5ieXRlYmFzZS52MS5BY3R1YXRvckluZm8iINpBAIDqMAGC0+STAhMSES92MS9hY3R1YXRvci9pbmZvEqoBChJVcGRhdGVBY3R1YXRvckluZm8SJi5ieXRlYmFzZS52MS5VcGRhdGVBY3R1YXRvckluZm9SZXF1ZXN0GhkuYnl0ZWJhc2UudjEuQWN0dWF0b3JJbmZvIlHaQRRhY3R1YXRvcix1cGRhdGVfbWFza4rqMA9iYi5zZXR0aW5ncy5zZXSQ6jABgtPkkwIdOghhY3R1YXRvcjIRL3YxL2FjdHVhdG9yL2luZm8SggEKC1NldHVwU2FtcGxlEh8uYnl0ZWJhc2UudjEuU2V0dXBTYW1wbGVSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IjqK6jASYmIucHJvamVjdHMuY3JlYXRlkOowAYLT5JMCGiIYL3YxL2FjdHVhdG9yOnNldHVwU2FtcGxlEmYKC0RlbGV0ZUNhY2hlEh8uYnl0ZWJhc2UudjEuRGVsZXRlQ2FjaGVSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Ih6A6jABgtPkkwIUKhIvdjEvYWN0dWF0b3IvY2FjaGUSgQEKEkdldFJlc291cmNlUGFja2FnZRImLmJ5dGViYXNlLnYxLkdldFJlc291cmNlUGFja2FnZVJlcXVlc3QaHC5ieXRlYmFzZS52MS5SZXNvdXJjZVBhY2thZ2UiJdpBAIDqMAGC0+STAhgSFi92MS9hY3R1YXRvci9yZXNvdXJjZXNCqgEKD2NvbS5ieXRlYmFzZS52MUIUQWN0dWF0b3JTZXJ2aWNlUHJvdG9QAVo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MaICA0JYWKoCC0J5dGViYXNlLlYxygILQnl0ZWJhc2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_protobuf_duration, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_setting_service, file_v1_user_service]);
/**
* Describes the message bytebase.v1.GetResourcePackageRequest.
@@ -60,19 +60,26 @@ export const UpdateActuatorInfoRequestSchema = /*@__PURE__*/
export const DeleteCacheRequestSchema = /*@__PURE__*/
messageDesc(file_v1_actuator_service, 5);
+/**
+ * Describes the message bytebase.v1.Restriction.
+ * Use `create(RestrictionSchema)` to create a new message.
+ */
+export const RestrictionSchema = /*@__PURE__*/
+ messageDesc(file_v1_actuator_service, 6);
+
/**
* Describes the message bytebase.v1.ActuatorInfo.
* Use `create(ActuatorInfoSchema)` to create a new message.
*/
export const ActuatorInfoSchema = /*@__PURE__*/
- messageDesc(file_v1_actuator_service, 6);
+ messageDesc(file_v1_actuator_service, 7);
/**
* Describes the message bytebase.v1.ActuatorInfo.StatUser.
* Use `create(ActuatorInfo_StatUserSchema)` to create a new message.
*/
export const ActuatorInfo_StatUserSchema = /*@__PURE__*/
- messageDesc(file_v1_actuator_service, 6, 0);
+ messageDesc(file_v1_actuator_service, 7, 0);
/**
* ActuatorService manages system health and operational information.
diff --git a/frontend/src/views/BannerAnnouncement.vue b/frontend/src/views/BannerAnnouncement.vue
index 9547f6088d..4d12734936 100644
--- a/frontend/src/views/BannerAnnouncement.vue
+++ b/frontend/src/views/BannerAnnouncement.vue
@@ -19,12 +19,14 @@
<script lang="ts" setup>
import { computed } from "vue";
-import { hasFeature, useSettingV1Store } from "@/store";
+import { hasFeature, useActuatorV1Store } from "@/store";
import { Announcement_AlertLevel } from "@/types/proto-es/v1/setting_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import { urlfy } from "@/utils";
-const settingV1Store = useSettingV1Store();
+const actuatorStore = useActuatorV1Store();
+
+const announcement = computed(() => actuatorStore.serverInfo?.announcement);
const showBanner = computed(() => {
return (
@@ -34,7 +36,7 @@ const showBanner = computed(() => {
});
const bgColor = computed(() => {
- switch (settingV1Store.workspaceProfileSetting?.announcement?.level) {
+ switch (announcement.value?.level) {
case Announcement_AlertLevel.INFO:
return "bg-info";
case Announcement_AlertLevel.WARNING:
@@ -47,7 +49,7 @@ const bgColor = computed(() => {
});
const bgColorHover = computed(() => {
- switch (settingV1Store.workspaceProfileSetting?.announcement?.level) {
+ switch (announcement.value?.level) {
case Announcement_AlertLevel.INFO:
return "hover:bg-info-hover";
case Announcement_AlertLevel.WARNING:
@@ -60,11 +62,11 @@ const bgColorHover = computed(() => {
});
const announcementText = computed(() => {
- return settingV1Store.workspaceProfileSetting?.announcement?.text ?? "";
+ return announcement.value?.text ?? "";
});
const announcementLink = computed(() => {
- const link = settingV1Store.workspaceProfileSetting?.announcement?.link ?? "";
+ const link = announcement.value?.link ?? "";
if (link.length === 0) {
return link;
}
diff --git a/frontend/src/views/ProfileDashboard.vue b/frontend/src/views/ProfileDashboard.vue
index 7071220fec..74893eca55 100644
--- a/frontend/src/views/ProfileDashboard.vue
+++ b/frontend/src/views/ProfileDashboard.vue
@@ -246,7 +246,6 @@ import {
pushNotification,
useActuatorV1Store,
useCurrentUserV1,
- useSettingV1Store,
useUserStore,
useWorkspaceV1Store,
} from "@/store";
@@ -280,7 +279,6 @@ const props = defineProps<{
const { t } = useI18n();
const router = useRouter();
const actuatorStore = useActuatorV1Store();
-const settingV1Store = useSettingV1Store();
const currentUser = useCurrentUserV1();
const userStore = useUserStore();
const workspaceStore = useWorkspaceV1Store();
@@ -297,7 +295,7 @@ const editNameTextField = ref<InstanceType<typeof NInput>>();
const userPasswordRef = ref<InstanceType<typeof UserPassword>>();
const passwordRestrictionSetting = computed(
- () => settingV1Store.passwordRestriction
+ () => actuatorStore.restriction.passwordRestriction
);
const keyboardHandler = (e: KeyboardEvent) => {
@@ -467,7 +465,7 @@ const enable2FA = () => {
const disable2FA = () => {
if (
- actuatorStore.serverInfo?.require2fa &&
+ actuatorStore.restriction.require2fa &&
!hasWorkspacePermissionV2("bb.policies.update")
) {
pushNotification({
diff --git a/frontend/src/views/SettingWorkspaceGeneral.vue b/frontend/src/views/SettingWorkspaceGeneral.vue
index 83381fb113..f139a6cb9e 100644
--- a/frontend/src/views/SettingWorkspaceGeneral.vue
+++ b/frontend/src/views/SettingWorkspaceGeneral.vue
@@ -72,7 +72,6 @@ import {
import { useRouteChangeGuard } from "@/composables/useRouteChangeGuard";
import { useBodyLayoutContext } from "@/layouts/common";
import { pushNotification } from "@/store";
-import { useSettingV1Store } from "@/store/modules/v1/setting";
defineProps<{
allowEdit: boolean;
@@ -111,7 +110,6 @@ const { overrideMainContainerClass } = useBodyLayoutContext();
overrideMainContainerClass("!pb-0");
onMounted(async () => {
- await useSettingV1Store().fetchSettingList();
// If the route has a hash, try to scroll to the element with the value.
if (route.hash) {
document.body.querySelector(route.hash)?.scrollIntoView();
diff --git a/frontend/src/views/SettingWorkspaceUsers.vue b/frontend/src/views/SettingWorkspaceUsers.vue
index 416d3a12c7..159aaa0baa 100644
--- a/frontend/src/views/SettingWorkspaceUsers.vue
+++ b/frontend/src/views/SettingWorkspaceUsers.vue
@@ -94,13 +94,13 @@
:permissions="['bb.groups.create']"
>
<NPopover
- :disabled="slotProps.disabled || workspaceProfileSetting.domains.length > 0"
+ :disabled="slotProps.disabled || actuatorStore.restriction.domains.length > 0"
>
<template #trigger>
<NButton
:disabled="
slotProps.disabled ||
- workspaceProfileSetting.domains.length === 0 ||
+ actuatorStore.restriction.domains.length === 0 ||
!hasUserGroupFeature
"
@click="handleCreateGroup"
@@ -211,7 +211,6 @@
</template>
<script setup lang="ts">
-import { create } from "@bufbuild/protobuf";
import { PlusIcon, SettingsIcon } from "lucide-vue-next";
import { NButton, NCheckbox, NPopover, NTabPane, NTabs } from "naive-ui";
import { computed, onMounted, reactive, ref, watch } from "vue";
@@ -234,7 +233,6 @@ import {
featureToRef,
useActuatorV1Store,
useGroupStore,
- useSettingV1Store,
useSubscriptionV1Store,
useUIStateStore,
useUserStore,
@@ -242,7 +240,6 @@ import {
import { groupNamePrefix } from "@/store/modules/v1/common";
import { State } from "@/types/proto-es/v1/common_pb";
import type { Group } from "@/types/proto-es/v1/group_service_pb";
-import { WorkspaceProfileSettingSchema } from "@/types/proto-es/v1/setting_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import { type User } from "@/types/proto-es/v1/user_service_pb";
@@ -284,7 +281,6 @@ const userStore = useUserStore();
const groupStore = useGroupStore();
const uiStateStore = useUIStateStore();
const actuatorStore = useActuatorV1Store();
-const settingV1Store = useSettingV1Store();
const subscriptionV1Store = useSubscriptionV1Store();
const userPagedTable = ref<ComponentExposed<typeof PagedTable<User>>>();
const groupPagedTable = ref<ComponentExposed<typeof PagedTable<Group>>>();
@@ -375,13 +371,6 @@ const fetchInactiveUserList = async ({
return { list: users, nextPageToken };
};
-const workspaceProfileSetting = computed(() =>
- create(
- WorkspaceProfileSettingSchema,
- settingV1Store.workspaceProfileSetting || {}
- )
-);
-
const hasDirectorySyncFeature = featureToRef(
PlanFeature.FEATURE_DIRECTORY_SYNC
);
diff --git a/frontend/src/views/Setup/AdminSetup.vue b/frontend/src/views/Setup/AdminSetup.vue
index ae091d4d70..b19035de4a 100644
--- a/frontend/src/views/Setup/AdminSetup.vue
+++ b/frontend/src/views/Setup/AdminSetup.vue
@@ -107,16 +107,14 @@ import ResourceIdField from "@/components/v2/Form/ResourceIdField.vue";
import { SQL_EDITOR_HOME_MODULE } from "@/router/sqlEditor";
import {
useActuatorV1Store,
+ useAppFeature,
useProjectV1Store,
useSettingV1Store,
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import { emptyProject } from "@/types";
import type { Project } from "@/types/proto-es/v1/project_service_pb";
-import {
- DatabaseChangeMode,
- Setting_SettingName,
-} from "@/types/proto-es/v1/setting_service_pb";
+import { DatabaseChangeMode } from "@/types/proto-es/v1/setting_service_pb";
import WorkspaceMode from "./WorkspaceMode.vue";
interface LocalState {
@@ -224,16 +222,8 @@ const tryFinishSetup = async () => {
onMounted(async () => {
if (!actuatorV1Store.onboardingState.isOnboarding) {
- const profileSetting = await settingStore.fetchSettingByName(
- Setting_SettingName.WORKSPACE_PROFILE
- );
- return onCancel(
- getHomePageByMode(
- profileSetting?.value?.value?.case === "workspaceProfile"
- ? profileSetting.value.value.value.databaseChangeMode
- : undefined
- )
- );
+ const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
+ return onCancel(getHomePageByMode(databaseChangeMode.value));
}
});
</script>
diff --git a/frontend/src/views/auth/InactiveRemindModal.vue b/frontend/src/views/auth/InactiveRemindModal.vue
index 56776810cc..d7f86d7372 100644
--- a/frontend/src/views/auth/InactiveRemindModal.vue
+++ b/frontend/src/views/auth/InactiveRemindModal.vue
@@ -39,10 +39,10 @@ import { computed, onUnmounted, ref, watch } from "vue";
import { BBModal } from "@/bbkit";
import { useCurrentTimestamp } from "@/composables/useCurrentTimestamp";
import { useLastActivity } from "@/composables/useLastActivity";
-import { useAuthStore, useSettingV1Store } from "@/store";
+import { useActuatorV1Store, useAuthStore } from "@/store";
const authStore = useAuthStore();
-const settingStore = useSettingV1Store();
+const actuatorStore = useActuatorV1Store();
const timer = ref<NodeJS.Timeout | undefined>();
// Show the modal 3min before the inactiveTimeout threshold.
@@ -53,9 +53,7 @@ const logout = () => {
};
const inactiveTimeoutInSeconds = computed(() =>
- Number(
- settingStore.workspaceProfileSetting?.inactiveSessionTimeout?.seconds ?? 0
- )
+ Number(actuatorStore.restriction.inactiveSessionTimeout?.seconds ?? 0)
);
const { lastActivityTs } = useLastActivity();
diff --git a/frontend/src/views/auth/PasswordReset.vue b/frontend/src/views/auth/PasswordReset.vue
index b52b1f9dac..711754fcf6 100644
--- a/frontend/src/views/auth/PasswordReset.vue
+++ b/frontend/src/views/auth/PasswordReset.vue
@@ -43,12 +43,11 @@ import { useRouter } from "vue-router";
import UserPassword from "@/components/User/Settings/UserPassword.vue";
import {
pushNotification,
+ useActuatorV1Store,
useAuthStore,
useCurrentUserV1,
- useSettingV1Store,
useUserStore,
} from "@/store";
-import { Setting_SettingName } from "@/types/proto-es/v1/setting_service_pb";
import type { User } from "@/types/proto-es/v1/user_service_pb";
import { UpdateUserRequestSchema } from "@/types/proto-es/v1/user_service_pb";
@@ -68,10 +67,9 @@ const userStore = useUserStore();
const authStore = useAuthStore();
const userPasswordRef = ref<InstanceType<typeof UserPassword>>();
const router = useRouter();
-const settingV1Store = useSettingV1Store();
const passwordRestrictionSetting = computed(
- () => settingV1Store.passwordRestriction
+ () => useActuatorV1Store().restriction.passwordRestriction
);
const redirectQuery = computed(() => {
@@ -84,9 +82,6 @@ onMounted(async () => {
router.replace(redirectQuery.value);
return;
}
- await settingV1Store.getOrFetchSettingByName(
- Setting_SettingName.WORKSPACE_PROFILE
- );
});
const allowConfirm = computed(() => {
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index 04a378e2ee..8c569d4efb 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -13,7 +13,7 @@
pane-style="padding: 12px 0 0 0"
>
<NTabPane
- v-if="!disallowPasswordSignin"
+ v-if="!restriction.disallowPasswordSignin"
name="standard"
tab="Standard"
>
@@ -237,10 +237,10 @@ const state = reactive<LocalState>({
isLoading: false,
});
const initialized = ref(false);
-const { isDemo, disallowPasswordSignin } = storeToRefs(actuatorStore);
+const { isDemo, restriction } = storeToRefs(actuatorStore);
const disallowSignup = computed(
- () => !props.allowSignup || actuatorStore.disallowSignup
+ () => !props.allowSignup || restriction.value.disallowSignup
);
const separatedIdentityProviderList = computed(() =>
@@ -256,13 +256,13 @@ const groupedIdentityProviderList = computed(() =>
const showSignInForm = computed(() => {
return (
- !disallowPasswordSignin.value ||
+ !restriction.value.disallowPasswordSignin ||
groupedIdentityProviderList.value.length > 0
);
});
const defaultTabValue = computed(() => {
- if (!disallowPasswordSignin.value) {
+ if (!restriction.value.disallowPasswordSignin) {
return "standard";
}
if (groupedIdentityProviderList.value.length > 0) {
diff --git a/frontend/src/views/auth/Signup.vue b/frontend/src/views/auth/Signup.vue
index 6552afb327..1f714d7779 100644
--- a/frontend/src/views/auth/Signup.vue
+++ b/frontend/src/views/auth/Signup.vue
@@ -48,7 +48,7 @@
v-model:password="state.password"
v-model:password-confirm="state.passwordConfirm"
:show-learn-more="false"
- :password-restriction="passwordRestriction"
+ :password-restriction="restriction.passwordRestriction"
/>
<div>
@@ -176,8 +176,7 @@ const state = reactive<LocalState>({
isLoading: false,
});
-const { needAdminSetup, disallowSignup, passwordRestriction } =
- storeToRefs(actuatorStore);
+const { needAdminSetup, restriction } = storeToRefs(actuatorStore);
const allowSignup = computed(() => {
return (
@@ -187,7 +186,7 @@ const allowSignup = computed(() => {
!userPasswordRef.value?.passwordHint &&
!userPasswordRef.value?.passwordMismatch &&
state.acceptTermsAndPolicy &&
- !disallowSignup.value
+ !restriction.value.disallowSignup
);
});
diff --git a/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue b/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue
index 680d5dcb61..d91ef079dd 100644
--- a/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/SharePopover.vue
@@ -94,8 +94,8 @@ import { CopyButton } from "@/components/v2";
import { SQL_EDITOR_WORKSHEET_MODULE } from "@/router/sqlEditor";
import {
pushNotification,
+ useActuatorV1Store,
useCurrentUserV1,
- useSettingV1Store,
useSQLEditorTabStore,
useWorkSheetStore,
} from "@/store";
@@ -119,7 +119,6 @@ const { t } = useI18n();
const router = useRouter();
const tabStore = useSQLEditorTabStore();
const worksheetV1Store = useWorkSheetStore();
-const settingStore = useSettingV1Store();
const me = useCurrentUserV1();
const { copy: copyTextToClipboard, isSupported } = useClipboard({
@@ -127,7 +126,7 @@ const { copy: copyTextToClipboard, isSupported } = useClipboard({
});
const workspaceExternalURL = computed(
- () => settingStore.workspaceProfileSetting?.externalUrl
+ () => useActuatorV1Store().serverInfo?.externalUrl
);
const accessOptions = computed<AccessOption[]>(() => {
diff --git a/frontend/src/views/sql-editor/TabList/BrandingLogoWrapper.vue b/frontend/src/views/sql-editor/TabList/BrandingLogoWrapper.vue
index b1668f0f16..8f4e284742 100644
--- a/frontend/src/views/sql-editor/TabList/BrandingLogoWrapper.vue
+++ b/frontend/src/views/sql-editor/TabList/BrandingLogoWrapper.vue
@@ -14,9 +14,9 @@
<script lang="ts" setup>
import { computed } from "vue";
-import { useSettingV1Store } from "@/store/modules/v1/setting";
+import { useActuatorV1Store } from "@/store";
const customBrandingLogo = computed((): string | undefined => {
- return useSettingV1Store().brandingLogo;
+ return useActuatorV1Store().brandingLogo;
});
</script>
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 04314bd540..50ca97bf8d 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -7762,19 +7762,11 @@ components:
readOnly: true
type: boolean
description: Whether the Bytebase instance requires initial admin setup.
- disallowSignup:
- readOnly: true
- type: boolean
- description: Whether self-service user signup is disabled.
lastActiveTime:
readOnly: true
type: string
description: The last time any API call was made, refreshed on each request.
format: date-time
- require2fa:
- readOnly: true
- type: boolean
- description: Whether two-factor authentication is required for all users.
workspaceId:
readOnly: true
type: string
@@ -7788,15 +7780,6 @@ components:
items:
type: string
description: List of features that are not licensed.
- disallowPasswordSignin:
- readOnly: true
- type: boolean
- description: Whether password-based signin is disabled (except for workspace admins).
- passwordRestriction:
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/WorkspaceProfileSetting_PasswordRestriction'
- description: Password complexity and restriction requirements.
docker:
readOnly: true
type: boolean
@@ -7825,6 +7808,19 @@ components:
readOnly: true
type: boolean
description: Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
+ announcement:
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/Announcement'
+ description: The setting of custom announcement
+ enableMetricCollection:
+ readOnly: true
+ type: boolean
+ description: Whether to enable metric collection for the workspace.
+ restriction:
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/Restriction'
description: |-
System information and configuration for the Bytebase instance.
Actuator concept is similar to the Spring Boot Actuator.
@@ -12658,6 +12654,59 @@ components:
description: The branding logo.
format: bytes
description: Custom branding resources for the Bytebase instance.
+ Restriction:
+ type: object
+ properties:
+ disallowSignup:
+ readOnly: true
+ type: boolean
+ description: Whether self-service user signup is disabled.
+ require2fa:
+ readOnly: true
+ type: boolean
+ description: Whether two-factor authentication is required for all users.
+ disallowPasswordSignin:
+ readOnly: true
+ type: boolean
+ description: Whether password-based signin is disabled (except for workspace admins).
+ passwordRestriction:
+ readOnly: true
+ allOf:
+ - $ref: '#/components/schemas/WorkspaceProfileSetting_PasswordRestriction'
+ description: Password complexity and restriction requirements.
+ watermark:
+ readOnly: true
+ type: boolean
+ description: Whether to display watermark on pages.
+ databaseChangeMode:
+ readOnly: true
+ enum:
+ - DATABASE_CHANGE_MODE_UNSPECIFIED
+ - PIPELINE
+ - EDITOR
+ type: string
+ description: The workspace database change mode.
+ format: enum
+ inactiveSessionTimeout:
+ readOnly: true
+ pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
+ type: string
+ description: The session expiration time if not activity detected for the user. Value <= 0 means no limit.
+ domains:
+ readOnly: true
+ type: array
+ items:
+ type: string
+ description: The workspace domain, e.g., bytebase.com.
+ enforceIdentityDomain:
+ readOnly: true
+ type: boolean
+ description: Only user and group from the domains can be created and login.
+ maximumRoleExpiration:
+ readOnly: true
+ pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
+ type: string
+ description: The max duration for role expired.
Result_SqlReviewReport:
type: object
properties:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 735927728e..743eb0fb44 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -133,6 +133,7 @@
- [GetActuatorInfoRequest](#bytebase-v1-GetActuatorInfoRequest)
- [GetResourcePackageRequest](#bytebase-v1-GetResourcePackageRequest)
- [ResourcePackage](#bytebase-v1-ResourcePackage)
+ - [Restriction](#bytebase-v1-Restriction)
- [SetupSampleRequest](#bytebase-v1-SetupSampleRequest)
- [UpdateActuatorInfoRequest](#bytebase-v1-UpdateActuatorInfoRequest)
@@ -2531,20 +2532,19 @@ Actuator concept is similar to the Spring Boot Actuator.
| port | [string](#string) | | The port number of the Bytebase instance. |
| external_url | [string](#string) | | The external URL where users or webhook callbacks access Bytebase. |
| need_admin_setup | [bool](#bool) | | Whether the Bytebase instance requires initial admin setup. |
-| disallow_signup | [bool](#bool) | | Whether self-service user signup is disabled. |
| last_active_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The last time any API call was made, refreshed on each request. |
-| require_2fa | [bool](#bool) | | Whether two-factor authentication is required for all users. |
| workspace_id | [string](#string) | | The unique identifier for the workspace. |
| debug | [bool](#bool) | | Whether debug mode is enabled. |
| unlicensed_features | [string](#string) | repeated | List of features that are not licensed. |
-| disallow_password_signin | [bool](#bool) | | Whether password-based signin is disabled (except for workspace admins). |
-| password_restriction | [WorkspaceProfileSetting.PasswordRestriction](#bytebase-v1-WorkspaceProfileSetting-PasswordRestriction) | | Password complexity and restriction requirements. |
| docker | [bool](#bool) | | Whether the Bytebase instance is running in Docker. |
| user_stats | [ActuatorInfo.StatUser](#bytebase-v1-ActuatorInfo-StatUser) | repeated | Statistics about users in the system. |
| activated_instance_count | [int32](#int32) | | The number of activated database instances. |
| total_instance_count | [int32](#int32) | | The total number of database instances. |
| enable_sample | [bool](#bool) | | Whether sample data setup is enabled. |
| external_url_from_flag | [bool](#bool) | | Whether the external URL is set via command-line flag (and thus cannot be changed via UI). |
+| announcement | [Announcement](#bytebase-v1-Announcement) | | The setting of custom announcement |
+| enable_metric_collection | [bool](#bool) | | Whether to enable metric collection for the workspace. |
+| restriction | [Restriction](#bytebase-v1-Restriction) | | |
@@ -2613,6 +2613,30 @@ Custom branding resources for the Bytebase instance.
+<a name="bytebase-v1-Restriction"></a>
+
+### Restriction
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| disallow_signup | [bool](#bool) | | Whether self-service user signup is disabled. |
+| require_2fa | [bool](#bool) | | Whether two-factor authentication is required for all users. |
+| disallow_password_signin | [bool](#bool) | | Whether password-based signin is disabled (except for workspace admins). |
+| password_restriction | [WorkspaceProfileSetting.PasswordRestriction](#bytebase-v1-WorkspaceProfileSetting-PasswordRestriction) | | Password complexity and restriction requirements. |
+| watermark | [bool](#bool) | | Whether to display watermark on pages. |
+| database_change_mode | [DatabaseChangeMode](#bytebase-v1-DatabaseChangeMode) | | The workspace database change mode. |
+| inactive_session_timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | The session expiration time if not activity detected for the user. Value &lt;= 0 means no limit. |
+| domains | [string](#string) | repeated | The workspace domain, e.g., bytebase.com. |
+| enforce_identity_domain | [bool](#bool) | | Only user and group from the domains can be created and login. |
+| maximum_role_expiration | [google.protobuf.Duration](#google-protobuf-Duration) | | The max duration for role expired. |
+
+
+
+
+
+
<a name="bytebase-v1-SetupSampleRequest"></a>
### SetupSampleRequest
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 32da848c48..5a5b946241 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -677,6 +677,10 @@
<a href="#bytebase.v1.ResourcePackage"><span class="badge">M</span>ResourcePackage</a>
</li>
+ <li>
+ <a href="#bytebase.v1.Restriction"><span class="badge">M</span>Restriction</a>
+ </li>
+
<li>
<a href="#bytebase.v1.SetupSampleRequest"><span class="badge">M</span>SetupSampleRequest</a>
</li>
@@ -7578,13 +7582,6 @@ Permissions required: bb.users.updateEmail</p></td>
<td><p>Whether the Bytebase instance requires initial admin setup. </p></td>
</tr>
- <tr>
- <td>disallow_signup</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>Whether self-service user signup is disabled. </p></td>
- </tr>
-
<tr>
<td>last_active_time</td>
<td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
@@ -7592,13 +7589,6 @@ Permissions required: bb.users.updateEmail</p></td>
<td><p>The last time any API call was made, refreshed on each request. </p></td>
</tr>
- <tr>
- <td>require_2fa</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>Whether two-factor authentication is required for all users. </p></td>
- </tr>
-
<tr>
<td>workspace_id</td>
<td><a href="#string">string</a></td>
@@ -7620,20 +7610,6 @@ Permissions required: bb.users.updateEmail</p></td>
<td><p>List of features that are not licensed. </p></td>
</tr>
- <tr>
- <td>disallow_password_signin</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>Whether password-based signin is disabled (except for workspace admins). </p></td>
- </tr>
-
- <tr>
- <td>password_restriction</td>
- <td><a href="#bytebase.v1.WorkspaceProfileSetting.PasswordRestriction">WorkspaceProfileSetting.PasswordRestriction</a></td>
- <td></td>
- <td><p>Password complexity and restriction requirements. </p></td>
- </tr>
-
<tr>
<td>docker</td>
<td><a href="#bool">bool</a></td>
@@ -7676,6 +7652,27 @@ Permissions required: bb.users.updateEmail</p></td>
<td><p>Whether the external URL is set via command-line flag (and thus cannot be changed via UI). </p></td>
</tr>
+ <tr>
+ <td>announcement</td>
+ <td><a href="#bytebase.v1.Announcement">Announcement</a></td>
+ <td></td>
+ <td><p>The setting of custom announcement </p></td>
+ </tr>
+
+ <tr>
+ <td>enable_metric_collection</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Whether to enable metric collection for the workspace. </p></td>
+ </tr>
+
+ <tr>
+ <td>restriction</td>
+ <td><a href="#bytebase.v1.Restriction">Restriction</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
@@ -7766,6 +7763,93 @@ Permissions required: bb.users.updateEmail</p></td>
+ <h3 id="bytebase.v1.Restriction">Restriction</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>disallow_signup</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Whether self-service user signup is disabled. </p></td>
+ </tr>
+
+ <tr>
+ <td>require_2fa</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Whether two-factor authentication is required for all users. </p></td>
+ </tr>
+
+ <tr>
+ <td>disallow_password_signin</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Whether password-based signin is disabled (except for workspace admins). </p></td>
+ </tr>
+
+ <tr>
+ <td>password_restriction</td>
+ <td><a href="#bytebase.v1.WorkspaceProfileSetting.PasswordRestriction">WorkspaceProfileSetting.PasswordRestriction</a></td>
+ <td></td>
+ <td><p>Password complexity and restriction requirements. </p></td>
+ </tr>
+
+ <tr>
+ <td>watermark</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Whether to display watermark on pages. </p></td>
+ </tr>
+
+ <tr>
+ <td>database_change_mode</td>
+ <td><a href="#bytebase.v1.DatabaseChangeMode">DatabaseChangeMode</a></td>
+ <td></td>
+ <td><p>The workspace database change mode. </p></td>
+ </tr>
+
+ <tr>
+ <td>inactive_session_timeout</td>
+ <td><a href="#google.protobuf.Duration">google.protobuf.Duration</a></td>
+ <td></td>
+ <td><p>The session expiration time if not activity detected for the user. Value &lt;= 0 means no limit. </p></td>
+ </tr>
+
+ <tr>
+ <td>domains</td>
+ <td><a href="#string">string</a></td>
+ <td>repeated</td>
+ <td><p>The workspace domain, e.g., bytebase.com. </p></td>
+ </tr>
+
+ <tr>
+ <td>enforce_identity_domain</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Only user and group from the domains can be created and login. </p></td>
+ </tr>
+
+ <tr>
+ <td>maximum_role_expiration</td>
+ <td><a href="#google.protobuf.Duration">google.protobuf.Duration</a></td>
+ <td></td>
+ <td><p>The max duration for role expired. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.v1.SetupSampleRequest">SetupSampleRequest</h3>
<p>Request message for setting up sample data.</p>
diff --git a/proto/v1/v1/actuator_service.proto b/proto/v1/v1/actuator_service.proto
index daaec415b2..69b3c75d51 100644
--- a/proto/v1/v1/actuator_service.proto
+++ b/proto/v1/v1/actuator_service.proto
@@ -5,6 +5,7 @@ package bytebase.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
+import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
@@ -95,9 +96,43 @@ message UpdateActuatorInfoRequest {
// Request message for deleting cache.
message DeleteCacheRequest {}
+message Restriction {
+ // Whether self-service user signup is disabled.
+ bool disallow_signup = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Whether two-factor authentication is required for all users.
+ bool require_2fa = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Whether password-based signin is disabled (except for workspace admins).
+ bool disallow_password_signin = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Password complexity and restriction requirements.
+ WorkspaceProfileSetting.PasswordRestriction password_restriction = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Whether to display watermark on pages.
+ bool watermark = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The workspace database change mode.
+ DatabaseChangeMode database_change_mode = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The session expiration time if not activity detected for the user. Value <= 0 means no limit.
+ google.protobuf.Duration inactive_session_timeout = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The workspace domain, e.g., bytebase.com.
+ repeated string domains = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Only user and group from the domains can be created and login.
+ bool enforce_identity_domain = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The max duration for role expired.
+ google.protobuf.Duration maximum_role_expiration = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
+}
+
// System information and configuration for the Bytebase instance.
// Actuator concept is similar to the Spring Boot Actuator.
message ActuatorInfo {
+ reserved 10, 12, 16, 17;
+
// The Bytebase server version.
string version = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -125,15 +160,9 @@ message ActuatorInfo {
// Whether the Bytebase instance requires initial admin setup.
bool need_admin_setup = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
- // Whether self-service user signup is disabled.
- bool disallow_signup = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
-
// The last time any API call was made, refreshed on each request.
google.protobuf.Timestamp last_active_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
- // Whether two-factor authentication is required for all users.
- bool require_2fa = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
-
// The unique identifier for the workspace.
string workspace_id = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -143,12 +172,6 @@ message ActuatorInfo {
// List of features that are not licensed.
repeated string unlicensed_features = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
- // Whether password-based signin is disabled (except for workspace admins).
- bool disallow_password_signin = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
-
- // Password complexity and restriction requirements.
- WorkspaceProfileSetting.PasswordRestriction password_restriction = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
-
// Whether the Bytebase instance is running in Docker.
bool docker = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -167,6 +190,7 @@ message ActuatorInfo {
// The number of activated database instances.
int32 activated_instance_count = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
+
// The total number of database instances.
int32 total_instance_count = 21 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -175,4 +199,12 @@ message ActuatorInfo {
// Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
bool external_url_from_flag = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The setting of custom announcement
+ Announcement announcement = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Whether to enable metric collection for the workspace.
+ bool enable_metric_collection = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ Restriction restriction = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
}