Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: the store proto definition of mail delivery setting (#5620)
h3n4lb75e6d068d21
diff --git a/frontend/src/types/proto/store/setting.ts b/frontend/src/types/proto/store/setting.tsindex 5967d2c1d3..606081d8f9 100644--- a/frontend/src/types/proto/store/setting.ts+++ b/frontend/src/types/proto/store/setting.ts@@ -38,6 +38,122 @@ export interface WorkspaceApprovalSetting_Rule {template?: ApprovalTemplate;}+export interface SMTPMailDeliverySetting {+ /** The SMTP server address. */+ server: string;+ /** The SMTP server port. */+ port: number;+ /** The SMTP server encryption. */+ encryption: SMTPMailDeliverySetting_Encryption;+ /** The CA, KEY, and CERT for the SMTP server. */+ ca: string;+ key: string;+ cert: string;+ authentication: SMTPMailDeliverySetting_Authentication;+ username: string;+ password: string;+ /** The sender email address. */+ from: string;+}++/** We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS. */+export enum SMTPMailDeliverySetting_Encryption {+ ENCRYPTION_UNSPECIFIED = 0,+ ENCRYPTION_NONE = 1,+ ENCRYPTION_STARTTLS = 2,+ ENCRYPTION_SSL_TLS = 3,+ UNRECOGNIZED = -1,+}++export function sMTPMailDeliverySetting_EncryptionFromJSON(object: any): SMTPMailDeliverySetting_Encryption {+ switch (object) {+ case 0:+ case "ENCRYPTION_UNSPECIFIED":+ return SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED;+ case 1:+ case "ENCRYPTION_NONE":+ return SMTPMailDeliverySetting_Encryption.ENCRYPTION_NONE;+ case 2:+ case "ENCRYPTION_STARTTLS":+ return SMTPMailDeliverySetting_Encryption.ENCRYPTION_STARTTLS;+ case 3:+ case "ENCRYPTION_SSL_TLS":+ return SMTPMailDeliverySetting_Encryption.ENCRYPTION_SSL_TLS;+ case -1:+ case "UNRECOGNIZED":+ default:+ return SMTPMailDeliverySetting_Encryption.UNRECOGNIZED;+ }+}++export function sMTPMailDeliverySetting_EncryptionToJSON(object: SMTPMailDeliverySetting_Encryption): string {+ switch (object) {+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_UNSPECIFIED:+ return "ENCRYPTION_UNSPECIFIED";+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_NONE:+ return "ENCRYPTION_NONE";+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_STARTTLS:+ return "ENCRYPTION_STARTTLS";+ case SMTPMailDeliverySetting_Encryption.ENCRYPTION_SSL_TLS:+ return "ENCRYPTION_SSL_TLS";+ case SMTPMailDeliverySetting_Encryption.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}++/** We support four types of SMTP authentication: NONE, PLAIN, LOGIN, and CRAM-MD5. */+export enum SMTPMailDeliverySetting_Authentication {+ AUTHENTICATION_UNSPECIFIED = 0,+ AUTHENTICATION_NONE = 1,+ AUTHENTICATION_PLAIN = 2,+ AUTHENTICATION_LOGIN = 3,+ AUTHENTICATION_CRAM_MD5 = 4,+ UNRECOGNIZED = -1,+}++export function sMTPMailDeliverySetting_AuthenticationFromJSON(object: any): SMTPMailDeliverySetting_Authentication {+ switch (object) {+ case 0:+ case "AUTHENTICATION_UNSPECIFIED":+ return SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED;+ case 1:+ case "AUTHENTICATION_NONE":+ return SMTPMailDeliverySetting_Authentication.AUTHENTICATION_NONE;+ case 2:+ case "AUTHENTICATION_PLAIN":+ return SMTPMailDeliverySetting_Authentication.AUTHENTICATION_PLAIN;+ case 3:+ case "AUTHENTICATION_LOGIN":+ return SMTPMailDeliverySetting_Authentication.AUTHENTICATION_LOGIN;+ case 4:+ case "AUTHENTICATION_CRAM_MD5":+ return SMTPMailDeliverySetting_Authentication.AUTHENTICATION_CRAM_MD5;+ case -1:+ case "UNRECOGNIZED":+ default:+ return SMTPMailDeliverySetting_Authentication.UNRECOGNIZED;+ }+}++export function sMTPMailDeliverySetting_AuthenticationToJSON(object: SMTPMailDeliverySetting_Authentication): string {+ switch (object) {+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_UNSPECIFIED:+ return "AUTHENTICATION_UNSPECIFIED";+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_NONE:+ return "AUTHENTICATION_NONE";+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_PLAIN:+ return "AUTHENTICATION_PLAIN";+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_LOGIN:+ return "AUTHENTICATION_LOGIN";+ case SMTPMailDeliverySetting_Authentication.AUTHENTICATION_CRAM_MD5:+ return "AUTHENTICATION_CRAM_MD5";+ case SMTPMailDeliverySetting_Authentication.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}+function createBaseWorkspaceProfileSetting(): WorkspaceProfileSetting {return { externalUrl: "", disallowSignup: false, require2fa: false, outboundIpList: [] };}@@ -348,6 +464,195 @@ export const WorkspaceApprovalSetting_Rule = {},};+function createBaseSMTPMailDeliverySetting(): SMTPMailDeliverySetting {+ return {+ server: "",+ port: 0,+ encryption: 0,+ ca: "",+ key: "",+ cert: "",+ authentication: 0,+ username: "",+ password: "",+ from: "",+ };+}++export const SMTPMailDeliverySetting = {+ encode(message: SMTPMailDeliverySetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.server !== "") {+ writer.uint32(10).string(message.server);+ }+ if (message.port !== 0) {+ writer.uint32(16).int32(message.port);+ }+ if (message.encryption !== 0) {+ writer.uint32(24).int32(message.encryption);+ }+ if (message.ca !== "") {+ writer.uint32(34).string(message.ca);+ }+ if (message.key !== "") {+ writer.uint32(42).string(message.key);+ }+ if (message.cert !== "") {+ writer.uint32(50).string(message.cert);+ }+ if (message.authentication !== 0) {+ writer.uint32(56).int32(message.authentication);+ }+ if (message.username !== "") {+ writer.uint32(66).string(message.username);+ }+ if (message.password !== "") {+ writer.uint32(74).string(message.password);+ }+ if (message.from !== "") {+ writer.uint32(82).string(message.from);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): SMTPMailDeliverySetting {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseSMTPMailDeliverySetting();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag != 10) {+ break;+ }++ message.server = reader.string();+ continue;+ case 2:+ if (tag != 16) {+ break;+ }++ message.port = reader.int32();+ continue;+ case 3:+ if (tag != 24) {+ break;+ }++ message.encryption = reader.int32() as any;+ continue;+ case 4:+ if (tag != 34) {+ break;+ }++ message.ca = reader.string();+ continue;+ case 5:+ if (tag != 42) {+ break;+ }++ message.key = reader.string();+ continue;+ case 6:+ if (tag != 50) {+ break;+ }++ message.cert = reader.string();+ continue;+ case 7:+ if (tag != 56) {+ break;+ }++ message.authentication = reader.int32() as any;+ continue;+ case 8:+ if (tag != 66) {+ break;+ }++ message.username = reader.string();+ continue;+ case 9:+ if (tag != 74) {+ break;+ }++ message.password = reader.string();+ continue;+ case 10:+ if (tag != 82) {+ break;+ }++ message.from = reader.string();+ continue;+ }+ if ((tag & 7) == 4 || tag == 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): SMTPMailDeliverySetting {+ return {+ server: isSet(object.server) ? String(object.server) : "",+ port: isSet(object.port) ? Number(object.port) : 0,+ encryption: isSet(object.encryption) ? sMTPMailDeliverySetting_EncryptionFromJSON(object.encryption) : 0,+ ca: isSet(object.ca) ? String(object.ca) : "",+ key: isSet(object.key) ? String(object.key) : "",+ cert: isSet(object.cert) ? String(object.cert) : "",+ authentication: isSet(object.authentication)+ ? sMTPMailDeliverySetting_AuthenticationFromJSON(object.authentication)+ : 0,+ username: isSet(object.username) ? String(object.username) : "",+ password: isSet(object.password) ? String(object.password) : "",+ from: isSet(object.from) ? String(object.from) : "",+ };+ },++ toJSON(message: SMTPMailDeliverySetting): unknown {+ const obj: any = {};+ message.server !== undefined && (obj.server = message.server);+ message.port !== undefined && (obj.port = Math.round(message.port));+ message.encryption !== undefined && (obj.encryption = sMTPMailDeliverySetting_EncryptionToJSON(message.encryption));+ message.ca !== undefined && (obj.ca = message.ca);+ message.key !== undefined && (obj.key = message.key);+ message.cert !== undefined && (obj.cert = message.cert);+ message.authentication !== undefined &&+ (obj.authentication = sMTPMailDeliverySetting_AuthenticationToJSON(message.authentication));+ message.username !== undefined && (obj.username = message.username);+ message.password !== undefined && (obj.password = message.password);+ message.from !== undefined && (obj.from = message.from);+ return obj;+ },++ create(base?: DeepPartial<SMTPMailDeliverySetting>): SMTPMailDeliverySetting {+ return SMTPMailDeliverySetting.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<SMTPMailDeliverySetting>): SMTPMailDeliverySetting {+ const message = createBaseSMTPMailDeliverySetting();+ message.server = object.server ?? "";+ message.port = object.port ?? 0;+ message.encryption = object.encryption ?? 0;+ message.ca = object.ca ?? "";+ message.key = object.key ?? "";+ message.cert = object.cert ?? "";+ message.authentication = object.authentication ?? 0;+ message.username = object.username ?? "";+ message.password = object.password ?? "";+ message.from = object.from ?? "";+ return message;+ },+};+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;export type DeepPartial<T> = T extends Builtin ? Tdiff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 8b46c07540..bf0e4c8d14 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -57,10 +57,14 @@- [store/setting.proto](#store_setting-proto)- [AgentPluginSetting](#bytebase-store-AgentPluginSetting)+ - [SMTPMailDeliverySetting](#bytebase-store-SMTPMailDeliverySetting)- [WorkspaceApprovalSetting](#bytebase-store-WorkspaceApprovalSetting)- [WorkspaceApprovalSetting.Rule](#bytebase-store-WorkspaceApprovalSetting-Rule)- [WorkspaceProfileSetting](#bytebase-store-WorkspaceProfileSetting)+ - [SMTPMailDeliverySetting.Authentication](#bytebase-store-SMTPMailDeliverySetting-Authentication)+ - [SMTPMailDeliverySetting.Encryption](#bytebase-store-SMTPMailDeliverySetting-Encryption)+- [store/slow_query.proto](#store_slow_query-proto)- [SlowQueryDetails](#bytebase-store-SlowQueryDetails)- [SlowQueryStatistics](#bytebase-store-SlowQueryStatistics)@@ -837,6 +841,30 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.+<a name="bytebase-store-SMTPMailDeliverySetting"></a>++### SMTPMailDeliverySetting++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| server | [string](#string) | | The SMTP server address. |+| port | [int32](#int32) | | The SMTP server port. |+| encryption | [SMTPMailDeliverySetting.Encryption](#bytebase-store-SMTPMailDeliverySetting-Encryption) | | The SMTP server encryption. |+| ca | [string](#string) | | The CA, KEY, and CERT for the SMTP server. |+| key | [string](#string) | | |+| cert | [string](#string) | | |+| authentication | [SMTPMailDeliverySetting.Authentication](#bytebase-store-SMTPMailDeliverySetting-Authentication) | | |+| username | [string](#string) | | |+| password | [string](#string) | | |+| from | [string](#string) | | The sender email address. |++++++<a name="bytebase-store-WorkspaceApprovalSetting"></a>### WorkspaceApprovalSetting@@ -889,6 +917,35 @@ The external URL is used for: 1. Constructing the correct callback URL when conf++<a name="bytebase-store-SMTPMailDeliverySetting-Authentication"></a>++### SMTPMailDeliverySetting.Authentication+We support four types of SMTP authentication: NONE, PLAIN, LOGIN, and CRAM-MD5.++| Name | Number | Description |+| ---- | ------ | ----------- |+| AUTHENTICATION_UNSPECIFIED | 0 | |+| AUTHENTICATION_NONE | 1 | |+| AUTHENTICATION_PLAIN | 2 | |+| AUTHENTICATION_LOGIN | 3 | |+| AUTHENTICATION_CRAM_MD5 | 4 | |++++<a name="bytebase-store-SMTPMailDeliverySetting-Encryption"></a>++### SMTPMailDeliverySetting.Encryption+We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.++| Name | Number | Description |+| ---- | ------ | ----------- |+| ENCRYPTION_UNSPECIFIED | 0 | |+| ENCRYPTION_NONE | 1 | |+| ENCRYPTION_STARTTLS | 2 | |+| ENCRYPTION_SSL_TLS | 3 | |++diff --git a/proto/generated-go/store/setting.pb.go b/proto/generated-go/store/setting.pb.goindex b117a61be6..0ddf5f60e5 100644--- a/proto/generated-go/store/setting.pb.go+++ b/proto/generated-go/store/setting.pb.go@@ -21,6 +21,115 @@ const (_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20))+// We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.+type SMTPMailDeliverySetting_Encryption int32++const (+ SMTPMailDeliverySetting_ENCRYPTION_UNSPECIFIED SMTPMailDeliverySetting_Encryption = 0+ SMTPMailDeliverySetting_ENCRYPTION_NONE SMTPMailDeliverySetting_Encryption = 1+ SMTPMailDeliverySetting_ENCRYPTION_STARTTLS SMTPMailDeliverySetting_Encryption = 2+ SMTPMailDeliverySetting_ENCRYPTION_SSL_TLS SMTPMailDeliverySetting_Encryption = 3+)++// Enum value maps for SMTPMailDeliverySetting_Encryption.+var (+ SMTPMailDeliverySetting_Encryption_name = map[int32]string{+ 0: "ENCRYPTION_UNSPECIFIED",+ 1: "ENCRYPTION_NONE",+ 2: "ENCRYPTION_STARTTLS",+ 3: "ENCRYPTION_SSL_TLS",+ }+ SMTPMailDeliverySetting_Encryption_value = map[string]int32{+ "ENCRYPTION_UNSPECIFIED": 0,+ "ENCRYPTION_NONE": 1,+ "ENCRYPTION_STARTTLS": 2,+ "ENCRYPTION_SSL_TLS": 3,+ }+)++func (x SMTPMailDeliverySetting_Encryption) Enum() *SMTPMailDeliverySetting_Encryption {+ p := new(SMTPMailDeliverySetting_Encryption)+ *p = x+ return p+}++func (x SMTPMailDeliverySetting_Encryption) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (SMTPMailDeliverySetting_Encryption) Descriptor() protoreflect.EnumDescriptor {+ return file_store_setting_proto_enumTypes[0].Descriptor()+}++func (SMTPMailDeliverySetting_Encryption) Type() protoreflect.EnumType {+ return &file_store_setting_proto_enumTypes[0]+}++func (x SMTPMailDeliverySetting_Encryption) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use SMTPMailDeliverySetting_Encryption.Descriptor instead.+func (SMTPMailDeliverySetting_Encryption) EnumDescriptor() ([]byte, []int) {+ return file_store_setting_proto_rawDescGZIP(), []int{3, 0}+}++// We support four types of SMTP authentication: NONE, PLAIN, LOGIN, and CRAM-MD5.+type SMTPMailDeliverySetting_Authentication int32++const (+ SMTPMailDeliverySetting_AUTHENTICATION_UNSPECIFIED SMTPMailDeliverySetting_Authentication = 0+ SMTPMailDeliverySetting_AUTHENTICATION_NONE SMTPMailDeliverySetting_Authentication = 1+ SMTPMailDeliverySetting_AUTHENTICATION_PLAIN SMTPMailDeliverySetting_Authentication = 2+ SMTPMailDeliverySetting_AUTHENTICATION_LOGIN SMTPMailDeliverySetting_Authentication = 3+ SMTPMailDeliverySetting_AUTHENTICATION_CRAM_MD5 SMTPMailDeliverySetting_Authentication = 4+)++// Enum value maps for SMTPMailDeliverySetting_Authentication.+var (+ SMTPMailDeliverySetting_Authentication_name = map[int32]string{+ 0: "AUTHENTICATION_UNSPECIFIED",+ 1: "AUTHENTICATION_NONE",+ 2: "AUTHENTICATION_PLAIN",+ 3: "AUTHENTICATION_LOGIN",+ 4: "AUTHENTICATION_CRAM_MD5",+ }+ SMTPMailDeliverySetting_Authentication_value = map[string]int32{+ "AUTHENTICATION_UNSPECIFIED": 0,+ "AUTHENTICATION_NONE": 1,+ "AUTHENTICATION_PLAIN": 2,+ "AUTHENTICATION_LOGIN": 3,+ "AUTHENTICATION_CRAM_MD5": 4,+ }+)++func (x SMTPMailDeliverySetting_Authentication) Enum() *SMTPMailDeliverySetting_Authentication {+ p := new(SMTPMailDeliverySetting_Authentication)+ *p = x+ return p+}++func (x SMTPMailDeliverySetting_Authentication) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (SMTPMailDeliverySetting_Authentication) Descriptor() protoreflect.EnumDescriptor {+ return file_store_setting_proto_enumTypes[1].Descriptor()+}++func (SMTPMailDeliverySetting_Authentication) Type() protoreflect.EnumType {+ return &file_store_setting_proto_enumTypes[1]+}++func (x SMTPMailDeliverySetting_Authentication) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use SMTPMailDeliverySetting_Authentication.Descriptor instead.+func (SMTPMailDeliverySetting_Authentication) EnumDescriptor() ([]byte, []int) {+ return file_store_setting_proto_rawDescGZIP(), []int{3, 1}+}+type WorkspaceProfileSetting struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -204,6 +313,130 @@ func (x *WorkspaceApprovalSetting) GetRules() []*WorkspaceApprovalSetting_Rule {return nil}+type SMTPMailDeliverySetting struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The SMTP server address.+ Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`+ // The SMTP server port.+ Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`+ // The SMTP server encryption.+ Encryption SMTPMailDeliverySetting_Encryption `protobuf:"varint,3,opt,name=encryption,proto3,enum=bytebase.store.SMTPMailDeliverySetting_Encryption" json:"encryption,omitempty"`+ // The CA, KEY, and CERT for the SMTP server.+ Ca string `protobuf:"bytes,4,opt,name=ca,proto3" json:"ca,omitempty"`+ Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"`+ Cert string `protobuf:"bytes,6,opt,name=cert,proto3" json:"cert,omitempty"`+ Authentication SMTPMailDeliverySetting_Authentication `protobuf:"varint,7,opt,name=authentication,proto3,enum=bytebase.store.SMTPMailDeliverySetting_Authentication" json:"authentication,omitempty"`+ Username string `protobuf:"bytes,8,opt,name=username,proto3" json:"username,omitempty"`+ Password string `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"`+ // The sender email address.+ From string `protobuf:"bytes,10,opt,name=from,proto3" json:"from,omitempty"`+}++func (x *SMTPMailDeliverySetting) Reset() {+ *x = SMTPMailDeliverySetting{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_setting_proto_msgTypes[3]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *SMTPMailDeliverySetting) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*SMTPMailDeliverySetting) ProtoMessage() {}++func (x *SMTPMailDeliverySetting) ProtoReflect() protoreflect.Message {+ mi := &file_store_setting_proto_msgTypes[3]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use SMTPMailDeliverySetting.ProtoReflect.Descriptor instead.+func (*SMTPMailDeliverySetting) Descriptor() ([]byte, []int) {+ return file_store_setting_proto_rawDescGZIP(), []int{3}+}++func (x *SMTPMailDeliverySetting) GetServer() string {+ if x != nil {+ return x.Server+ }+ return ""+}++func (x *SMTPMailDeliverySetting) GetPort() int32 {+ if x != nil {+ return x.Port+ }+ return 0+}++func (x *SMTPMailDeliverySetting) GetEncryption() SMTPMailDeliverySetting_Encryption {+ if x != nil {+ return x.Encryption+ }+ return SMTPMailDeliverySetting_ENCRYPTION_UNSPECIFIED+}++func (x *SMTPMailDeliverySetting) GetCa() string {+ if x != nil {+ return x.Ca+ }+ return ""+}++func (x *SMTPMailDeliverySetting) GetKey() string {+ if x != nil {+ return x.Key+ }+ return ""+}++func (x *SMTPMailDeliverySetting) GetCert() string {+ if x != nil {+ return x.Cert+ }+ return ""+}++func (x *SMTPMailDeliverySetting) GetAuthentication() SMTPMailDeliverySetting_Authentication {+ if x != nil {+ return x.Authentication+ }+ return SMTPMailDeliverySetting_AUTHENTICATION_UNSPECIFIED+}++func (x *SMTPMailDeliverySetting) GetUsername() string {+ if x != nil {+ return x.Username+ }+ return ""+}++func (x *SMTPMailDeliverySetting) GetPassword() string {+ if x != nil {+ return x.Password+ }+ return ""+}++func (x *SMTPMailDeliverySetting) GetFrom() string {+ if x != nil {+ return x.From+ }+ return ""+}+type WorkspaceApprovalSetting_Rule struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -216,7 +449,7 @@ type WorkspaceApprovalSetting_Rule struct {func (x *WorkspaceApprovalSetting_Rule) Reset() {*x = WorkspaceApprovalSetting_Rule{}if protoimpl.UnsafeEnabled {- mi := &file_store_setting_proto_msgTypes[3]+ mi := &file_store_setting_proto_msgTypes[4]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -229,7 +462,7 @@ func (x *WorkspaceApprovalSetting_Rule) String() string {func (*WorkspaceApprovalSetting_Rule) ProtoMessage() {}func (x *WorkspaceApprovalSetting_Rule) ProtoReflect() protoreflect.Message {- mi := &file_store_setting_proto_msgTypes[3]+ mi := &file_store_setting_proto_msgTypes[4]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -298,8 +531,49 @@ var file_store_setting_proto_rawDesc = []byte{0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c,0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61,- 0x74, 0x65, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d,- 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x74, 0x65, 0x22, 0x88, 0x05, 0x0a, 0x17, 0x53, 0x4d, 0x54, 0x50, 0x4d, 0x61, 0x69, 0x6c, 0x44,+ 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x16,+ 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,+ 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02,+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x52, 0x0a, 0x0a, 0x65, 0x6e,+ 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,+ 0x53, 0x4d, 0x54, 0x50, 0x4d, 0x61, 0x69, 0x6c, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79,+ 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69,+ 0x6f, 0x6e, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e,+ 0x0a, 0x02, 0x63, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x63, 0x61, 0x12, 0x10,+ 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,+ 0x12, 0x12, 0x0a, 0x04, 0x63, 0x65, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,+ 0x63, 0x65, 0x72, 0x74, 0x12, 0x5e, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x4d,+ 0x54, 0x50, 0x4d, 0x61, 0x69, 0x6c, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x53, 0x65,+ 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61,+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61,+ 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,+ 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65,+ 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04,+ 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d,+ 0x22, 0x6e, 0x0a, 0x0a, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a,+ 0x0a, 0x16, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53,+ 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x4e,+ 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12,+ 0x17, 0x0a, 0x13, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54,+ 0x41, 0x52, 0x54, 0x54, 0x4c, 0x53, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x4e, 0x43, 0x52,+ 0x59, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x54, 0x4c, 0x53, 0x10, 0x03,+ 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,+ 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43,+ 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,+ 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43,+ 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14,+ 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50,+ 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e,+ 0x54, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x10, 0x03,+ 0x12, 0x1b, 0x0a, 0x17, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49,+ 0x4f, 0x4e, 0x5f, 0x43, 0x52, 0x41, 0x4d, 0x5f, 0x4d, 0x44, 0x35, 0x10, 0x04, 0x42, 0x14, 0x5a,+ 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74,+ 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,}var (@@ -314,24 +588,30 @@ func file_store_setting_proto_rawDescGZIP() []byte {return file_store_setting_proto_rawDescData}-var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 4)+var file_store_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 2)+var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 5)var file_store_setting_proto_goTypes = []interface{}{- (*WorkspaceProfileSetting)(nil), // 0: bytebase.store.WorkspaceProfileSetting- (*AgentPluginSetting)(nil), // 1: bytebase.store.AgentPluginSetting- (*WorkspaceApprovalSetting)(nil), // 2: bytebase.store.WorkspaceApprovalSetting- (*WorkspaceApprovalSetting_Rule)(nil), // 3: bytebase.store.WorkspaceApprovalSetting.Rule- (*v1alpha1.ParsedExpr)(nil), // 4: google.api.expr.v1alpha1.ParsedExpr- (*ApprovalTemplate)(nil), // 5: bytebase.store.ApprovalTemplate+ (SMTPMailDeliverySetting_Encryption)(0), // 0: bytebase.store.SMTPMailDeliverySetting.Encryption+ (SMTPMailDeliverySetting_Authentication)(0), // 1: bytebase.store.SMTPMailDeliverySetting.Authentication+ (*WorkspaceProfileSetting)(nil), // 2: bytebase.store.WorkspaceProfileSetting+ (*AgentPluginSetting)(nil), // 3: bytebase.store.AgentPluginSetting+ (*WorkspaceApprovalSetting)(nil), // 4: bytebase.store.WorkspaceApprovalSetting+ (*SMTPMailDeliverySetting)(nil), // 5: bytebase.store.SMTPMailDeliverySetting+ (*WorkspaceApprovalSetting_Rule)(nil), // 6: bytebase.store.WorkspaceApprovalSetting.Rule+ (*v1alpha1.ParsedExpr)(nil), // 7: google.api.expr.v1alpha1.ParsedExpr+ (*ApprovalTemplate)(nil), // 8: bytebase.store.ApprovalTemplate}var file_store_setting_proto_depIdxs = []int32{- 3, // 0: bytebase.store.WorkspaceApprovalSetting.rules:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule- 4, // 1: bytebase.store.WorkspaceApprovalSetting.Rule.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr- 5, // 2: bytebase.store.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate- 3, // [3:3] is the sub-list for method output_type- 3, // [3:3] is the sub-list for method input_type- 3, // [3:3] is the sub-list for extension type_name- 3, // [3:3] is the sub-list for extension extendee- 0, // [0:3] is the sub-list for field type_name+ 6, // 0: bytebase.store.WorkspaceApprovalSetting.rules:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule+ 0, // 1: bytebase.store.SMTPMailDeliverySetting.encryption:type_name -> bytebase.store.SMTPMailDeliverySetting.Encryption+ 1, // 2: bytebase.store.SMTPMailDeliverySetting.authentication:type_name -> bytebase.store.SMTPMailDeliverySetting.Authentication+ 7, // 3: bytebase.store.WorkspaceApprovalSetting.Rule.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr+ 8, // 4: bytebase.store.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate+ 5, // [5:5] is the sub-list for method output_type+ 5, // [5:5] is the sub-list for method input_type+ 5, // [5:5] is the sub-list for extension type_name+ 5, // [5:5] is the sub-list for extension extendee+ 0, // [0:5] is the sub-list for field type_name}func init() { file_store_setting_proto_init() }@@ -378,6 +658,18 @@ func file_store_setting_proto_init() {}}file_store_setting_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*SMTPMailDeliverySetting); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_setting_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*WorkspaceApprovalSetting_Rule); i {case 0:return &v.state@@ -395,13 +687,14 @@ func file_store_setting_proto_init() {File: protoimpl.DescBuilder{GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_store_setting_proto_rawDesc,- NumEnums: 0,- NumMessages: 4,+ NumEnums: 2,+ NumMessages: 5,NumExtensions: 0,NumServices: 0,},GoTypes: file_store_setting_proto_goTypes,DependencyIndexes: file_store_setting_proto_depIdxs,+ EnumInfos: file_store_setting_proto_enumTypes,MessageInfos: file_store_setting_proto_msgTypes,}.Build()File_store_setting_proto = out.Filediff --git a/proto/store/setting.proto b/proto/store/setting.protoindex 578fa07180..584fe51d7e 100644--- a/proto/store/setting.proto+++ b/proto/store/setting.proto@@ -40,3 +40,42 @@ message WorkspaceApprovalSetting {}repeated Rule rules = 1;}++message SMTPMailDeliverySetting {+ // The SMTP server address.+ string server = 1;++ // The SMTP server port.+ int32 port = 2;++ // We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.+ enum Encryption {+ ENCRYPTION_UNSPECIFIED = 0;+ ENCRYPTION_NONE = 1;+ ENCRYPTION_STARTTLS = 2;+ ENCRYPTION_SSL_TLS = 3;+ }++ // The SMTP server encryption.+ Encryption encryption = 3;++ // The CA, KEY, and CERT for the SMTP server.+ string ca = 4;+ string key = 5;+ string cert = 6;++ // We support four types of SMTP authentication: NONE, PLAIN, LOGIN, and CRAM-MD5.+ enum Authentication {+ AUTHENTICATION_UNSPECIFIED = 0;+ AUTHENTICATION_NONE = 1;+ AUTHENTICATION_PLAIN = 2;+ AUTHENTICATION_LOGIN = 3;+ AUTHENTICATION_CRAM_MD5 = 4;+ }+ Authentication authentication = 7;+ string username = 8;+ string password = 9;++ // The sender email address.+ string from = 10;+}\ No newline at end of file