be able to debug LDAP queries; be consistent between GetUserAccount() and ListUserAccounts() on how to build the search filters; objectClasses were missing in GetUserAccount research filter leading to a bad result for example when a posixgGroup have the same name as a posixUser.

This commit is contained in:
tannevaled
2025-08-29 10:50:08 +02:00
parent 5ea9c6e956
commit fbde51b3ea
3 changed files with 36 additions and 8 deletions
+8
View File
@@ -63,6 +63,7 @@ var (
ldapQueryBase, ldapObjClasses string
ldapAccessAtr, ldapSecAtr, ldapRoleAtr string
ldapUserIdAtr, ldapGroupIdAtr string
ldapDebug bool
vaultEndpointURL, vaultSecretStoragePath string
vaultAuthMethod, vaultMountPath string
vaultRootToken, vaultRoleId string
@@ -398,6 +399,12 @@ func initFlags() []cli.Flag {
EnvVars: []string{"VGW_IAM_LDAP_GROUP_ID_ATR"},
Destination: &ldapGroupIdAtr,
},
&cli.BoolFlag{
Name: "iam-ldap-debug",
Usage: "ldap server debug output",
EnvVars: []string{"VGW_IAM_LDAP_DEBUG"},
Destination: &ldapDebug,
},
&cli.StringFlag{
Name: "iam-vault-endpoint-url",
Usage: "vault server url",
@@ -668,6 +675,7 @@ func runGateway(ctx context.Context, be backend.Backend) error {
LDAPRoleAtr: ldapRoleAtr,
LDAPUserIdAtr: ldapUserIdAtr,
LDAPGroupIdAtr: ldapGroupIdAtr,
LDAPDebug: ldapDebug,
VaultEndpointURL: vaultEndpointURL,
VaultSecretStoragePath: vaultSecretStoragePath,
VaultAuthMethod: vaultAuthMethod,