From 889ee8adcc211e3006a6a41566ddfc29f38117ce Mon Sep 17 00:00:00 2001 From: Pablo RUTH Date: Fri, 8 Apr 2022 11:31:29 +0200 Subject: [PATCH] Add paging to member attribute on group read --- go.mod | 2 +- go.sum | 5 ++--- ldap/data_source_resource_ldap_group.go | 10 +++++----- ldap/resource_ldap_group.go | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 77e0463..264c3f7 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/Ouest-France/terraform-provider-ldap go 1.17 require ( - github.com/Ouest-France/goldap v0.5.4 + github.com/Ouest-France/goldap v0.5.5 github.com/go-ldap/ldap/v3 v3.4.2 github.com/hashicorp/terraform-plugin-sdk/v2 v2.13.0 ) diff --git a/go.sum b/go.sum index c8ad4f9..04fc087 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzS github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Ouest-France/goldap v0.5.4 h1:3EGfLvsGg7G4eIhNbrG8rZidOACYSI5HbJDlKgG7BXo= -github.com/Ouest-France/goldap v0.5.4/go.mod h1:88ORqN+X8jHO+NOV8AvjBGIeZmxzQrh8gK1FDRRQ8js= +github.com/Ouest-France/goldap v0.5.5 h1:7WOWMf9UXL+ZnP/43O+eUX5NCtUzjSbrmwxr+7ck5Ms= +github.com/Ouest-France/goldap v0.5.5/go.mod h1:XuJUZlzUQJPDX1KNlTqnjXdJcKs0Vdlp7nsoefb7zuU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -57,7 +57,6 @@ github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-ldap/ldap/v3 v3.4.1/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjRvjKpyMg= github.com/go-ldap/ldap/v3 v3.4.2 h1:zFZKcXKLqZpFMrMQGHeHWKXbDTdNCmhGY9AK41zPh+8= github.com/go-ldap/ldap/v3 v3.4.2/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjRvjKpyMg= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= diff --git a/ldap/data_source_resource_ldap_group.go b/ldap/data_source_resource_ldap_group.go index 12f2214..04bf640 100644 --- a/ldap/data_source_resource_ldap_group.go +++ b/ldap/data_source_resource_ldap_group.go @@ -19,22 +19,22 @@ func dataSourceLDAPGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "ou": &schema.Schema{ + "ou": { Description: "OU where LDAP group will be search.", Type: schema.TypeString, Required: true, }, - "name": &schema.Schema{ + "name": { Description: "LDAP group name.", Type: schema.TypeString, Required: true, }, - "description": &schema.Schema{ + "description": { Description: "Description attribute for the LDAP", Type: schema.TypeString, Computed: true, }, - "members": &schema.Schema{ + "members": { Description: "LDAP group members.", Type: schema.TypeSet, Computed: true, @@ -42,7 +42,7 @@ func dataSourceLDAPGroup() *schema.Resource { Type: schema.TypeString, }, }, - "group_type": &schema.Schema{ + "group_type": { Description: "Type of the group", Type: schema.TypeString, Computed: true, diff --git a/ldap/resource_ldap_group.go b/ldap/resource_ldap_group.go index 4ca0412..70f5810 100644 --- a/ldap/resource_ldap_group.go +++ b/ldap/resource_ldap_group.go @@ -96,7 +96,7 @@ func resourceLDAPGroupRead(ctx context.Context, d *schema.ResourceData, m interf dn := d.Id() - attributes, err := client.ReadGroup(dn) + attributes, err := client.ReadGroup(dn, 1500) if err != nil { if err.(*ldap.Error).ResultCode == 32 { // Object doesn't exist