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

Update various Authentication Resources for Vault 1.2 #478

Merged
merged 9 commits into from
Aug 2, 2019

Conversation

lawliet89
Copy link
Contributor

@lawliet89 lawliet89 commented Jul 29, 2019

Vault 1.2 has the change:

auth/token: Token store roles use new, common token fields for the values that overlap with other auth backends. period, explicit_max_ttl, and bound_cidrs will continue to work, with priority being given to the token_ prefixed versions of those parameters. They will also be returned when doing a read on the role if they were used to provide values initially; however, in Vault 1.4 if period or explicit_max_ttl is zero they will no longer be returned. (explicit_max_ttl was already not returned if empty.)

This causes the provider to panic when used with Vault 1.2.

This PR attempts to fix these panics by deprecating some fields and adding new ones.

TODOs:

  • Update resource_cert_auth_backend_role
  • Update Documentation
  • Some more tests

Questions for @tyrannosaurus-becks :

  • Some resources requires setting all fields or omitted fields get reset to defaults. This makes it hard for the provider to provide backward compatibility because we now have to set all new token_ fields when updating or they get reset. I think this can be done by querying Vault for its version but it adds complexity.
  • There's quite a bit of complexity for backwards support and it's hard to test. Do you think it's worth doing a major version bump and breaking compatibility?

@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Aug 2, 2019
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

Wow. Thank you, this is very much appreciated and quite excellent. Well done.

@@ -9,7 +9,7 @@ import (
"os"
"sort"

"github.com/hashicorp/vault/logical/framework"
"github.com/hashicorp/vault/sdk/framework"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch! Thank you!

@tyrannosaurus-becks tyrannosaurus-becks merged commit 5b6ad5f into hashicorp:master Aug 2, 2019
@lawliet89
Copy link
Contributor Author

I will submit a new pr to update the documentation.

@StephenWithPH
Copy link

@lawliet89 and @tyrannosaurus-becks and @paddycarver : this is great work; we've been waiting for this.

Purely an FYI: we were waiting on this so much that we enabled GitHub release notifications, but we didn't get a notification for this release. After digging, I learned that:

Without adding a message to the release, it only counts as a "tag" and not as a full release.

I suspect this also explains why the releases page doesn't emphasize release 2.2.0... it thinks this was just a tag.

Screenshot from 2019-08-09 11-39-32

@42wim
Copy link

42wim commented Aug 16, 2019

This breaks nomad's vault integration, it still expects Period.

https://github.com/hashicorp/nomad/blob/83a75b310d60b6e9f3c6ca6d43c0a5ee104ef3fd/nomad/vault.go#L902-L904

@kalafut
Copy link
Contributor

kalafut commented Nov 19, 2019

Note to future readers: This change first appeared in version 2.2.0 of the provider.

dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
Update various Authentication Resources for Vault 1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants