mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
feat: Config to eventstore (#3158)
* feat: add default language to eventstore * feat: add secret generator configs events * feat: tests * feat: secret generators in eventstore * feat: secret generators in eventstore * feat: smtp config in eventstore * feat: smtp config in eventstore * feat: smtp config in eventstore * feat: smtp config in eventstore * feat: smtp config in eventstore * fix: migrations * fix migration version * fix test * feat: change secret generator type to enum * feat: change smtp attribute names * feat: change smtp attribute names * feat: remove engryption algorithms from command side * feat: remove engryption algorithms from command side * feat: smtp config * feat: smtp config * format smtp from header Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ syntax = "proto3";
|
||||
|
||||
import "zitadel/idp.proto";
|
||||
import "zitadel/user.proto";
|
||||
import "zitadel/settings.proto";
|
||||
import "zitadel/object.proto";
|
||||
import "zitadel/options.proto";
|
||||
import "zitadel/org.proto";
|
||||
@@ -161,6 +162,98 @@ service AdminService {
|
||||
};
|
||||
}
|
||||
|
||||
// Set the default language
|
||||
rpc SetDefaultLanguage(SetDefaultLanguageRequest) returns (SetDefaultLanguageResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/languages/default/{language}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.write";
|
||||
};
|
||||
}
|
||||
|
||||
// Set the default language
|
||||
rpc GetDefaultLanguage(GetDefaultLanguageRequest) returns (GetDefaultLanguageResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/languages/default";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.read";
|
||||
};
|
||||
}
|
||||
|
||||
// Set the default language
|
||||
rpc ListSecretGenerators(ListSecretGeneratorsRequest) returns (ListSecretGeneratorsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/secretgenerators/_search"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.read";
|
||||
};
|
||||
}
|
||||
|
||||
// Get Secret Generator by type (e.g PasswordResetCode)
|
||||
rpc GetSecretGenerator(GetSecretGeneratorRequest) returns (GetSecretGeneratorResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/secretgenerators/{generator_type}";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.read";
|
||||
};
|
||||
}
|
||||
|
||||
// Update secret generator configuration
|
||||
rpc UpdateSecretGenerator(UpdateSecretGeneratorRequest) returns (UpdateSecretGeneratorResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/secretgenerators/{generator_type}";
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.write";
|
||||
};
|
||||
}
|
||||
|
||||
// Get system smtp configuration
|
||||
rpc GetSMTPConfig(GetSMTPConfigRequest) returns (GetSMTPConfigResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/smtp";
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.read";
|
||||
};
|
||||
}
|
||||
|
||||
// Update system smtp configuration
|
||||
rpc UpdateSMTPConfig(UpdateSMTPConfigRequest) returns (UpdateSMTPConfigResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/smtp";
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.write";
|
||||
};
|
||||
}
|
||||
|
||||
// Update system smtp configuration password for host
|
||||
rpc UpdateSMTPConfigPassword(UpdateSMTPConfigPasswordRequest) returns (UpdateSMTPConfigPasswordResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/smtp/password";
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
permission: "iam.write";
|
||||
};
|
||||
}
|
||||
|
||||
// Returns an organisation by id
|
||||
rpc GetOrgByID(GetOrgByIDRequest) returns (GetOrgByIDResponse) {
|
||||
option (google.api.http) = {
|
||||
@@ -2262,6 +2355,82 @@ message GetSupportedLanguagesResponse {
|
||||
repeated string languages = 1;
|
||||
}
|
||||
|
||||
message SetDefaultLanguageRequest {
|
||||
string language = 1 [(validate.rules).string = {min_len: 1, max_len: 10}];
|
||||
}
|
||||
|
||||
message SetDefaultLanguageResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetDefaultLanguageRequest {}
|
||||
|
||||
message GetDefaultLanguageResponse {
|
||||
string language = 1;
|
||||
}
|
||||
|
||||
message ListSecretGeneratorsRequest {
|
||||
//list limitations and ordering
|
||||
zitadel.v1.ListQuery query = 1;
|
||||
//criterias the client is looking for
|
||||
repeated zitadel.settings.v1.SecretGeneratorQuery queries = 2;
|
||||
}
|
||||
|
||||
message ListSecretGeneratorsResponse {
|
||||
zitadel.v1.ListDetails details = 1;
|
||||
repeated zitadel.settings.v1.SecretGenerator result = 3;
|
||||
}
|
||||
|
||||
message GetSecretGeneratorRequest {
|
||||
zitadel.settings.v1.SecretGeneratorType generator_type = 1 [(validate.rules).enum = {defined_only: true, not_in: [0]}];
|
||||
}
|
||||
|
||||
message GetSecretGeneratorResponse {
|
||||
zitadel.settings.v1.SecretGenerator secret_generator = 1;
|
||||
}
|
||||
|
||||
message UpdateSecretGeneratorRequest {
|
||||
zitadel.settings.v1.SecretGeneratorType generator_type = 1 [(validate.rules).enum = {defined_only: true, not_in: [0]}];
|
||||
uint32 length = 2;
|
||||
google.protobuf.Duration expiry = 3;
|
||||
bool include_lower_letters = 4;
|
||||
bool include_upper_letters = 5;
|
||||
bool include_digits = 6;
|
||||
bool include_symbols = 7;
|
||||
}
|
||||
|
||||
message UpdateSecretGeneratorResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
//This is an empty request
|
||||
message GetSMTPConfigRequest {}
|
||||
|
||||
message GetSMTPConfigResponse {
|
||||
zitadel.settings.v1.SMTPConfig smtp_config = 1;
|
||||
}
|
||||
|
||||
message UpdateSMTPConfigRequest {
|
||||
string sender_address = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string sender_name = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
bool tls = 3;
|
||||
string host = 4 [(validate.rules).string = {min_len: 1, max_len: 500}];
|
||||
string user = 5;
|
||||
}
|
||||
|
||||
message UpdateSMTPConfigResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
message UpdateSMTPConfigPasswordRequest {
|
||||
string password = 1;
|
||||
}
|
||||
|
||||
message UpdateSMTPConfigPasswordResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
// if name or domain is already in use, org is not unique
|
||||
message IsOrgUniqueRequest {
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
|
||||
|
@@ -290,6 +290,7 @@ service ManagementService {
|
||||
rpc UpdateUserName(UpdateUserNameRequest) returns (UpdateUserNameResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/users/{user_id}/username"
|
||||
body: "*"
|
||||
};
|
||||
|
||||
option (zitadel.v1.auth_option) = {
|
||||
|
53
proto/zitadel/settings.proto
Normal file
53
proto/zitadel/settings.proto
Normal file
@@ -0,0 +1,53 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "zitadel/object.proto";
|
||||
import "validate/validate.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
|
||||
package zitadel.settings.v1;
|
||||
|
||||
option go_package ="github.com/caos/zitadel/pkg/grpc/settings";
|
||||
|
||||
message SecretGenerator {
|
||||
SecretGeneratorType generator_type = 1;
|
||||
zitadel.v1.ObjectDetails details = 2;
|
||||
uint32 length = 3;
|
||||
google.protobuf.Duration expiry = 4;
|
||||
bool include_lower_letters = 5;
|
||||
bool include_upper_letters = 6;
|
||||
bool include_digits = 7;
|
||||
bool include_symbols = 8;
|
||||
}
|
||||
|
||||
|
||||
message SecretGeneratorQuery {
|
||||
oneof query {
|
||||
option (validate.required) = true;
|
||||
|
||||
SecretGeneratorTypeQuery type_query = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message SecretGeneratorTypeQuery {
|
||||
SecretGeneratorType generator_type = 1;
|
||||
}
|
||||
|
||||
enum SecretGeneratorType {
|
||||
SECRET_GENERATOR_TYPE_UNSPECIFIED = 0;
|
||||
SECRET_GENERATOR_TYPE_INIT_CODE = 1;
|
||||
SECRET_GENERATOR_TYPE_VERIFY_EMAIL_CODE = 2;
|
||||
SECRET_GENERATOR_TYPE_VERIFY_PHONE_CODE = 3;
|
||||
SECRET_GENERATOR_TYPE_PASSWORD_RESET_CODE = 4;
|
||||
SECRET_GENERATOR_TYPE_PASSWORDLESS_INIT_CODE = 5;
|
||||
SECRET_GENERATOR_TYPE_APP_SECRET = 6;
|
||||
}
|
||||
|
||||
message SMTPConfig {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
string sender_address = 2;
|
||||
string sender_name = 3;
|
||||
bool tls = 4;
|
||||
string host = 5;
|
||||
string user = 6;
|
||||
}
|
Reference in New Issue
Block a user