feat(ldap): adding root ca option to ldap config (#9292)

# Which Problems Are Solved

Adding ability to add a root CA to LDAP configs

# Additional Context

- Closes https://github.com/zitadel/zitadel/issues/7888

---------

Co-authored-by: Iraq Jaber <IraqJaber@gmail.com>
This commit is contained in:
Iraq
2025-02-18 10:06:50 +00:00
committed by GitHub
parent d7332d1ac4
commit 5bbb953ffb
27 changed files with 418 additions and 243 deletions

View File

@@ -22,6 +22,7 @@ type LDAPIDPAddedEvent struct {
UserObjectClasses []string `json:"userObjectClasses"`
UserFilters []string `json:"userFilters"`
Timeout time.Duration `json:"timeout"`
RootCA []byte `json:"rootCA"`
LDAPAttributes
Options
@@ -142,6 +143,7 @@ func NewLDAPIDPAddedEvent(
userObjectClasses []string,
userFilters []string,
timeout time.Duration,
rootCA []byte,
attributes LDAPAttributes,
options Options,
) *LDAPIDPAddedEvent {
@@ -158,6 +160,7 @@ func NewLDAPIDPAddedEvent(
UserObjectClasses: userObjectClasses,
UserFilters: userFilters,
Timeout: timeout,
RootCA: rootCA,
LDAPAttributes: attributes,
Options: options,
}
@@ -198,6 +201,7 @@ type LDAPIDPChangedEvent struct {
UserObjectClasses []string `json:"userObjectClasses,omitempty"`
UserFilters []string `json:"userFilters,omitempty"`
Timeout *time.Duration `json:"timeout,omitempty"`
RootCA []byte `json:"rootCA,omitempty"`
LDAPAttributeChanges
OptionChanges
@@ -315,6 +319,12 @@ func ChangeLDAPTimeout(timeout time.Duration) func(*LDAPIDPChangedEvent) {
}
}
func ChangeLDAPRootCA(rootCA []byte) func(*LDAPIDPChangedEvent) {
return func(e *LDAPIDPChangedEvent) {
e.RootCA = rootCA
}
}
func ChangeLDAPAttributes(attributes LDAPAttributeChanges) func(*LDAPIDPChangedEvent) {
return func(e *LDAPIDPChangedEvent) {
e.LDAPAttributeChanges = attributes