mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:47:32 +00:00
feat: Instance domains (#3444)
* feat: add domain list * feat: domain tests * feat: add redirect url on adding instance domain * Update internal/command/instance_domain.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * feat: remove unused code * fix Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "zitadel/idp.proto";
|
||||
import "zitadel/instance.proto";
|
||||
import "zitadel/user.proto";
|
||||
import "zitadel/object.proto";
|
||||
import "zitadel/options.proto";
|
||||
@@ -184,6 +185,13 @@ service AdminService {
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the domains of an instance
|
||||
rpc ListInstanceDomains(ListInstanceDomainsRequest) returns (ListInstanceDomainsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/domains";
|
||||
};
|
||||
}
|
||||
|
||||
// Set the default language
|
||||
rpc ListSecretGenerators(ListSecretGeneratorsRequest) returns (ListSecretGeneratorsResponse) {
|
||||
option (google.api.http) = {
|
||||
@@ -2642,6 +2650,20 @@ message GetDefaultLanguageResponse {
|
||||
string language = 1;
|
||||
}
|
||||
|
||||
message ListInstanceDomainsRequest {
|
||||
zitadel.v1.ListQuery query = 1;
|
||||
// the field the result is sorted
|
||||
zitadel.instance.v1.DomainFieldName sorting_column = 2;
|
||||
//criterias the client is looking for
|
||||
repeated zitadel.instance.v1.DomainSearchQuery queries = 3;
|
||||
}
|
||||
|
||||
message ListInstanceDomainsResponse {
|
||||
zitadel.v1.ListDetails details = 1;
|
||||
zitadel.instance.v1.DomainFieldName sorting_column = 2;
|
||||
repeated zitadel.instance.v1.Domain result = 3;
|
||||
}
|
||||
|
||||
message ListSecretGeneratorsRequest {
|
||||
//list limitations and ordering
|
||||
zitadel.v1.ListQuery query = 1;
|
||||
|
@@ -20,22 +20,12 @@ message Instance {
|
||||
description: "current state of the instance";
|
||||
}
|
||||
];
|
||||
string generated_domain = 4 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"organization.zitadel.com\"";
|
||||
}
|
||||
];
|
||||
repeated string custom_domains = 5 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "[\"zitadel.com\", \"zitadel.cloud\", \"zitadel.ch\"]";
|
||||
}
|
||||
];
|
||||
string name = 6 [
|
||||
string name = 4 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"ZITADEL\"";
|
||||
}
|
||||
];
|
||||
string version = 7 [
|
||||
string version = 5 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"v1.0.0\"";
|
||||
}
|
||||
@@ -55,8 +45,7 @@ message Query {
|
||||
option (validate.required) = true;
|
||||
|
||||
IdQuery id_query = 1;
|
||||
DomainsQuery domains_query = 2;
|
||||
StateQuery state_query = 3;
|
||||
StateQuery state_query = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,21 +59,6 @@ message IdQuery {
|
||||
];
|
||||
}
|
||||
|
||||
message DomainsQuery {
|
||||
repeated string domains = 1 [
|
||||
(validate.rules).string = {max_len: 200},
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"caos.ch\"";
|
||||
}
|
||||
];
|
||||
zitadel.v1.ListQueryMethod method = 2 [
|
||||
(validate.rules).enum.defined_only = true,
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "defines which list equality method is used";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
//StateQuery is always equals
|
||||
message StateQuery {
|
||||
State state = 1 [
|
||||
@@ -98,7 +72,68 @@ message StateQuery {
|
||||
enum FieldName {
|
||||
FIELD_NAME_UNSPECIFIED = 0;
|
||||
FIELD_NAME_ID = 1;
|
||||
FIELD_NAME_GENERATED_DOMAIN = 2;
|
||||
FIELD_NAME_NAME = 3;
|
||||
FIELD_NAME_CREATION_DATE = 4;
|
||||
FIELD_NAME_NAME = 2;
|
||||
FIELD_NAME_CREATION_DATE = 3;
|
||||
}
|
||||
|
||||
message Domain {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
string domain = 2 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
example: "\"zitadel.com\""
|
||||
}
|
||||
];
|
||||
bool primary = 3;
|
||||
bool generated = 4;
|
||||
}
|
||||
|
||||
message DomainSearchQuery {
|
||||
oneof query {
|
||||
option (validate.required) = true;
|
||||
|
||||
DomainQuery domain_query = 1;
|
||||
DomainGeneratedQuery generated_query = 2;
|
||||
DomainPrimaryQuery primary_query = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message DomainQuery {
|
||||
string domain = 1 [
|
||||
(validate.rules).string = {max_len: 200},
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "zitadel.com";
|
||||
}
|
||||
];
|
||||
zitadel.v1.TextQueryMethod method = 2 [
|
||||
(validate.rules).enum.defined_only = true,
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "defines which text equality method is used";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
//DomainGeneratedQuery is always equals
|
||||
message DomainGeneratedQuery {
|
||||
bool generated = 1 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "generated domains";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
//DomainPrimaryQuery is always equals
|
||||
message DomainPrimaryQuery {
|
||||
bool primary = 1 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "primary domains";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
enum DomainFieldName {
|
||||
DOMAIN_FIELD_NAME_UNSPECIFIED = 0;
|
||||
DOMAIN_FIELD_NAME_DOMAIN = 1;
|
||||
DOMAIN_FIELD_NAME_PRIMARY = 2;
|
||||
DOMAIN_FIELD_NAME_GENERATED = 3;
|
||||
DOMAIN_FIELD_NAME_CREATION_DATE = 4;
|
||||
}
|
||||
|
@@ -141,28 +141,37 @@ service SystemService {
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the domain of an instance
|
||||
rpc GetGeneratedDomain(GetGeneratedDomainRequest) returns (GetGeneratedDomainResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/instances/{id}/domains/generated";
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the custom domains of an instance
|
||||
rpc GetCustomDomains(GetCustomDomainsRequest) returns (GetCustomDomainsResponse) {
|
||||
rpc ListDomains(ListDomainsRequest) returns (ListDomainsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/instances/{id}/domains/custom";
|
||||
get: "/instances/{id}/domains";
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the domain of an instance
|
||||
rpc AddCustomDomain(AddCustomDomainRequest) returns (AddCustomDomainResponse) {
|
||||
rpc AddDomain(AddDomainRequest) returns (AddDomainResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/instances/{id}/domains/custom";
|
||||
post: "/instances/{id}/domains";
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the domain of an instance
|
||||
rpc RemoveDomain(RemoveDomainRequest) returns (RemoveDomainResponse) {
|
||||
option (google.api.http) = {
|
||||
delete: "/instances/{id}/domains/{domain}";
|
||||
};
|
||||
}
|
||||
|
||||
// Returns the domain of an instance
|
||||
rpc SetPrimaryDomain(SetPrimaryDomainRequest) returns (SetPrimaryDomainResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/instances/{id}/domains/_set_primary";
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//Returns all stored read models of ZITADEL
|
||||
// views are used for search optimisation and optimise request latencies
|
||||
// they represent the delta of the event happend on the objects
|
||||
@@ -346,30 +355,45 @@ message GetUsageResponse {
|
||||
uint64 executed_action_mins = 3;
|
||||
}
|
||||
|
||||
message GetGeneratedDomainRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
message ListDomainsRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];//list limitations and ordering
|
||||
zitadel.v1.ListQuery query = 2;
|
||||
// the field the result is sorted
|
||||
zitadel.instance.v1.DomainFieldName sorting_column = 3;
|
||||
//criterias the client is looking for
|
||||
repeated zitadel.instance.v1.DomainSearchQuery queries = 4;
|
||||
}
|
||||
|
||||
message GetGeneratedDomainResponse {
|
||||
message ListDomainsResponse {
|
||||
zitadel.v1.ListDetails details = 1;
|
||||
zitadel.instance.v1.DomainFieldName sorting_column = 2;
|
||||
repeated zitadel.instance.v1.Domain result = 3;
|
||||
}
|
||||
|
||||
message AddDomainRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string domain = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message AddDomainResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
string domain = 2;
|
||||
}
|
||||
|
||||
message GetCustomDomainsRequest {
|
||||
message RemoveDomainRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string domain = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message GetCustomDomainsResponse {
|
||||
message RemoveDomainResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
repeated string domains = 2;
|
||||
}
|
||||
|
||||
message AddCustomDomainRequest {
|
||||
message SetPrimaryDomainRequest {
|
||||
string id = 1 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string custom_domain = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
string domain = 2 [(validate.rules).string = {min_len: 1, max_len: 200}];
|
||||
}
|
||||
|
||||
message AddCustomDomainResponse {
|
||||
message SetPrimaryDomainResponse {
|
||||
zitadel.v1.ObjectDetails details = 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user