adjust test code to allow for using Okta LDAP in integration tests

- Okta LDAP requires using a different groups search filter.
- It also does not support posix groups, so make that expected
  value optional.
This commit is contained in:
Ryan Richard
2025-07-31 15:16:10 -07:00
parent 088f88bdc0
commit a038aeb8f0
8 changed files with 14 additions and 9 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
@@ -172,7 +173,7 @@ func TestAuditLogsDuringLogin_Disruptive(t *testing.T) {
"message": "Session Started",
"personalInfo": map[string]any{
"username": "redacted",
"groups": []any{"redacted 2 values"},
"groups": []any{fmt.Sprintf("redacted %d values", len(expectedGroups))},
"subject": "redacted",
"additionalClaims": map[string]any{"redacted": "redacted 0 keys"},
},
@@ -208,7 +209,7 @@ func TestAuditLogsDuringLogin_Disruptive(t *testing.T) {
},
"personalInfo": map[string]any{
"username": "redacted",
"groups": []any{"redacted 2 values"},
"groups": []any{fmt.Sprintf("redacted %d values", len(expectedGroups))},
"extras": map[string]any{"redacted": "redacted 1 keys"},
},
},
+1 -1
View File
@@ -2010,7 +2010,7 @@ func setupClusterForEndToEndLDAPTest(t *testing.T, username string, env *testlib
},
GroupSearch: idpv1alpha1.LDAPIdentityProviderGroupSearch{
Base: env.SupervisorUpstreamLDAP.GroupSearchBase,
Filter: "", // use the default value of "member={}"
Filter: env.SupervisorUpstreamLDAP.GroupSearchFilter, // if empty, uses the default value of "member={}"
Attributes: idpv1alpha1.LDAPIdentityProviderGroupSearchAttributes{
GroupName: "", // use the default value of "dn"
},
@@ -952,7 +952,7 @@ func requireIDPsListedByIDPDiscoveryEndpoint(
},
GroupSearch: idpv1alpha1.LDAPIdentityProviderGroupSearch{
Base: env.SupervisorUpstreamLDAP.GroupSearchBase,
Filter: "", // use the default value of "member={}"
Filter: env.SupervisorUpstreamLDAP.GroupSearchFilter, // if empty, uses the default value of "member={}"
Attributes: idpv1alpha1.LDAPIdentityProviderGroupSearchAttributes{
GroupName: "", // use the default value of "dn"
},
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
// Copyright 2024-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package integration
@@ -63,7 +63,7 @@ func TestLDAPIDPPhaseAndConditions_Parallel(t *testing.T) {
},
GroupSearch: idpv1alpha1.LDAPIdentityProviderGroupSearch{
Base: env.SupervisorUpstreamLDAP.GroupSearchBase,
Filter: "", // use the default value of "member={}"
Filter: env.SupervisorUpstreamLDAP.GroupSearchFilter, // if empty, uses the default value of "member={}"
Attributes: idpv1alpha1.LDAPIdentityProviderGroupSearchAttributes{
GroupName: "", // use the default value of "dn"
},
+1 -1
View File
@@ -277,7 +277,7 @@ func TestSupervisorLogin_Browser(t *testing.T) {
},
GroupSearch: idpv1alpha1.LDAPIdentityProviderGroupSearch{
Base: env.SupervisorUpstreamLDAP.GroupSearchBase,
Filter: "",
Filter: env.SupervisorUpstreamLDAP.GroupSearchFilter, // if empty, uses the default value of "member={}"
UserAttributeForFilter: "",
Attributes: idpv1alpha1.LDAPIdentityProviderGroupSearchAttributes{
GroupName: "dn",