Skip to content

Commit

Permalink
Add paging to member attribute on group read
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-ruth committed Apr 8, 2022
1 parent dae7f74 commit 889ee8a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
10 changes: 5 additions & 5 deletions ldap/data_source_resource_ldap_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@ 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,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"group_type": &schema.Schema{
"group_type": {
Description: "Type of the group",
Type: schema.TypeString,
Computed: true,
Expand Down
2 changes: 1 addition & 1 deletion ldap/resource_ldap_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 889ee8a

Please sign in to comment.