Unverified Commit 736637a3 authored by Johnny's avatar Johnny Committed by GitHub

feat: add public flag instead of system setting to enable signup (#3589)

parent 387bf48f
...@@ -36,6 +36,7 @@ var ( ...@@ -36,6 +36,7 @@ var (
data string data string
driver string driver string
dsn string dsn string
public bool
instanceProfile *profile.Profile instanceProfile *profile.Profile
rootCmd = &cobra.Command{ rootCmd = &cobra.Command{
...@@ -109,6 +110,7 @@ func init() { ...@@ -109,6 +110,7 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory") rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver") rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver")
rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)") rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)")
rootCmd.PersistentFlags().BoolVarP(&public, "public", "", true, "")
err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode")) err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode"))
if err != nil { if err != nil {
...@@ -134,11 +136,16 @@ func init() { ...@@ -134,11 +136,16 @@ func init() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
err = viper.BindPFlag("public", rootCmd.PersistentFlags().Lookup("public"))
if err != nil {
panic(err)
}
viper.SetDefault("mode", "demo") viper.SetDefault("mode", "demo")
viper.SetDefault("driver", "sqlite") viper.SetDefault("driver", "sqlite")
viper.SetDefault("addr", "") viper.SetDefault("addr", "")
viper.SetDefault("port", 8081) viper.SetDefault("port", 8081)
viper.SetDefault("public", true)
viper.SetEnvPrefix("memos") viper.SetEnvPrefix("memos")
} }
......
This diff is collapsed.
...@@ -21,6 +21,8 @@ message WorkspaceProfile { ...@@ -21,6 +21,8 @@ message WorkspaceProfile {
string version = 2; string version = 2;
// mode is the instance mode (e.g. "prod", "dev" or "demo"). // mode is the instance mode (e.g. "prod", "dev" or "demo").
string mode = 3; string mode = 3;
// public is a flag that the instance is open for other users.
bool public = 4;
} }
message GetWorkspaceProfileRequest {} message GetWorkspaceProfileRequest {}
...@@ -36,10 +36,6 @@ message WorkspaceSetting { ...@@ -36,10 +36,6 @@ message WorkspaceSetting {
} }
message WorkspaceGeneralSetting { message WorkspaceGeneralSetting {
// disallow_signup is the flag to disallow signup.
bool disallow_signup = 1;
// disallow_password_login is the flag to disallow password login.
bool disallow_password_login = 2;
// additional_script is the additional script. // additional_script is the additional script.
string additional_script = 3; string additional_script = 3;
// additional_style is the additional style. // additional_style is the additional style.
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/activity_service.proto // source: api/v1/activity_service.proto
...@@ -410,7 +410,7 @@ func file_api_v1_activity_service_proto_rawDescGZIP() []byte { ...@@ -410,7 +410,7 @@ func file_api_v1_activity_service_proto_rawDescGZIP() []byte {
} }
var file_api_v1_activity_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_api_v1_activity_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v1_activity_service_proto_goTypes = []interface{}{ var file_api_v1_activity_service_proto_goTypes = []any{
(*Activity)(nil), // 0: memos.api.v1.Activity (*Activity)(nil), // 0: memos.api.v1.Activity
(*ActivityMemoCommentPayload)(nil), // 1: memos.api.v1.ActivityMemoCommentPayload (*ActivityMemoCommentPayload)(nil), // 1: memos.api.v1.ActivityMemoCommentPayload
(*ActivityVersionUpdatePayload)(nil), // 2: memos.api.v1.ActivityVersionUpdatePayload (*ActivityVersionUpdatePayload)(nil), // 2: memos.api.v1.ActivityVersionUpdatePayload
...@@ -438,7 +438,7 @@ func file_api_v1_activity_service_proto_init() { ...@@ -438,7 +438,7 @@ func file_api_v1_activity_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_activity_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_activity_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Activity); i { switch v := v.(*Activity); i {
case 0: case 0:
return &v.state return &v.state
...@@ -450,7 +450,7 @@ func file_api_v1_activity_service_proto_init() { ...@@ -450,7 +450,7 @@ func file_api_v1_activity_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_activity_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_activity_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ActivityMemoCommentPayload); i { switch v := v.(*ActivityMemoCommentPayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -462,7 +462,7 @@ func file_api_v1_activity_service_proto_init() { ...@@ -462,7 +462,7 @@ func file_api_v1_activity_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_activity_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_activity_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ActivityVersionUpdatePayload); i { switch v := v.(*ActivityVersionUpdatePayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -474,7 +474,7 @@ func file_api_v1_activity_service_proto_init() { ...@@ -474,7 +474,7 @@ func file_api_v1_activity_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_activity_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_activity_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ActivityPayload); i { switch v := v.(*ActivityPayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -486,7 +486,7 @@ func file_api_v1_activity_service_proto_init() { ...@@ -486,7 +486,7 @@ func file_api_v1_activity_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_activity_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_activity_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*GetActivityRequest); i { switch v := v.(*GetActivityRequest); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/auth_service.proto // source: api/v1/auth_service.proto
...@@ -427,7 +427,7 @@ func file_api_v1_auth_service_proto_rawDescGZIP() []byte { ...@@ -427,7 +427,7 @@ func file_api_v1_auth_service_proto_rawDescGZIP() []byte {
} }
var file_api_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_api_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_api_v1_auth_service_proto_goTypes = []interface{}{ var file_api_v1_auth_service_proto_goTypes = []any{
(*GetAuthStatusRequest)(nil), // 0: memos.api.v1.GetAuthStatusRequest (*GetAuthStatusRequest)(nil), // 0: memos.api.v1.GetAuthStatusRequest
(*GetAuthStatusResponse)(nil), // 1: memos.api.v1.GetAuthStatusResponse (*GetAuthStatusResponse)(nil), // 1: memos.api.v1.GetAuthStatusResponse
(*SignInRequest)(nil), // 2: memos.api.v1.SignInRequest (*SignInRequest)(nil), // 2: memos.api.v1.SignInRequest
...@@ -463,7 +463,7 @@ func file_api_v1_auth_service_proto_init() { ...@@ -463,7 +463,7 @@ func file_api_v1_auth_service_proto_init() {
} }
file_api_v1_user_service_proto_init() file_api_v1_user_service_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_auth_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_auth_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*GetAuthStatusRequest); i { switch v := v.(*GetAuthStatusRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -475,7 +475,7 @@ func file_api_v1_auth_service_proto_init() { ...@@ -475,7 +475,7 @@ func file_api_v1_auth_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_auth_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_auth_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*GetAuthStatusResponse); i { switch v := v.(*GetAuthStatusResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -487,7 +487,7 @@ func file_api_v1_auth_service_proto_init() { ...@@ -487,7 +487,7 @@ func file_api_v1_auth_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_auth_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_auth_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*SignInRequest); i { switch v := v.(*SignInRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -499,7 +499,7 @@ func file_api_v1_auth_service_proto_init() { ...@@ -499,7 +499,7 @@ func file_api_v1_auth_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_auth_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_auth_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*SignInWithSSORequest); i { switch v := v.(*SignInWithSSORequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -511,7 +511,7 @@ func file_api_v1_auth_service_proto_init() { ...@@ -511,7 +511,7 @@ func file_api_v1_auth_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_auth_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_auth_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*SignUpRequest); i { switch v := v.(*SignUpRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -523,7 +523,7 @@ func file_api_v1_auth_service_proto_init() { ...@@ -523,7 +523,7 @@ func file_api_v1_auth_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_auth_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_api_v1_auth_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*SignOutRequest); i { switch v := v.(*SignOutRequest); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/common.proto // source: api/v1/common.proto
...@@ -165,7 +165,7 @@ func file_api_v1_common_proto_rawDescGZIP() []byte { ...@@ -165,7 +165,7 @@ func file_api_v1_common_proto_rawDescGZIP() []byte {
var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_api_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_v1_common_proto_goTypes = []interface{}{ var file_api_v1_common_proto_goTypes = []any{
(RowStatus)(0), // 0: memos.api.v1.RowStatus (RowStatus)(0), // 0: memos.api.v1.RowStatus
(*PageToken)(nil), // 1: memos.api.v1.PageToken (*PageToken)(nil), // 1: memos.api.v1.PageToken
} }
...@@ -183,7 +183,7 @@ func file_api_v1_common_proto_init() { ...@@ -183,7 +183,7 @@ func file_api_v1_common_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*PageToken); i { switch v := v.(*PageToken); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/idp_service.proto // source: api/v1/idp_service.proto
...@@ -837,7 +837,7 @@ func file_api_v1_idp_service_proto_rawDescGZIP() []byte { ...@@ -837,7 +837,7 @@ func file_api_v1_idp_service_proto_rawDescGZIP() []byte {
var file_api_v1_idp_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_v1_idp_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_api_v1_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_api_v1_idp_service_proto_goTypes = []interface{}{ var file_api_v1_idp_service_proto_goTypes = []any{
(IdentityProvider_Type)(0), // 0: memos.api.v1.IdentityProvider.Type (IdentityProvider_Type)(0), // 0: memos.api.v1.IdentityProvider.Type
(*IdentityProvider)(nil), // 1: memos.api.v1.IdentityProvider (*IdentityProvider)(nil), // 1: memos.api.v1.IdentityProvider
(*IdentityProviderConfig)(nil), // 2: memos.api.v1.IdentityProviderConfig (*IdentityProviderConfig)(nil), // 2: memos.api.v1.IdentityProviderConfig
...@@ -884,7 +884,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -884,7 +884,7 @@ func file_api_v1_idp_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_idp_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*IdentityProvider); i { switch v := v.(*IdentityProvider); i {
case 0: case 0:
return &v.state return &v.state
...@@ -896,7 +896,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -896,7 +896,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*IdentityProviderConfig); i { switch v := v.(*IdentityProviderConfig); i {
case 0: case 0:
return &v.state return &v.state
...@@ -908,7 +908,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -908,7 +908,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*FieldMapping); i { switch v := v.(*FieldMapping); i {
case 0: case 0:
return &v.state return &v.state
...@@ -920,7 +920,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -920,7 +920,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*OAuth2Config); i { switch v := v.(*OAuth2Config); i {
case 0: case 0:
return &v.state return &v.state
...@@ -932,7 +932,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -932,7 +932,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ListIdentityProvidersRequest); i { switch v := v.(*ListIdentityProvidersRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -944,7 +944,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -944,7 +944,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*ListIdentityProvidersResponse); i { switch v := v.(*ListIdentityProvidersResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -956,7 +956,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -956,7 +956,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*GetIdentityProviderRequest); i { switch v := v.(*GetIdentityProviderRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -968,7 +968,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -968,7 +968,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*CreateIdentityProviderRequest); i { switch v := v.(*CreateIdentityProviderRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -980,7 +980,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -980,7 +980,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*UpdateIdentityProviderRequest); i { switch v := v.(*UpdateIdentityProviderRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -992,7 +992,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -992,7 +992,7 @@ func file_api_v1_idp_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_idp_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_api_v1_idp_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*DeleteIdentityProviderRequest); i { switch v := v.(*DeleteIdentityProviderRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1005,7 +1005,7 @@ func file_api_v1_idp_service_proto_init() { ...@@ -1005,7 +1005,7 @@ func file_api_v1_idp_service_proto_init() {
} }
} }
} }
file_api_v1_idp_service_proto_msgTypes[1].OneofWrappers = []interface{}{ file_api_v1_idp_service_proto_msgTypes[1].OneofWrappers = []any{
(*IdentityProviderConfig_Oauth2Config)(nil), (*IdentityProviderConfig_Oauth2Config)(nil),
} }
type x struct{} type x struct{}
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/inbox_service.proto // source: api/v1/inbox_service.proto
...@@ -530,7 +530,7 @@ func file_api_v1_inbox_service_proto_rawDescGZIP() []byte { ...@@ -530,7 +530,7 @@ func file_api_v1_inbox_service_proto_rawDescGZIP() []byte {
var file_api_v1_inbox_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_api_v1_inbox_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_api_v1_inbox_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_api_v1_inbox_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v1_inbox_service_proto_goTypes = []interface{}{ var file_api_v1_inbox_service_proto_goTypes = []any{
(Inbox_Status)(0), // 0: memos.api.v1.Inbox.Status (Inbox_Status)(0), // 0: memos.api.v1.Inbox.Status
(Inbox_Type)(0), // 1: memos.api.v1.Inbox.Type (Inbox_Type)(0), // 1: memos.api.v1.Inbox.Type
(*Inbox)(nil), // 2: memos.api.v1.Inbox (*Inbox)(nil), // 2: memos.api.v1.Inbox
...@@ -568,7 +568,7 @@ func file_api_v1_inbox_service_proto_init() { ...@@ -568,7 +568,7 @@ func file_api_v1_inbox_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_inbox_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_inbox_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Inbox); i { switch v := v.(*Inbox); i {
case 0: case 0:
return &v.state return &v.state
...@@ -580,7 +580,7 @@ func file_api_v1_inbox_service_proto_init() { ...@@ -580,7 +580,7 @@ func file_api_v1_inbox_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_inbox_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_inbox_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListInboxesRequest); i { switch v := v.(*ListInboxesRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -592,7 +592,7 @@ func file_api_v1_inbox_service_proto_init() { ...@@ -592,7 +592,7 @@ func file_api_v1_inbox_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_inbox_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_inbox_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListInboxesResponse); i { switch v := v.(*ListInboxesResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -604,7 +604,7 @@ func file_api_v1_inbox_service_proto_init() { ...@@ -604,7 +604,7 @@ func file_api_v1_inbox_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_inbox_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_inbox_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*UpdateInboxRequest); i { switch v := v.(*UpdateInboxRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -616,7 +616,7 @@ func file_api_v1_inbox_service_proto_init() { ...@@ -616,7 +616,7 @@ func file_api_v1_inbox_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_inbox_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_inbox_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*DeleteInboxRequest); i { switch v := v.(*DeleteInboxRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -629,7 +629,7 @@ func file_api_v1_inbox_service_proto_init() { ...@@ -629,7 +629,7 @@ func file_api_v1_inbox_service_proto_init() {
} }
} }
} }
file_api_v1_inbox_service_proto_msgTypes[0].OneofWrappers = []interface{}{} file_api_v1_inbox_service_proto_msgTypes[0].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
......
This diff is collapsed.
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/memo_relation_service.proto // source: api/v1/memo_relation_service.proto
...@@ -182,7 +182,7 @@ func file_api_v1_memo_relation_service_proto_rawDescGZIP() []byte { ...@@ -182,7 +182,7 @@ func file_api_v1_memo_relation_service_proto_rawDescGZIP() []byte {
var file_api_v1_memo_relation_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_v1_memo_relation_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_memo_relation_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_api_v1_memo_relation_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_v1_memo_relation_service_proto_goTypes = []interface{}{ var file_api_v1_memo_relation_service_proto_goTypes = []any{
(MemoRelation_Type)(0), // 0: memos.api.v1.MemoRelation.Type (MemoRelation_Type)(0), // 0: memos.api.v1.MemoRelation.Type
(*MemoRelation)(nil), // 1: memos.api.v1.MemoRelation (*MemoRelation)(nil), // 1: memos.api.v1.MemoRelation
} }
...@@ -201,7 +201,7 @@ func file_api_v1_memo_relation_service_proto_init() { ...@@ -201,7 +201,7 @@ func file_api_v1_memo_relation_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_memo_relation_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_memo_relation_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*MemoRelation); i { switch v := v.(*MemoRelation); i {
case 0: case 0:
return &v.state return &v.state
......
This diff is collapsed.
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/reaction_service.proto // source: api/v1/reaction_service.proto
...@@ -228,7 +228,7 @@ func file_api_v1_reaction_service_proto_rawDescGZIP() []byte { ...@@ -228,7 +228,7 @@ func file_api_v1_reaction_service_proto_rawDescGZIP() []byte {
var file_api_v1_reaction_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_v1_reaction_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_reaction_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_api_v1_reaction_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_api_v1_reaction_service_proto_goTypes = []interface{}{ var file_api_v1_reaction_service_proto_goTypes = []any{
(Reaction_Type)(0), // 0: memos.api.v1.Reaction.Type (Reaction_Type)(0), // 0: memos.api.v1.Reaction.Type
(*Reaction)(nil), // 1: memos.api.v1.Reaction (*Reaction)(nil), // 1: memos.api.v1.Reaction
} }
...@@ -247,7 +247,7 @@ func file_api_v1_reaction_service_proto_init() { ...@@ -247,7 +247,7 @@ func file_api_v1_reaction_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_reaction_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_reaction_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Reaction); i { switch v := v.(*Reaction); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/resource_service.proto // source: api/v1/resource_service.proto
...@@ -742,7 +742,7 @@ func file_api_v1_resource_service_proto_rawDescGZIP() []byte { ...@@ -742,7 +742,7 @@ func file_api_v1_resource_service_proto_rawDescGZIP() []byte {
} }
var file_api_v1_resource_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_api_v1_resource_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_api_v1_resource_service_proto_goTypes = []interface{}{ var file_api_v1_resource_service_proto_goTypes = []any{
(*Resource)(nil), // 0: memos.api.v1.Resource (*Resource)(nil), // 0: memos.api.v1.Resource
(*CreateResourceRequest)(nil), // 1: memos.api.v1.CreateResourceRequest (*CreateResourceRequest)(nil), // 1: memos.api.v1.CreateResourceRequest
(*ListResourcesRequest)(nil), // 2: memos.api.v1.ListResourcesRequest (*ListResourcesRequest)(nil), // 2: memos.api.v1.ListResourcesRequest
...@@ -792,7 +792,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -792,7 +792,7 @@ func file_api_v1_resource_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_resource_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Resource); i { switch v := v.(*Resource); i {
case 0: case 0:
return &v.state return &v.state
...@@ -804,7 +804,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -804,7 +804,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*CreateResourceRequest); i { switch v := v.(*CreateResourceRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -816,7 +816,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -816,7 +816,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListResourcesRequest); i { switch v := v.(*ListResourcesRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -828,7 +828,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -828,7 +828,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ListResourcesResponse); i { switch v := v.(*ListResourcesResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -840,7 +840,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -840,7 +840,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*SearchResourcesRequest); i { switch v := v.(*SearchResourcesRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -852,7 +852,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -852,7 +852,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*SearchResourcesResponse); i { switch v := v.(*SearchResourcesResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -864,7 +864,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -864,7 +864,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*GetResourceRequest); i { switch v := v.(*GetResourceRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -876,7 +876,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -876,7 +876,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*GetResourceBinaryRequest); i { switch v := v.(*GetResourceBinaryRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -888,7 +888,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -888,7 +888,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*UpdateResourceRequest); i { switch v := v.(*UpdateResourceRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -900,7 +900,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -900,7 +900,7 @@ func file_api_v1_resource_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_resource_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_api_v1_resource_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*DeleteResourceRequest); i { switch v := v.(*DeleteResourceRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -913,7 +913,7 @@ func file_api_v1_resource_service_proto_init() { ...@@ -913,7 +913,7 @@ func file_api_v1_resource_service_proto_init() {
} }
} }
} }
file_api_v1_resource_service_proto_msgTypes[0].OneofWrappers = []interface{}{} file_api_v1_resource_service_proto_msgTypes[0].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/user_service.proto // source: api/v1/user_service.proto
...@@ -1397,7 +1397,7 @@ func file_api_v1_user_service_proto_rawDescGZIP() []byte { ...@@ -1397,7 +1397,7 @@ func file_api_v1_user_service_proto_rawDescGZIP() []byte {
var file_api_v1_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_api_v1_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_v1_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_api_v1_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
var file_api_v1_user_service_proto_goTypes = []interface{}{ var file_api_v1_user_service_proto_goTypes = []any{
(User_Role)(0), // 0: memos.api.v1.User.Role (User_Role)(0), // 0: memos.api.v1.User.Role
(*User)(nil), // 1: memos.api.v1.User (*User)(nil), // 1: memos.api.v1.User
(*ListUsersRequest)(nil), // 2: memos.api.v1.ListUsersRequest (*ListUsersRequest)(nil), // 2: memos.api.v1.ListUsersRequest
...@@ -1478,7 +1478,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1478,7 +1478,7 @@ func file_api_v1_user_service_proto_init() {
} }
file_api_v1_common_proto_init() file_api_v1_common_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_user_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*User); i { switch v := v.(*User); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1490,7 +1490,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1490,7 +1490,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListUsersRequest); i { switch v := v.(*ListUsersRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1502,7 +1502,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1502,7 +1502,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListUsersResponse); i { switch v := v.(*ListUsersResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1514,7 +1514,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1514,7 +1514,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*SearchUsersRequest); i { switch v := v.(*SearchUsersRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1526,7 +1526,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1526,7 +1526,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*SearchUsersResponse); i { switch v := v.(*SearchUsersResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1538,7 +1538,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1538,7 +1538,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*GetUserRequest); i { switch v := v.(*GetUserRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1550,7 +1550,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1550,7 +1550,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*GetUserAvatarBinaryRequest); i { switch v := v.(*GetUserAvatarBinaryRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1562,7 +1562,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1562,7 +1562,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*CreateUserRequest); i { switch v := v.(*CreateUserRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1574,7 +1574,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1574,7 +1574,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*UpdateUserRequest); i { switch v := v.(*UpdateUserRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1586,7 +1586,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1586,7 +1586,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*DeleteUserRequest); i { switch v := v.(*DeleteUserRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1598,7 +1598,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1598,7 +1598,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*UserSetting); i { switch v := v.(*UserSetting); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1610,7 +1610,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1610,7 +1610,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*GetUserSettingRequest); i { switch v := v.(*GetUserSettingRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1622,7 +1622,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1622,7 +1622,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*UpdateUserSettingRequest); i { switch v := v.(*UpdateUserSettingRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1634,7 +1634,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1634,7 +1634,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*UserAccessToken); i { switch v := v.(*UserAccessToken); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1646,7 +1646,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1646,7 +1646,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*ListUserAccessTokensRequest); i { switch v := v.(*ListUserAccessTokensRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1658,7 +1658,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1658,7 +1658,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[15].Exporter = func(v any, i int) any {
switch v := v.(*ListUserAccessTokensResponse); i { switch v := v.(*ListUserAccessTokensResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1670,7 +1670,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1670,7 +1670,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[16].Exporter = func(v any, i int) any {
switch v := v.(*CreateUserAccessTokenRequest); i { switch v := v.(*CreateUserAccessTokenRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1682,7 +1682,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1682,7 +1682,7 @@ func file_api_v1_user_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_user_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { file_api_v1_user_service_proto_msgTypes[17].Exporter = func(v any, i int) any {
switch v := v.(*DeleteUserAccessTokenRequest); i { switch v := v.(*DeleteUserAccessTokenRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -1695,7 +1695,7 @@ func file_api_v1_user_service_proto_init() { ...@@ -1695,7 +1695,7 @@ func file_api_v1_user_service_proto_init() {
} }
} }
} }
file_api_v1_user_service_proto_msgTypes[16].OneofWrappers = []interface{}{} file_api_v1_user_service_proto_msgTypes[16].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/webhook_service.proto // source: api/v1/webhook_service.proto
...@@ -634,7 +634,7 @@ func file_api_v1_webhook_service_proto_rawDescGZIP() []byte { ...@@ -634,7 +634,7 @@ func file_api_v1_webhook_service_proto_rawDescGZIP() []byte {
} }
var file_api_v1_webhook_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_api_v1_webhook_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_api_v1_webhook_service_proto_goTypes = []interface{}{ var file_api_v1_webhook_service_proto_goTypes = []any{
(*Webhook)(nil), // 0: memos.api.v1.Webhook (*Webhook)(nil), // 0: memos.api.v1.Webhook
(*CreateWebhookRequest)(nil), // 1: memos.api.v1.CreateWebhookRequest (*CreateWebhookRequest)(nil), // 1: memos.api.v1.CreateWebhookRequest
(*GetWebhookRequest)(nil), // 2: memos.api.v1.GetWebhookRequest (*GetWebhookRequest)(nil), // 2: memos.api.v1.GetWebhookRequest
...@@ -683,7 +683,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -683,7 +683,7 @@ func file_api_v1_webhook_service_proto_init() {
file_api_v1_common_proto_init() file_api_v1_common_proto_init()
file_api_v1_memo_service_proto_init() file_api_v1_memo_service_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_webhook_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Webhook); i { switch v := v.(*Webhook); i {
case 0: case 0:
return &v.state return &v.state
...@@ -695,7 +695,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -695,7 +695,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*CreateWebhookRequest); i { switch v := v.(*CreateWebhookRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -707,7 +707,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -707,7 +707,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*GetWebhookRequest); i { switch v := v.(*GetWebhookRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -719,7 +719,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -719,7 +719,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ListWebhooksRequest); i { switch v := v.(*ListWebhooksRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -731,7 +731,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -731,7 +731,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ListWebhooksResponse); i { switch v := v.(*ListWebhooksResponse); i {
case 0: case 0:
return &v.state return &v.state
...@@ -743,7 +743,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -743,7 +743,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*UpdateWebhookRequest); i { switch v := v.(*UpdateWebhookRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -755,7 +755,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -755,7 +755,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*DeleteWebhookRequest); i { switch v := v.(*DeleteWebhookRequest); i {
case 0: case 0:
return &v.state return &v.state
...@@ -767,7 +767,7 @@ func file_api_v1_webhook_service_proto_init() { ...@@ -767,7 +767,7 @@ func file_api_v1_webhook_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_webhook_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_api_v1_webhook_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*WebhookRequestPayload); i { switch v := v.(*WebhookRequestPayload); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: api/v1/workspace_service.proto // source: api/v1/workspace_service.proto
...@@ -33,6 +33,8 @@ type WorkspaceProfile struct { ...@@ -33,6 +33,8 @@ type WorkspaceProfile struct {
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
// mode is the instance mode (e.g. "prod", "dev" or "demo"). // mode is the instance mode (e.g. "prod", "dev" or "demo").
Mode string `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"` Mode string `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"`
// public is a flag that the instance is open for other users.
Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"`
} }
func (x *WorkspaceProfile) Reset() { func (x *WorkspaceProfile) Reset() {
...@@ -88,6 +90,13 @@ func (x *WorkspaceProfile) GetMode() string { ...@@ -88,6 +90,13 @@ func (x *WorkspaceProfile) GetMode() string {
return "" return ""
} }
func (x *WorkspaceProfile) GetPublic() bool {
if x != nil {
return x.Public
}
return false
}
type GetWorkspaceProfileRequest struct { type GetWorkspaceProfileRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
...@@ -133,36 +142,37 @@ var file_api_v1_workspace_service_proto_rawDesc = []byte{ ...@@ -133,36 +142,37 @@ var file_api_v1_workspace_service_proto_rawDesc = []byte{
0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x1a, 0x1c,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x10, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6e, 0x0a, 0x10,
0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6d, 0x6f, 0x64, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x04,
0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x1c, 0x0a, 0x1a,
0x73, 0x74, 0x32, 0x97, 0x01, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x57, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x97, 0x01, 0x0a, 0x10, 0x57,
0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x82, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31,
0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c,
0x70, 0x61, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x42, 0xad, 0x01, 0x0a, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2f, 0x70, 0x72, 0x6f,
0x31, 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x66, 0x69, 0x6c, 0x65, 0x42, 0xad, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d,
0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x15, 0x57, 0x6f, 0x72, 0x6b, 0x73,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72,
0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61,
0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d,
0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f,
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x6f, 0x74, 0x6f, 0x33, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69,
0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
...@@ -178,7 +188,7 @@ func file_api_v1_workspace_service_proto_rawDescGZIP() []byte { ...@@ -178,7 +188,7 @@ func file_api_v1_workspace_service_proto_rawDescGZIP() []byte {
} }
var file_api_v1_workspace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_api_v1_workspace_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_v1_workspace_service_proto_goTypes = []interface{}{ var file_api_v1_workspace_service_proto_goTypes = []any{
(*WorkspaceProfile)(nil), // 0: memos.api.v1.WorkspaceProfile (*WorkspaceProfile)(nil), // 0: memos.api.v1.WorkspaceProfile
(*GetWorkspaceProfileRequest)(nil), // 1: memos.api.v1.GetWorkspaceProfileRequest (*GetWorkspaceProfileRequest)(nil), // 1: memos.api.v1.GetWorkspaceProfileRequest
} }
...@@ -198,7 +208,7 @@ func file_api_v1_workspace_service_proto_init() { ...@@ -198,7 +208,7 @@ func file_api_v1_workspace_service_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_api_v1_workspace_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_api_v1_workspace_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*WorkspaceProfile); i { switch v := v.(*WorkspaceProfile); i {
case 0: case 0:
return &v.state return &v.state
...@@ -210,7 +220,7 @@ func file_api_v1_workspace_service_proto_init() { ...@@ -210,7 +220,7 @@ func file_api_v1_workspace_service_proto_init() {
return nil return nil
} }
} }
file_api_v1_workspace_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_api_v1_workspace_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*GetWorkspaceProfileRequest); i { switch v := v.(*GetWorkspaceProfileRequest); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/activity.proto // source: store/activity.proto
...@@ -229,7 +229,7 @@ func file_store_activity_proto_rawDescGZIP() []byte { ...@@ -229,7 +229,7 @@ func file_store_activity_proto_rawDescGZIP() []byte {
} }
var file_store_activity_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_store_activity_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_store_activity_proto_goTypes = []interface{}{ var file_store_activity_proto_goTypes = []any{
(*ActivityMemoCommentPayload)(nil), // 0: memos.store.ActivityMemoCommentPayload (*ActivityMemoCommentPayload)(nil), // 0: memos.store.ActivityMemoCommentPayload
(*ActivityVersionUpdatePayload)(nil), // 1: memos.store.ActivityVersionUpdatePayload (*ActivityVersionUpdatePayload)(nil), // 1: memos.store.ActivityVersionUpdatePayload
(*ActivityPayload)(nil), // 2: memos.store.ActivityPayload (*ActivityPayload)(nil), // 2: memos.store.ActivityPayload
...@@ -250,7 +250,7 @@ func file_store_activity_proto_init() { ...@@ -250,7 +250,7 @@ func file_store_activity_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_store_activity_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_store_activity_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*ActivityMemoCommentPayload); i { switch v := v.(*ActivityMemoCommentPayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -262,7 +262,7 @@ func file_store_activity_proto_init() { ...@@ -262,7 +262,7 @@ func file_store_activity_proto_init() {
return nil return nil
} }
} }
file_store_activity_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_store_activity_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ActivityVersionUpdatePayload); i { switch v := v.(*ActivityVersionUpdatePayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -274,7 +274,7 @@ func file_store_activity_proto_init() { ...@@ -274,7 +274,7 @@ func file_store_activity_proto_init() {
return nil return nil
} }
} }
file_store_activity_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_store_activity_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ActivityPayload); i { switch v := v.(*ActivityPayload); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/idp.proto // source: store/idp.proto
...@@ -447,7 +447,7 @@ func file_store_idp_proto_rawDescGZIP() []byte { ...@@ -447,7 +447,7 @@ func file_store_idp_proto_rawDescGZIP() []byte {
var file_store_idp_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_store_idp_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_store_idp_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_store_idp_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_store_idp_proto_goTypes = []interface{}{ var file_store_idp_proto_goTypes = []any{
(IdentityProvider_Type)(0), // 0: memos.store.IdentityProvider.Type (IdentityProvider_Type)(0), // 0: memos.store.IdentityProvider.Type
(*IdentityProvider)(nil), // 1: memos.store.IdentityProvider (*IdentityProvider)(nil), // 1: memos.store.IdentityProvider
(*IdentityProviderConfig)(nil), // 2: memos.store.IdentityProviderConfig (*IdentityProviderConfig)(nil), // 2: memos.store.IdentityProviderConfig
...@@ -472,7 +472,7 @@ func file_store_idp_proto_init() { ...@@ -472,7 +472,7 @@ func file_store_idp_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_store_idp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_store_idp_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*IdentityProvider); i { switch v := v.(*IdentityProvider); i {
case 0: case 0:
return &v.state return &v.state
...@@ -484,7 +484,7 @@ func file_store_idp_proto_init() { ...@@ -484,7 +484,7 @@ func file_store_idp_proto_init() {
return nil return nil
} }
} }
file_store_idp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_store_idp_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*IdentityProviderConfig); i { switch v := v.(*IdentityProviderConfig); i {
case 0: case 0:
return &v.state return &v.state
...@@ -496,7 +496,7 @@ func file_store_idp_proto_init() { ...@@ -496,7 +496,7 @@ func file_store_idp_proto_init() {
return nil return nil
} }
} }
file_store_idp_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_store_idp_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*FieldMapping); i { switch v := v.(*FieldMapping); i {
case 0: case 0:
return &v.state return &v.state
...@@ -508,7 +508,7 @@ func file_store_idp_proto_init() { ...@@ -508,7 +508,7 @@ func file_store_idp_proto_init() {
return nil return nil
} }
} }
file_store_idp_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_store_idp_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*OAuth2Config); i { switch v := v.(*OAuth2Config); i {
case 0: case 0:
return &v.state return &v.state
...@@ -521,7 +521,7 @@ func file_store_idp_proto_init() { ...@@ -521,7 +521,7 @@ func file_store_idp_proto_init() {
} }
} }
} }
file_store_idp_proto_msgTypes[1].OneofWrappers = []interface{}{ file_store_idp_proto_msgTypes[1].OneofWrappers = []any{
(*IdentityProviderConfig_Oauth2Config)(nil), (*IdentityProviderConfig_Oauth2Config)(nil),
} }
type x struct{} type x struct{}
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/inbox.proto // source: store/inbox.proto
...@@ -167,7 +167,7 @@ func file_store_inbox_proto_rawDescGZIP() []byte { ...@@ -167,7 +167,7 @@ func file_store_inbox_proto_rawDescGZIP() []byte {
var file_store_inbox_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_store_inbox_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_store_inbox_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_store_inbox_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_store_inbox_proto_goTypes = []interface{}{ var file_store_inbox_proto_goTypes = []any{
(InboxMessage_Type)(0), // 0: memos.store.InboxMessage.Type (InboxMessage_Type)(0), // 0: memos.store.InboxMessage.Type
(*InboxMessage)(nil), // 1: memos.store.InboxMessage (*InboxMessage)(nil), // 1: memos.store.InboxMessage
} }
...@@ -186,7 +186,7 @@ func file_store_inbox_proto_init() { ...@@ -186,7 +186,7 @@ func file_store_inbox_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_store_inbox_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_store_inbox_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*InboxMessage); i { switch v := v.(*InboxMessage); i {
case 0: case 0:
return &v.state return &v.state
...@@ -199,7 +199,7 @@ func file_store_inbox_proto_init() { ...@@ -199,7 +199,7 @@ func file_store_inbox_proto_init() {
} }
} }
} }
file_store_inbox_proto_msgTypes[0].OneofWrappers = []interface{}{} file_store_inbox_proto_msgTypes[0].OneofWrappers = []any{}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/memo.proto // source: store/memo.proto
...@@ -193,7 +193,7 @@ func file_store_memo_proto_rawDescGZIP() []byte { ...@@ -193,7 +193,7 @@ func file_store_memo_proto_rawDescGZIP() []byte {
} }
var file_store_memo_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_store_memo_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_store_memo_proto_goTypes = []interface{}{ var file_store_memo_proto_goTypes = []any{
(*MemoPayload)(nil), // 0: memos.store.MemoPayload (*MemoPayload)(nil), // 0: memos.store.MemoPayload
(*MemoPayload_Property)(nil), // 1: memos.store.MemoPayload.Property (*MemoPayload_Property)(nil), // 1: memos.store.MemoPayload.Property
} }
...@@ -212,7 +212,7 @@ func file_store_memo_proto_init() { ...@@ -212,7 +212,7 @@ func file_store_memo_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_store_memo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_store_memo_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*MemoPayload); i { switch v := v.(*MemoPayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -224,7 +224,7 @@ func file_store_memo_proto_init() { ...@@ -224,7 +224,7 @@ func file_store_memo_proto_init() {
return nil return nil
} }
} }
file_store_memo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_store_memo_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*MemoPayload_Property); i { switch v := v.(*MemoPayload_Property); i {
case 0: case 0:
return &v.state return &v.state
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/reaction.proto // source: store/reaction.proto
...@@ -144,7 +144,7 @@ func file_store_reaction_proto_rawDescGZIP() []byte { ...@@ -144,7 +144,7 @@ func file_store_reaction_proto_rawDescGZIP() []byte {
} }
var file_store_reaction_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_store_reaction_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_store_reaction_proto_goTypes = []interface{}{ var file_store_reaction_proto_goTypes = []any{
(ReactionType)(0), // 0: memos.store.ReactionType (ReactionType)(0), // 0: memos.store.ReactionType
} }
var file_store_reaction_proto_depIdxs = []int32{ var file_store_reaction_proto_depIdxs = []int32{
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/resource.proto // source: store/resource.proto
...@@ -264,7 +264,7 @@ func file_store_resource_proto_rawDescGZIP() []byte { ...@@ -264,7 +264,7 @@ func file_store_resource_proto_rawDescGZIP() []byte {
var file_store_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_store_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_store_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_store_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_store_resource_proto_goTypes = []interface{}{ var file_store_resource_proto_goTypes = []any{
(ResourceStorageType)(0), // 0: memos.store.ResourceStorageType (ResourceStorageType)(0), // 0: memos.store.ResourceStorageType
(*ResourcePayload)(nil), // 1: memos.store.ResourcePayload (*ResourcePayload)(nil), // 1: memos.store.ResourcePayload
(*ResourcePayload_S3Object)(nil), // 2: memos.store.ResourcePayload.S3Object (*ResourcePayload_S3Object)(nil), // 2: memos.store.ResourcePayload.S3Object
...@@ -289,7 +289,7 @@ func file_store_resource_proto_init() { ...@@ -289,7 +289,7 @@ func file_store_resource_proto_init() {
} }
file_store_workspace_setting_proto_init() file_store_workspace_setting_proto_init()
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_store_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_store_resource_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*ResourcePayload); i { switch v := v.(*ResourcePayload); i {
case 0: case 0:
return &v.state return &v.state
...@@ -301,7 +301,7 @@ func file_store_resource_proto_init() { ...@@ -301,7 +301,7 @@ func file_store_resource_proto_init() {
return nil return nil
} }
} }
file_store_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_store_resource_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ResourcePayload_S3Object); i { switch v := v.(*ResourcePayload_S3Object); i {
case 0: case 0:
return &v.state return &v.state
...@@ -314,7 +314,7 @@ func file_store_resource_proto_init() { ...@@ -314,7 +314,7 @@ func file_store_resource_proto_init() {
} }
} }
} }
file_store_resource_proto_msgTypes[0].OneofWrappers = []interface{}{ file_store_resource_proto_msgTypes[0].OneofWrappers = []any{
(*ResourcePayload_S3Object_)(nil), (*ResourcePayload_S3Object_)(nil),
} }
type x struct{} type x struct{}
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.34.1 // protoc-gen-go v1.34.2
// protoc (unknown) // protoc (unknown)
// source: store/user_setting.proto // source: store/user_setting.proto
...@@ -379,7 +379,7 @@ func file_store_user_setting_proto_rawDescGZIP() []byte { ...@@ -379,7 +379,7 @@ func file_store_user_setting_proto_rawDescGZIP() []byte {
var file_store_user_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_store_user_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_store_user_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_store_user_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_store_user_setting_proto_goTypes = []interface{}{ var file_store_user_setting_proto_goTypes = []any{
(UserSettingKey)(0), // 0: memos.store.UserSettingKey (UserSettingKey)(0), // 0: memos.store.UserSettingKey
(*UserSetting)(nil), // 1: memos.store.UserSetting (*UserSetting)(nil), // 1: memos.store.UserSetting
(*AccessTokensUserSetting)(nil), // 2: memos.store.AccessTokensUserSetting (*AccessTokensUserSetting)(nil), // 2: memos.store.AccessTokensUserSetting
...@@ -402,7 +402,7 @@ func file_store_user_setting_proto_init() { ...@@ -402,7 +402,7 @@ func file_store_user_setting_proto_init() {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_store_user_setting_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_store_user_setting_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*UserSetting); i { switch v := v.(*UserSetting); i {
case 0: case 0:
return &v.state return &v.state
...@@ -414,7 +414,7 @@ func file_store_user_setting_proto_init() { ...@@ -414,7 +414,7 @@ func file_store_user_setting_proto_init() {
return nil return nil
} }
} }
file_store_user_setting_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_store_user_setting_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*AccessTokensUserSetting); i { switch v := v.(*AccessTokensUserSetting); i {
case 0: case 0:
return &v.state return &v.state
...@@ -426,7 +426,7 @@ func file_store_user_setting_proto_init() { ...@@ -426,7 +426,7 @@ func file_store_user_setting_proto_init() {
return nil return nil
} }
} }
file_store_user_setting_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_store_user_setting_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*AccessTokensUserSetting_AccessToken); i { switch v := v.(*AccessTokensUserSetting_AccessToken); i {
case 0: case 0:
return &v.state return &v.state
...@@ -439,7 +439,7 @@ func file_store_user_setting_proto_init() { ...@@ -439,7 +439,7 @@ func file_store_user_setting_proto_init() {
} }
} }
} }
file_store_user_setting_proto_msgTypes[0].OneofWrappers = []interface{}{ file_store_user_setting_proto_msgTypes[0].OneofWrappers = []any{
(*UserSetting_AccessTokens)(nil), (*UserSetting_AccessTokens)(nil),
(*UserSetting_Locale)(nil), (*UserSetting_Locale)(nil),
(*UserSetting_Appearance)(nil), (*UserSetting_Appearance)(nil),
......
This diff is collapsed.
...@@ -31,10 +31,6 @@ message WorkspaceBasicSetting { ...@@ -31,10 +31,6 @@ message WorkspaceBasicSetting {
} }
message WorkspaceGeneralSetting { message WorkspaceGeneralSetting {
// disallow_signup is the flag to disallow signup.
bool disallow_signup = 1;
// disallow_password_login is the flag to disallow password login.
bool disallow_password_login = 2;
// additional_script is the additional script. // additional_script is the additional script.
string additional_script = 3; string additional_script = 3;
// additional_style is the additional style. // additional_style is the additional style.
......
...@@ -30,6 +30,8 @@ type Profile struct { ...@@ -30,6 +30,8 @@ type Profile struct {
Driver string `json:"-"` Driver string `json:"-"`
// Version is the current version of server // Version is the current version of server
Version string `json:"version"` Version string `json:"version"`
// Pubic is the flag whether the instance is public for others.
Public bool `json:"public"`
} }
func (p *Profile) IsDev() bool { func (p *Profile) IsDev() bool {
......
...@@ -167,11 +167,7 @@ func (s *APIV1Service) doSignIn(ctx context.Context, user *store.User, expireTim ...@@ -167,11 +167,7 @@ func (s *APIV1Service) doSignIn(ctx context.Context, user *store.User, expireTim
} }
func (s *APIV1Service) SignUp(ctx context.Context, request *v1pb.SignUpRequest) (*v1pb.User, error) { func (s *APIV1Service) SignUp(ctx context.Context, request *v1pb.SignUpRequest) (*v1pb.User, error) {
workspaceGeneralSetting, err := s.Store.GetWorkspaceGeneralSetting(ctx) if !s.Profile.Public {
if err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get workspace setting, err: %s", err))
}
if workspaceGeneralSetting.DisallowSignup || workspaceGeneralSetting.DisallowPasswordLogin {
return nil, status.Errorf(codes.PermissionDenied, "sign up is not allowed") return nil, status.Errorf(codes.PermissionDenied, "sign up is not allowed")
} }
......
...@@ -15,6 +15,7 @@ func (s *APIV1Service) GetWorkspaceProfile(ctx context.Context, _ *v1pb.GetWorks ...@@ -15,6 +15,7 @@ func (s *APIV1Service) GetWorkspaceProfile(ctx context.Context, _ *v1pb.GetWorks
workspaceProfile := &v1pb.WorkspaceProfile{ workspaceProfile := &v1pb.WorkspaceProfile{
Version: s.Profile.Version, Version: s.Profile.Version,
Mode: s.Profile.Mode, Mode: s.Profile.Mode,
Public: s.Profile.Public,
} }
owner, err := s.GetInstanceOwner(ctx) owner, err := s.GetInstanceOwner(ctx)
if err != nil { if err != nil {
......
...@@ -132,10 +132,8 @@ func convertWorkspaceGeneralSettingFromStore(setting *storepb.WorkspaceGeneralSe ...@@ -132,10 +132,8 @@ func convertWorkspaceGeneralSettingFromStore(setting *storepb.WorkspaceGeneralSe
return nil return nil
} }
generalSetting := &v1pb.WorkspaceGeneralSetting{ generalSetting := &v1pb.WorkspaceGeneralSetting{
DisallowSignup: setting.DisallowSignup, AdditionalScript: setting.AdditionalScript,
DisallowPasswordLogin: setting.DisallowPasswordLogin, AdditionalStyle: setting.AdditionalStyle,
AdditionalScript: setting.AdditionalScript,
AdditionalStyle: setting.AdditionalStyle,
} }
if setting.CustomProfile != nil { if setting.CustomProfile != nil {
generalSetting.CustomProfile = &v1pb.WorkspaceCustomProfile{ generalSetting.CustomProfile = &v1pb.WorkspaceCustomProfile{
...@@ -154,10 +152,8 @@ func convertWorkspaceGeneralSettingToStore(setting *v1pb.WorkspaceGeneralSetting ...@@ -154,10 +152,8 @@ func convertWorkspaceGeneralSettingToStore(setting *v1pb.WorkspaceGeneralSetting
return nil return nil
} }
generalSetting := &storepb.WorkspaceGeneralSetting{ generalSetting := &storepb.WorkspaceGeneralSetting{
DisallowSignup: setting.DisallowSignup, AdditionalScript: setting.AdditionalScript,
DisallowPasswordLogin: setting.DisallowPasswordLogin, AdditionalStyle: setting.AdditionalStyle,
AdditionalScript: setting.AdditionalScript,
AdditionalStyle: setting.AdditionalStyle,
} }
if setting.CustomProfile != nil { if setting.CustomProfile != nil {
generalSetting.CustomProfile = &storepb.WorkspaceCustomProfile{ generalSetting.CustomProfile = &storepb.WorkspaceCustomProfile{
......
...@@ -17,7 +17,7 @@ func TestWorkspaceSettingV1Store(t *testing.T) { ...@@ -17,7 +17,7 @@ func TestWorkspaceSettingV1Store(t *testing.T) {
Key: storepb.WorkspaceSettingKey_GENERAL, Key: storepb.WorkspaceSettingKey_GENERAL,
Value: &storepb.WorkspaceSetting_GeneralSetting{ Value: &storepb.WorkspaceSetting_GeneralSetting{
GeneralSetting: &storepb.WorkspaceGeneralSetting{ GeneralSetting: &storepb.WorkspaceGeneralSetting{
DisallowSignup: true, AdditionalScript: "",
}, },
}, },
}) })
......
import { Button, IconButton, Input } from "@mui/joy";
import { useState } from "react";
import { toast } from "react-hot-toast";
import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
import { WorkspaceGeneralSetting } from "@/types/proto/api/v1/workspace_setting_service";
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
import { useTranslate } from "@/utils/i18n";
import { generateDialog } from "./Dialog";
import Icon from "./Icon";
type Props = DialogProps;
interface State {
disablePasswordLogin: boolean;
}
const DisablePasswordLoginDialog: React.FC<Props> = ({ destroy }: Props) => {
const t = useTranslate();
const workspaceSettingStore = useWorkspaceSettingStore();
const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
const [state, setState] = useState<State>({
disablePasswordLogin: workspaceGeneralSetting.disallowPasswordLogin,
});
const [confirmedOnce, setConfirmedOnce] = useState(false);
const [typingConfirmation, setTypingConfirmation] = useState("");
const handleCloseBtnClick = () => {
destroy();
};
const allowConfirmAction = () => {
return !confirmedOnce || typingConfirmation === "CONFIRM";
};
const handleConfirmBtnClick = async () => {
if (!confirmedOnce) {
setConfirmedOnce(true);
} else {
setState({ ...state, disablePasswordLogin: true });
try {
await workspaceSettingStore.setWorkspaceSetting({
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: {
...workspaceGeneralSetting,
disallowPasswordLogin: true,
},
});
handleCloseBtnClick();
} catch (error: any) {
console.error(error);
toast.error(error.response.data.message);
}
}
};
const handleTypingConfirmationChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
const text = e.target.value as string;
setTypingConfirmation(text);
};
return (
<>
<div className="dialog-header-container">
<p className="title-text">{t("setting.system-section.disable-password-login")}</p>
<IconButton size="sm" onClick={handleCloseBtnClick}>
<Icon.X className="w-5 h-auto" />
</IconButton>
</div>
<div className="dialog-content-container !w-72">
{confirmedOnce ? (
<>
<p className="">{t("setting.system-section.disable-password-login-final-warning")}</p>
<Input className="w-full mt-2" value={typingConfirmation} onChange={handleTypingConfirmationChanged} />
</>
) : (
<p className="">{t("setting.system-section.disable-password-login-warning")}</p>
)}
<div className="mt-4 w-full flex flex-row justify-end items-center space-x-2">
<Button variant="plain" color="neutral" onClick={handleCloseBtnClick}>
{t("common.close")}
</Button>
<Button onClick={handleConfirmBtnClick} color="danger" disabled={!allowConfirmAction()}>
{t("common.confirm")}
</Button>
</div>
</div>
</>
);
};
function showDisablePasswordLoginDialog() {
generateDialog(
{
className: "disable-password-login-dialog",
dialogName: "disable-password-login-dialog",
},
DisablePasswordLoginDialog,
);
}
export default showDisablePasswordLoginDialog;
import { Button, Switch, Textarea } from "@mui/joy"; import { Button, Textarea } from "@mui/joy";
import { useState } from "react"; import { useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
...@@ -7,7 +7,6 @@ import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1"; ...@@ -7,7 +7,6 @@ import { WorkspaceSettingPrefix, useWorkspaceSettingStore } from "@/store/v1";
import { WorkspaceGeneralSetting } from "@/types/proto/api/v1/workspace_setting_service"; import { WorkspaceGeneralSetting } from "@/types/proto/api/v1/workspace_setting_service";
import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting"; import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting";
import { useTranslate } from "@/utils/i18n"; import { useTranslate } from "@/utils/i18n";
import { showCommonDialog } from "../Dialog/CommonDialog";
import Icon from "../Icon"; import Icon from "../Icon";
import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog"; import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog";
...@@ -18,43 +17,6 @@ const WorkspaceSection = () => { ...@@ -18,43 +17,6 @@ const WorkspaceSection = () => {
WorkspaceGeneralSetting.fromPartial(workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL)?.generalSetting || {}), WorkspaceGeneralSetting.fromPartial(workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL)?.generalSetting || {}),
); );
const handleAllowSignUpChanged = async (value: boolean) => {
const setting = { ...workspaceGeneralSetting, disallowSignup: !value };
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: setting,
},
});
setWorkspaceGeneralSetting(setting);
};
const handleDisablePasswordLoginChanged = async (value: boolean) => {
const updateSetting = async () => {
const setting = { ...workspaceGeneralSetting, disallowPasswordLogin: value };
await workspaceSettingServiceClient.setWorkspaceSetting({
setting: {
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.GENERAL}`,
generalSetting: setting,
},
});
setWorkspaceGeneralSetting(setting);
};
if (value) {
showCommonDialog({
title: "Confirm",
content: "Are you sure to disable password login?",
style: "danger",
dialogName: "disable-password-login-dialog",
onConfirm: async () => {
await updateSetting();
},
});
} else {
await updateSetting();
}
};
const handleUpdateCustomizedProfileButtonClick = () => { const handleUpdateCustomizedProfileButtonClick = () => {
showUpdateCustomizedProfileDialog(); showUpdateCustomizedProfileDialog();
}; };
...@@ -110,17 +72,6 @@ const WorkspaceSection = () => { ...@@ -110,17 +72,6 @@ const WorkspaceSection = () => {
<Button onClick={handleUpdateCustomizedProfileButtonClick}>{t("common.edit")}</Button> <Button onClick={handleUpdateCustomizedProfileButtonClick}>{t("common.edit")}</Button>
</div> </div>
<p className="font-medium text-gray-700 dark:text-gray-500">General</p> <p className="font-medium text-gray-700 dark:text-gray-500">General</p>
<div className="w-full flex flex-row justify-between items-center">
<span className="mr-1">{t("setting.system-section.allow-user-signup")}</span>
<Switch checked={!workspaceGeneralSetting.disallowSignup} onChange={(event) => handleAllowSignUpChanged(event.target.checked)} />
</div>
<div className="w-full flex flex-row justify-between items-center">
<span className="mr-1">{t("setting.system-section.disable-password-login")}</span>
<Switch
checked={workspaceGeneralSetting.disallowPasswordLogin}
onChange={(event) => handleDisablePasswordLoginChanged(event.target.checked)}
/>
</div>
<div className="space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700"> <div className="space-y-2 border rounded-md py-2 px-3 dark:border-zinc-700">
<div className="w-full flex flex-row justify-between items-center"> <div className="w-full flex flex-row justify-between items-center">
<span>{t("setting.system-section.additional-style")}</span> <span>{t("setting.system-section.additional-style")}</span>
......
...@@ -116,71 +116,67 @@ const SignIn = () => { ...@@ -116,71 +116,67 @@ const SignIn = () => {
{workspaceGeneralSetting.customProfile?.title || "Memos"} {workspaceGeneralSetting.customProfile?.title || "Memos"}
</p> </p>
</div> </div>
{!workspaceGeneralSetting.disallowPasswordLogin && ( <form className="w-full mt-2" onSubmit={handleFormSubmit}>
<> <div className="flex flex-col justify-start items-start w-full gap-4">
<form className="w-full mt-2" onSubmit={handleFormSubmit}> <div className="w-full flex flex-col justify-start items-start gap-2">
<div className="flex flex-col justify-start items-start w-full gap-4"> <span className="leading-8 text-gray-600">{t("common.username")}</span>
<div className="w-full flex flex-col justify-start items-start gap-2"> <Input
<span className="leading-8 text-gray-600">{t("common.username")}</span> className="w-full"
<Input size="lg"
className="w-full" type="text"
size="lg" readOnly={actionBtnLoadingState.isLoading}
type="text" placeholder={t("common.username")}
readOnly={actionBtnLoadingState.isLoading} value={username}
placeholder={t("common.username")} onChange={handleUsernameInputChanged}
value={username} required
onChange={handleUsernameInputChanged} />
required </div>
/> <div className="w-full flex flex-col justify-start items-start gap-2">
</div> <span className="leading-8 text-gray-600">{t("common.password")}</span>
<div className="w-full flex flex-col justify-start items-start gap-2"> <Input
<span className="leading-8 text-gray-600">{t("common.password")}</span> className="w-full"
<Input size="lg"
className="w-full" type="password"
size="lg" readOnly={actionBtnLoadingState.isLoading}
type="password" placeholder={t("common.password")}
readOnly={actionBtnLoadingState.isLoading} value={password}
placeholder={t("common.password")} onChange={handlePasswordInputChanged}
value={password} required
onChange={handlePasswordInputChanged} />
required </div>
/> </div>
</div> <div className="flex flex-row justify-start items-center w-full mt-6">
</div> <Checkbox
<div className="flex flex-row justify-start items-center w-full mt-6"> className="dark:!text-gray-400"
<Checkbox label={t("common.remember-me")}
className="dark:!text-gray-400" checked={remember}
label={t("common.remember-me")} onChange={(e) => setRemember(e.target.checked)}
checked={remember} />
onChange={(e) => setRemember(e.target.checked)} </div>
/> <div className="flex flex-row justify-end items-center w-full mt-6">
</div> <Button
<div className="flex flex-row justify-end items-center w-full mt-6"> className="w-full"
<Button size="md"
className="w-full" type="submit"
size="md" disabled={actionBtnLoadingState.isLoading}
type="submit" loading={actionBtnLoadingState.isLoading}
disabled={actionBtnLoadingState.isLoading} onClick={handleSignInButtonClick}
loading={actionBtnLoadingState.isLoading} >
onClick={handleSignInButtonClick} {t("common.sign-in")}
> </Button>
{t("common.sign-in")} </div>
</Button> </form>
</div> {commonContext.profile.public && (
</form> <p className="w-full mt-4 text-sm">
{!workspaceGeneralSetting.disallowSignup && ( <span className="dark:text-gray-500">{t("auth.sign-up-tip")}</span>
<p className="w-full mt-4 text-sm"> <Link to="/auth/signup" className="cursor-pointer ml-2 text-blue-600 hover:underline" unstable_viewTransition>
<span className="dark:text-gray-500">{t("auth.sign-up-tip")}</span> {t("common.sign-up")}
<Link to="/auth/signup" className="cursor-pointer ml-2 text-blue-600 hover:underline" unstable_viewTransition> </Link>
{t("common.sign-up")} </p>
</Link>
</p>
)}
</>
)} )}
{identityProviderList.length > 0 && ( {identityProviderList.length > 0 && (
<> <>
{!workspaceGeneralSetting.disallowPasswordLogin && <Divider className="!my-4">{t("common.or")}</Divider>} <Divider className="!my-4">{t("common.or")}</Divider>
<div className="w-full flex flex-col space-y-2"> <div className="w-full flex flex-col space-y-2">
{identityProviderList.map((identityProvider) => ( {identityProviderList.map((identityProvider) => (
<Button <Button
......
import { Button, Input } from "@mui/joy"; import { Button, Input } from "@mui/joy";
import { ClientError } from "nice-grpc-web"; import { ClientError } from "nice-grpc-web";
import { useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import AppearanceSelect from "@/components/AppearanceSelect"; import AppearanceSelect from "@/components/AppearanceSelect";
...@@ -26,6 +26,12 @@ const SignUp = () => { ...@@ -26,6 +26,12 @@ const SignUp = () => {
const workspaceGeneralSetting = const workspaceGeneralSetting =
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({}); workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
useEffect(() => {
if (!commonContext.profile.public) {
toast.error("Sign up is not allowed.");
}
}, []);
const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => { const handleUsernameInputChanged = (e: React.ChangeEvent<HTMLInputElement>) => {
const text = e.target.value as string; const text = e.target.value as string;
setUsername(text); setUsername(text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment