diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f5b07afdf..17205830a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - [PR #257](https://github.com/konpyutaika/nifikop/pull/257) - **[Operator]** Updated the operator-sdk to 1.28.0. - [PR #263](https://github.com/konpyutaika/nifikop/pull/263) - **[NiGoApi]** Upgrade nigoapi to v0.0.8. - [PR #263](https://github.com/konpyutaika/nifikop/pull/268) - **[Operator]** Upgrade golang to 1.20.5. +- [PR #266](https://github.com/konpyutaika/nifikop/pull/266) - **[Operator]** Add AuthenticationStrategy, ManagerDn, ManagerPassword, IdentityStrategy properties for LDAP integration + ### Fixed Bugs diff --git a/api/v1/nificluster_types.go b/api/v1/nificluster_types.go index 13ecb065b9..cacb323f5f 100644 --- a/api/v1/nificluster_types.go +++ b/api/v1/nificluster_types.go @@ -503,6 +503,18 @@ type LdapConfiguration struct { // Filter for searching for users against the 'User Search Base'. // (i.e. sAMAccountName={0}). The user specified name is inserted into '{0}'. SearchFilter string `json:"searchFilter,omitempty"` + // How the connection to the LDAP server is authenticated. + // Possible values are ANONYMOUS, SIMPLE, LDAPS, or START_TLS. + AuthenticationStrategy string `json:"authenticationStrategy,omitempty"` + // The DN of the manager that is used to bind to the LDAP server to search for users. + ManagerDn string `json:"managerDn,omitempty"` + // The password of the manager that is used to bind to the LDAP server to search for users. + ManagerPassword string `json:"managerPassword,omitempty"` + // Strategy to identify users. Possible values are USE_DN and USE_USERNAME. + // The default functionality if this property is missing is USE_DN in order to retain backward compatibility. + // USE_DN will use the full DN of the user entry if possible. + // USE_USERNAME will use the username the user logged in with. + IdentityStrategy string `json:"identityStrategy,omitempty"` } // NifiClusterTaskSpec specifies the configuration of the nifi cluster Tasks diff --git a/config/crd/bases/nifi.konpyutaika.com_nificlusters.yaml b/config/crd/bases/nifi.konpyutaika.com_nificlusters.yaml index 2ba8017a17..3c7188583c 100644 --- a/config/crd/bases/nifi.konpyutaika.com_nificlusters.yaml +++ b/config/crd/bases/nifi.konpyutaika.com_nificlusters.yaml @@ -707,8 +707,16 @@ spec: type: array ldapConfiguration: properties: + authenticationStrategy: + type: string enabled: type: boolean + identityStrategy: + type: string + managerDn: + type: string + managerPassword: + type: string searchBase: type: string searchFilter: diff --git a/docs/tutorials/secured_nifi_cluster_on_gcp/kubernetes/nifikop/nifi.orange.com_nificlusters_crd.yaml b/docs/tutorials/secured_nifi_cluster_on_gcp/kubernetes/nifikop/nifi.orange.com_nificlusters_crd.yaml index 6ee4eefb5d..00be666348 100644 --- a/docs/tutorials/secured_nifi_cluster_on_gcp/kubernetes/nifikop/nifi.orange.com_nificlusters_crd.yaml +++ b/docs/tutorials/secured_nifi_cluster_on_gcp/kubernetes/nifikop/nifi.orange.com_nificlusters_crd.yaml @@ -1108,6 +1108,14 @@ spec: description: Space-separated list of URLs of the LDAP servers (i.e. ldap://:). type: string + authenticationStrategy: + type: string + managerDn: + type: string + managerPassword: + type: string + identityStrategy: + type: string type: object listenersConfig: description: listenerConfig specifies nifi's listener specifig configs diff --git a/helm/nifikop/crds/nifi.konpyutaika.com_nificlusters.yaml b/helm/nifikop/crds/nifi.konpyutaika.com_nificlusters.yaml index 2ba8017a17..52bb4c00e4 100644 --- a/helm/nifikop/crds/nifi.konpyutaika.com_nificlusters.yaml +++ b/helm/nifikop/crds/nifi.konpyutaika.com_nificlusters.yaml @@ -715,6 +715,14 @@ spec: type: string url: type: string + authenticationStrategy: + type: string + managerDn: + type: string + managerPassword: + type: string + identityStrategy: + type: string type: object listenersConfig: properties: diff --git a/pkg/resources/templates/config/login_identity_providers.go b/pkg/resources/templates/config/login_identity_providers.go index 29ffde9b7a..7956846335 100644 --- a/pkg/resources/templates/config/login_identity_providers.go +++ b/pkg/resources/templates/config/login_identity_providers.go @@ -68,9 +68,10 @@ var LoginIdentityProvidersTemplate = ` ldap-provider org.apache.nifi.ldap.LdapProvider - START_TLS - - + {{.LdapConfiguration.AuthenticationStrategy}} + {{or .LdapConfiguration.AuthenticationStrategy "START_TLS"}} + {{.LdapConfiguration.ManagerDn}} + {{.LdapConfiguration.ManagerPassword}} @@ -87,7 +88,8 @@ var LoginIdentityProvidersTemplate = `{{.LdapConfiguration.Url}} {{.LdapConfiguration.SearchBase}} {{.LdapConfiguration.SearchFilter}} - USE_DN + {{.LdapConfiguration.IdentityStrategy}} + {{or .LdapConfiguration.IdentityStrategy "USE_DN"}} 12 hours {{end}}