Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for max_page_size in the vault_ldap_auth_backend #1878

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

gothrek22
Copy link
Contributor

@gothrek22 gothrek22 commented May 31, 2023

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #1862

Release note for CHANGELOG:

Fixes #1862 by adding max_page_size parameter and setting it to -1 by default to make it backwards compatible.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

@gothrek22
Copy link
Contributor Author

Tests fail on panic: no vault token found which I'm not sure if it's related to the change.

@gothrek22
Copy link
Contributor Author

@laugmanuel , @vinay-gopalan , @raymonstah please take a look, if anything needs changing please let me know.

@@ -67,6 +67,11 @@ func ldapAuthBackendResource() *schema.Resource {
Optional: true,
Computed: true,
},
"max_page_size": {
Type: schema.TypeInt,
Default: -1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Vault API returns a default for this field then we should not set a Default in the provider. We can instead set this field to Computed: true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that currently Vault API returns the wrong value (0) instead of (-1), which breaks most LDAP implementations, as it causes no results to be sent. They have their own PR with a fix being made, but this change makes it backwards compatible.

https://developer.hashicorp.com/vault/api-docs/auth/ldap#max_page_size

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks for the explanation. I think in this case we can set the Default then.

@gothrek22
Copy link
Contributor Author

@benashz Hi, would it be possible to merge this?

@fairclothjm fairclothjm added this to the 3.17.0 milestone Jun 13, 2023
@fairclothjm fairclothjm merged commit 5638734 into hashicorp:main Jun 13, 2023
2 checks passed
@gothrek22 gothrek22 deleted the feature/max_page_size_support branch June 23, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support max_page_size for vault_ldap_auth_backend
2 participants