Files
zitadel/backend/v3/domain/domain.go

66 lines
2.3 KiB
Go
Raw Normal View History

2025-04-29 06:03:47 +02:00
package domain
2025-07-25 16:17:14 +02:00
import (
"time"
"github.com/zitadel/zitadel/backend/v3/storage/database"
)
2025-07-16 09:26:46 +02:00
2025-07-22 19:09:56 +02:00
type DomainValidationType string
2025-07-16 09:26:46 +02:00
const (
2025-07-22 19:09:56 +02:00
DomainValidationTypeDNS DomainValidationType = "dns"
DomainValidationTypeHTTP DomainValidationType = "http"
2025-07-16 09:26:46 +02:00
)
type DomainType string
const (
DomainTypeCustom DomainType = "custom"
DomainTypeTrusted DomainType = "trusted"
)
2025-07-16 09:26:46 +02:00
type domainColumns interface {
// InstanceIDColumn returns the column for the instance id field.
2025-07-22 19:09:56 +02:00
// `qualified` indicates if the column should be qualified with the table name.
InstanceIDColumn(qualified bool) database.Column
2025-07-16 09:26:46 +02:00
// DomainColumn returns the column for the domain field.
2025-07-22 19:09:56 +02:00
// `qualified` indicates if the column should be qualified with the table name.
DomainColumn(qualified bool) database.Column
2025-07-16 09:26:46 +02:00
// IsPrimaryColumn returns the column for the is primary field.
2025-07-22 19:09:56 +02:00
// `qualified` indicates if the column should be qualified with the table name.
IsPrimaryColumn(qualified bool) database.Column
2025-07-16 09:26:46 +02:00
// CreatedAtColumn returns the column for the created at field.
2025-07-22 19:09:56 +02:00
// `qualified` indicates if the column should be qualified with the table name.
CreatedAtColumn(qualified bool) database.Column
2025-07-16 09:26:46 +02:00
// UpdatedAtColumn returns the column for the updated at field.
2025-07-22 19:09:56 +02:00
// `qualified` indicates if the column should be qualified with the table name.
UpdatedAtColumn(qualified bool) database.Column
2025-07-16 09:26:46 +02:00
}
type domainConditions interface {
// InstanceIDCondition returns a filter on the instance id field.
InstanceIDCondition(instanceID string) database.Condition
// DomainCondition returns a filter on the domain field.
DomainCondition(op database.TextOperation, domain string) database.Condition
// IsPrimaryCondition returns a filter on the is primary field.
IsPrimaryCondition(isPrimary bool) database.Condition
}
type domainChanges interface {
// SetPrimary sets a domain as primary based on the condition.
// All other domains will be set to non-primary.
//
// An error is returned if:
// - The condition identifies multiple domains.
// - The condition does not identify any domain.
//
// This is a no-op if:
// - The domain is already primary.
// - No domain matches the condition.
SetPrimary() database.Change
2025-07-25 16:17:14 +02:00
// SetUpdatedAt sets the updated at column.
// This is used for reducing events.
SetUpdatedAt(t time.Time) database.Change
2025-07-16 09:26:46 +02:00
}