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

bug(vault): Fix panic after token expires #277

Merged
merged 1 commit into from
Sep 28, 2022
Merged

bug(vault): Fix panic after token expires #277

merged 1 commit into from
Sep 28, 2022

Conversation

louisruch
Copy link
Contributor

@louisruch louisruch commented Sep 27, 2022

Created a Vault store, expired it in Vault and waited for Boundary to expire to token. I then ran terraform apply which lead to the panic:

anic: interface conversion: interface {} is nil, not string
2022-09-27T16:48:09.875-0700 [DEBUG] plugin.terraform-provider-boundary:
2022-09-27T16:48:09.875-0700 [DEBUG] plugin.terraform-provider-boundary: goroutine 140 [running]:
2022-09-27T16:48:09.875-0700 [DEBUG] plugin.terraform-provider-boundary: github.com/hashicorp/terraform-provider-boundary/internal/provider.setFromVaultCredentialStoreResponseMap(0xc000209310?, 0x4fc9188?, 0x1)
2022-09-27T16:48:09.875-0700 [DEBUG] plugin.terraform-provider-boundary: 	/Users/louisruch/terraform-provider-boundary/internal/provider/resource_credential_store_vault.go:146 +0x525

Rebuilt with the new code changes and it did not panic but gave the following warning:

Screen Shot 2022-09-27 at 4 50 31 PM

@louisruch
Copy link
Contributor Author

@johanbrandhorst @ddebko This fixes a panic that was occurring because the Vault Token HMAC is not returned for expired tokens, only the token_status is returned. I added details of my test to the description

Copy link
Contributor

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants