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

Fix bug where provider_config only used strings #960

Merged
merged 10 commits into from
Jul 12, 2021
Merged

Conversation

jasonodonnell
Copy link
Contributor

A bug was recently introduced with the new provider_config parameter because the TypeMap was casting everything to a string. This parameter can have mixed types, like when configuring GSuite.

This updates the provider_config to support all known provider_config settings.

Currently the tests pass but when testing gsuite, the backend actually tries to open and verify the JSON service account file. Since we're using a remote docker host which we don't have access to, its currently not possible to check this without auth engine changes or switching to a machine executor. I'll circle back to this next week and wrap up the testing changes.

Fixes #957.

vault/resource_jwt_auth_backend.go Outdated Show resolved Hide resolved
vault/resource_jwt_auth_backend.go Outdated Show resolved Hide resolved
@tx-kstav
Copy link

Hey @jasonodonnell, just tested this and it works! The oidc backend gets created correctly, I can use it to log in to Vault. I am not sure about @tvoran 's comments, but thank you for the quick work :)
Looking forward to this getting merged before the next release!

Let me know if you need anything tested (or double/triple tested).

.circleci/config.yml Outdated Show resolved Hide resolved
vault/resource_jwt_auth_backend_test.go Show resolved Hide resolved
@ghost ghost added size/M and removed size/L labels Feb 1, 2021
@ghost ghost added size/L and removed size/M labels Feb 1, 2021
@ghost ghost added size/M and removed size/L labels Feb 1, 2021
@ghost ghost added size/L and removed size/M labels Feb 1, 2021
@tvoran tvoran self-requested a review February 2, 2021 22:41
vault/resource_jwt_auth_backend_test.go Outdated Show resolved Hide resolved
vault/resource_jwt_auth_backend_test.go Outdated Show resolved Hide resolved
@bluemalkin
Copy link

Any chance of merging this ?

@thorfour
Copy link

Just ran into this bug, any chance this gets merged soon?

jasonodonnell and others added 2 commits July 12, 2021 11:00
@jasonodonnell jasonodonnell merged commit 56fa28d into master Jul 12, 2021
@jasonodonnell jasonodonnell deleted the provider-config branch July 12, 2021 15:43
@sam-allen-skyspecs
Copy link
Contributor

Hooray!

@jasonodonnell
Copy link
Contributor Author

When fixing this bug I introduced an upgrade error. We're looking into solutions internally but this bug was disclosed here #1112 and a small workaround provided if this is blocking you. Sorry for the inconvenience!

jasonodonnell added a commit that referenced this pull request Jul 23, 2021
jasonodonnell added a commit that referenced this pull request Jul 23, 2021
davidmontoyago pushed a commit to davidmontoyago/terraform-provider-vault that referenced this pull request Aug 17, 2021
* Fix bug where provider_config only used strings

* Simplify sort, add hash comment

* Fix circle config

* Add hashing function

* Update test

* Revert hash func

* Update

* Skip JWT tests

* Update vault/resource_jwt_auth_backend_test.go

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

* Add env to configure service account location

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
davidmontoyago pushed a commit to davidmontoyago/terraform-provider-vault that referenced this pull request Aug 17, 2021
@gpapakyriakopoulos
Copy link

@davidmontoyago Hello there. I am currently experiencing this exact issue with provider v2 and I tried to update to latest v2 version with no avail. From what I can understand above, the fix for this was reverted ? Is there a version where this issue is fixed as it is currently severely affecting our deployment ? Thanks!

@benashz
Copy link
Contributor

benashz commented Apr 28, 2022

Hi @gpapakyriakopoulos, neither v2 nor v3 contains this fix. I believe we reverted this fix since caused some issues with preexisting Terraform deployments. We will take another look at this issue in the future, but we wouldn't really be able to commit to an exact date for a fix at present.

Please note that v2 is no longer being maintained. It's best to upgrade to v3 when you have a chance. Please see the version 3 upgrade guide for more details.

Thanks,

Ben

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.

vault_jwt_auth_backend for type oidc: provider_config is parsing everything as String
9 participants