mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20: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:
@@ -19,6 +19,7 @@ type InstanceDomain struct {
|
||||
Domain string
|
||||
InstanceID string
|
||||
IsGenerated bool
|
||||
IsPrimary bool
|
||||
}
|
||||
|
||||
type InstanceDomains struct {
|
||||
@@ -47,8 +48,12 @@ func NewInstanceDomainInstanceIDSearchQuery(value string) (SearchQuery, error) {
|
||||
return NewTextQuery(InstanceDomainInstanceIDCol, value, TextEquals)
|
||||
}
|
||||
|
||||
func NewInstanceDomainGeneratedSearchQuery(verified bool) (SearchQuery, error) {
|
||||
return NewBoolQuery(InstanceDomainIsGeneratedCol, verified)
|
||||
func NewInstanceDomainGeneratedSearchQuery(generated bool) (SearchQuery, error) {
|
||||
return NewBoolQuery(InstanceDomainIsGeneratedCol, generated)
|
||||
}
|
||||
|
||||
func NewInstanceDomainPrimarySearchQuery(primary bool) (SearchQuery, error) {
|
||||
return NewBoolQuery(InstanceDomainIsPrimaryCol, primary)
|
||||
}
|
||||
|
||||
func (q *Queries) SearchInstanceDomains(ctx context.Context, queries *InstanceDomainSearchQueries) (domains *InstanceDomains, err error) {
|
||||
@@ -81,6 +86,7 @@ func prepareInstanceDomainsQuery() (sq.SelectBuilder, func(*sql.Rows) (*Instance
|
||||
InstanceDomainDomainCol.identifier(),
|
||||
InstanceDomainInstanceIDCol.identifier(),
|
||||
InstanceDomainIsGeneratedCol.identifier(),
|
||||
InstanceDomainIsPrimaryCol.identifier(),
|
||||
countColumn.identifier(),
|
||||
).From(instanceDomainsTable.identifier()).PlaceholderFormat(sq.Dollar),
|
||||
func(rows *sql.Rows) (*InstanceDomains, error) {
|
||||
@@ -95,6 +101,7 @@ func prepareInstanceDomainsQuery() (sq.SelectBuilder, func(*sql.Rows) (*Instance
|
||||
&domain.Domain,
|
||||
&domain.InstanceID,
|
||||
&domain.IsGenerated,
|
||||
&domain.IsPrimary,
|
||||
&count,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -145,4 +152,8 @@ var (
|
||||
name: projection.InstanceDomainIsGeneratedCol,
|
||||
table: instanceDomainsTable,
|
||||
}
|
||||
InstanceDomainIsPrimaryCol = Column{
|
||||
name: projection.InstanceDomainIsPrimaryCol,
|
||||
table: instanceDomainsTable,
|
||||
}
|
||||
)
|
||||
|
Reference in New Issue
Block a user