Skip to content

Commit c53ae0d

Browse files
Fixed path error
1 parent 8aee0b3 commit c53ae0d

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

mongodbatlas/ldap_configurations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (s *LDAPConfigurationsServiceOp) Delete(ctx context.Context, groupID string
188188
return nil, nil, NewArgError("groupID", "must be set")
189189
}
190190

191-
path := fmt.Sprintf(ldapConfigurationPath, groupID)
191+
path := fmt.Sprintf(ldapConfigurationPath + "/ldap/userToDNMapping", groupID)
192192

193193
req, err := s.Client.NewRequest(ctx, http.MethodDelete, path, nil)
194194
if err != nil {

mongodbatlas/ldap_configurations_test.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func TestLDAPConfigurations_Delete(t *testing.T) {
232232

233233
groupID := "535683b3794d371327b"
234234

235-
mux.HandleFunc(fmt.Sprintf("/groups/%s/userSecurity", groupID), func(w http.ResponseWriter, r *http.Request) {
235+
mux.HandleFunc(fmt.Sprintf("/groups/%s/userSecurity/ldap/userToDNMapping", groupID), func(w http.ResponseWriter, r *http.Request) {
236236
testMethod(t, r, http.MethodDelete)
237237
fmt.Fprint(w, `{
238238
"ldap" : {
@@ -241,11 +241,7 @@ func TestLDAPConfigurations_Delete(t *testing.T) {
241241
"authzQueryTemplate" : "{USER}?memberOf?base",
242242
"bindUsername" : "CN=Administrator,CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com",
243243
"hostname" : "atlas-ldaps-01.ldap.myteam.com",
244-
"port" : 636,
245-
"userToDNMapping" : [ {
246-
"match" : "(.*)",
247-
"substitution" : "CN={0},CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com"
248-
} ]
244+
"port" : 636
249245
}
250246
}`)
251247
})
@@ -262,12 +258,6 @@ func TestLDAPConfigurations_Delete(t *testing.T) {
262258
Hostname: "atlas-ldaps-01.ldap.myteam.com",
263259
Port: 636,
264260
BindUsername: "CN=Administrator,CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com",
265-
UserToDNMapping: []*UserToDNMapping{
266-
{
267-
Match: "(.*)",
268-
Substitution: "CN={0},CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com",
269-
},
270-
},
271261
AuthzQueryTemplate: "{USER}?memberOf?base",
272262
},
273263
}

0 commit comments

Comments
 (0)