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:
Fabi
2022-04-14 14:19:18 +02:00
committed by GitHub
parent 820a21dce3
commit c25d853820
29 changed files with 858 additions and 145 deletions

View File

@@ -56,6 +56,18 @@ Set the default language
GET: /languages/default
### ListInstanceDomains
> **rpc** ListInstanceDomains([ListInstanceDomainsRequest](#listinstancedomainsrequest))
[ListInstanceDomainsResponse](#listinstancedomainsresponse)
Returns the domains of an instance
GET: /domains
### ListSecretGenerators
> **rpc** ListSecretGenerators([ListSecretGeneratorsRequest](#listsecretgeneratorsrequest))
@@ -2629,6 +2641,32 @@ This is an empty request
### ListInstanceDomainsRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| query | zitadel.v1.ListQuery | - | |
| sorting_column | zitadel.instance.v1.DomainFieldName | the field the result is sorted | |
| queries | repeated zitadel.instance.v1.DomainSearchQuery | criterias the client is looking for | |
### ListInstanceDomainsResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ListDetails | - | |
| sorting_column | zitadel.instance.v1.DomainFieldName | - | |
| result | repeated zitadel.instance.v1.Domain | - | |
### ListLoginPolicyIDPsRequest

View File

@@ -9,14 +9,63 @@ title: zitadel/instance.proto
## Messages
### DomainsQuery
### Domain
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| domains | repeated string | - | string.max_len: 200<br /> |
| method | zitadel.v1.ListQueryMethod | - | enum.defined_only: true<br /> |
| details | zitadel.v1.ObjectDetails | - | |
| domain | string | - | |
| primary | bool | - | |
| generated | bool | - | |
### DomainGeneratedQuery
DomainGeneratedQuery is always equals
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| generated | bool | - | |
### DomainPrimaryQuery
DomainPrimaryQuery is always equals
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| primary | bool | - | |
### DomainQuery
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| domain | string | - | string.max_len: 200<br /> |
| method | zitadel.v1.TextQueryMethod | - | enum.defined_only: true<br /> |
### DomainSearchQuery
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.domain_query | DomainQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.generated_query | DomainGeneratedQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.primary_query | DomainPrimaryQuery | - | |
@@ -41,8 +90,6 @@ IdQuery is always equals
| id | string | - | |
| details | zitadel.v1.ObjectDetails | - | |
| state | State | - | |
| generated_domain | string | - | |
| custom_domains | repeated string | - | |
| name | string | - | |
| version | string | - | |
@@ -56,7 +103,6 @@ IdQuery is always equals
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.id_query | IdQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.domains_query | DomainsQuery | - | |
| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) query.state_query | StateQuery | - | |
@@ -78,6 +124,20 @@ StateQuery is always equals
## Enums
### DomainFieldName {#domainfieldname}
| Name | Number | Description |
| ---- | ------ | ----------- |
| 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 | - |
### FieldName {#fieldname}
@@ -85,9 +145,8 @@ StateQuery is always equals
| ---- | ------ | ----------- |
| 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 | - |

View File

@@ -82,40 +82,52 @@ Returns the usage metrics of an instance
GET: /instances/{id}/usage
### GetGeneratedDomain
### ListDomains
> **rpc** GetGeneratedDomain([GetGeneratedDomainRequest](#getgenerateddomainrequest))
[GetGeneratedDomainResponse](#getgenerateddomainresponse)
Returns the domain of an instance
GET: /instances/{id}/domains/generated
### GetCustomDomains
> **rpc** GetCustomDomains([GetCustomDomainsRequest](#getcustomdomainsrequest))
[GetCustomDomainsResponse](#getcustomdomainsresponse)
> **rpc** ListDomains([ListDomainsRequest](#listdomainsrequest))
[ListDomainsResponse](#listdomainsresponse)
Returns the custom domains of an instance
GET: /instances/{id}/domains/custom
GET: /instances/{id}/domains
### AddCustomDomain
### AddDomain
> **rpc** AddCustomDomain([AddCustomDomainRequest](#addcustomdomainrequest))
[AddCustomDomainResponse](#addcustomdomainresponse)
> **rpc** AddDomain([AddDomainRequest](#adddomainrequest))
[AddDomainResponse](#adddomainresponse)
Returns the domain of an instance
POST: /instances/{id}/domains/custom
POST: /instances/{id}/domains
### RemoveDomain
> **rpc** RemoveDomain([RemoveDomainRequest](#removedomainrequest))
[RemoveDomainResponse](#removedomainresponse)
Returns the domain of an instance
DELETE: /instances/{id}/domains/{domain}
### SetPrimaryDomain
> **rpc** SetPrimaryDomain([SetPrimaryDomainRequest](#setprimarydomainrequest))
[SetPrimaryDomainResponse](#setprimarydomainresponse)
Returns the domain of an instance
POST: /instances/{id}/domains/_set_primary
### ListViews
@@ -185,19 +197,19 @@ failed event. You can find out if it worked on the `failure_count`
## Messages
### AddCustomDomainRequest
### AddDomainRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| custom_domain | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| domain | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### AddCustomDomainResponse
### AddDomainResponse
@@ -297,52 +309,6 @@ This is an empty response
### GetCustomDomainsRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### GetCustomDomainsResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
| domains | repeated string | - | |
### GetGeneratedDomainRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### GetGeneratedDomainResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
| domain | string | - | |
### GetInstanceRequest
@@ -401,6 +367,33 @@ This is an empty response
### ListDomainsRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | list limitations and ordering | string.min_len: 1<br /> string.max_len: 200<br /> |
| query | zitadel.v1.ListQuery | - | |
| sorting_column | zitadel.instance.v1.DomainFieldName | the field the result is sorted | |
| queries | repeated zitadel.instance.v1.DomainSearchQuery | criterias the client is looking for | |
### ListDomainsResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ListDetails | - | |
| sorting_column | zitadel.instance.v1.DomainFieldName | - | |
| result | repeated zitadel.instance.v1.Domain | - | |
### ListFailedEventsRequest
This is an empty request
@@ -461,6 +454,29 @@ This is an empty request
### RemoveDomainRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| domain | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### RemoveDomainResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### RemoveFailedEventRequest
@@ -502,6 +518,29 @@ This is an empty response
### SetPrimaryDomainRequest
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| id | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
| domain | string | - | string.min_len: 1<br /> string.max_len: 200<br /> |
### SetPrimaryDomainResponse
| Field | Type | Description | Validation |
| ----- | ---- | ----------- | ----------- |
| details | zitadel.v1.ObjectDetails | - | |
### View