Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AuthenticationStrategy, ManagerDn, ManagerPassword, IdentityStrat… #266

Merged
merged 2 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions api/v1/nificluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/nifi.konpyutaika.com_nificlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,14 @@ spec:
description: Space-separated list of URLs of the LDAP servers (i.e.
ldap://<hostname>:<port>).
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
Expand Down
8 changes: 8 additions & 0 deletions helm/nifikop/crds/nifi.konpyutaika.com_nificlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions pkg/resources/templates/config/login_identity_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ var LoginIdentityProvidersTemplate = `<?xml version="1.0" encoding="UTF-8" stand
<provider>
<identifier>ldap-provider</identifier>
<class>org.apache.nifi.ldap.LdapProvider</class>
<property name="Authentication Strategy">START_TLS</property>
pashtet04 marked this conversation as resolved.
Show resolved Hide resolved
<property name="Manager DN"></property>
<property name="Manager Password"></property>
<property name="Authentication Strategy">{{.LdapConfiguration.AuthenticationStrategy}}</property>
pashtet04 marked this conversation as resolved.
Show resolved Hide resolved
<property name="Authentication Strategy">{{or .LdapConfiguration.AuthenticationStrategy "START_TLS"}}</property>
<property name="Manager DN">{{.LdapConfiguration.ManagerDn}}</property>
<property name="Manager Password">{{.LdapConfiguration.ManagerPassword}}</property>
<property name="TLS - Keystore"></property>
<property name="TLS - Keystore Password"></property>
<property name="TLS - Keystore Type"></property>
Expand All @@ -87,7 +88,8 @@ var LoginIdentityProvidersTemplate = `<?xml version="1.0" encoding="UTF-8" stand
<property name="Url">{{.LdapConfiguration.Url}}</property>
<property name="User Search Base">{{.LdapConfiguration.SearchBase}}</property>
<property name="User Search Filter">{{.LdapConfiguration.SearchFilter}}</property>
<property name="Identity Strategy">USE_DN</property>
<property name="Identity Strategy">{{.LdapConfiguration.IdentityStrategy}}</property>
pashtet04 marked this conversation as resolved.
Show resolved Hide resolved
<property name="Identity Strategy">{{or .LdapConfiguration.IdentityStrategy "USE_DN"}}</property>
<property name="Authentication Expiration">12 hours</property>
</provider>
{{end}}
Expand Down