mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-15 08:04:49 +00:00
feat: restrict smtp sender address (#3637)
* fix: check if sender address is custom domain * fix: check if sender address is custom domain * fix: check if sender address is custom domain Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -23,8 +23,9 @@ type DomainPolicy struct {
|
||||
ResourceOwner string
|
||||
State domain.PolicyState
|
||||
|
||||
UserLoginMustBeDomain bool
|
||||
ValidateOrgDomains bool
|
||||
UserLoginMustBeDomain bool
|
||||
ValidateOrgDomains bool
|
||||
SMTPSenderAddressMatchesInstanceDomain bool
|
||||
|
||||
IsDefault bool
|
||||
}
|
||||
@@ -65,6 +66,10 @@ var (
|
||||
name: projection.DomainPolicyValidateOrgDomainsCol,
|
||||
table: domainPolicyTable,
|
||||
}
|
||||
DomainPolicyColSMTPSenderAddressMatchesInstanceDomain = Column{
|
||||
name: projection.DomainPolicySMTPSenderAddressMatchesInstanceDomainCol,
|
||||
table: domainPolicyTable,
|
||||
}
|
||||
DomainPolicyColIsDefault = Column{
|
||||
name: projection.DomainPolicyIsDefaultCol,
|
||||
table: domainPolicyTable,
|
||||
@@ -126,6 +131,7 @@ func prepareDomainPolicyQuery() (sq.SelectBuilder, func(*sql.Row) (*DomainPolicy
|
||||
DomainPolicyColResourceOwner.identifier(),
|
||||
DomainPolicyColUserLoginMustBeDomain.identifier(),
|
||||
DomainPolicyColValidateOrgDomains.identifier(),
|
||||
DomainPolicyColSMTPSenderAddressMatchesInstanceDomain.identifier(),
|
||||
DomainPolicyColIsDefault.identifier(),
|
||||
DomainPolicyColState.identifier(),
|
||||
).
|
||||
@@ -140,6 +146,7 @@ func prepareDomainPolicyQuery() (sq.SelectBuilder, func(*sql.Row) (*DomainPolicy
|
||||
&policy.ResourceOwner,
|
||||
&policy.UserLoginMustBeDomain,
|
||||
&policy.ValidateOrgDomains,
|
||||
&policy.SMTPSenderAddressMatchesInstanceDomain,
|
||||
&policy.IsDefault,
|
||||
&policy.State,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user