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 duration response types #260

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JaniAnttonen
Copy link

@JaniAnttonen JaniAnttonen commented Apr 12, 2024

Description

It seems that recently the return types of duration fields like token ttl have been changed in Hashicorp Vault. I was running tests against Vault v1.13.0 and encountered this error. Updated to v1.16.1 and the issue was still present.

After a while I noticed that others had encountered this too and described the error in detail, linking to a change inside Vault: hashicorp/vault#25510 (Don't know what this actually fixed, seems more likely that it created this issue)

Resolves #257
Resolves #249

How has this been tested?

I've used my fork in a private project in tests and these updates fixed the issue. The tests are running dockerized versions of Hashicorp Vault using testcontainers, and the issue is prevalent in both the default tag testcontainers uses hashicorp/vault:1.13.0 as well as the latest hashicorp/vault:1.16.1. This patch fixes the tests for both versions encountering the error json: cannot unmarshal number into Go struct field AppRoleWriteSecretIdResponse.data.secret_id_ttl of type string.

Also, creators of cert-manager/cert-manager#6601 might be interested in this update since it removes their need for using raw workarounds.

Fix duration return types
@JaniAnttonen JaniAnttonen requested a review from a team as a code owner April 12, 2024 11:47
Copy link

hashicorp-cla-app bot commented Apr 12, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@guru-jani
Copy link

Read and agreed to the CLA with both linked contributor accounts, but it still seems to hang around :O

@barisere
Copy link

Thanks for submitting this fix, @JaniAnttonen. I'm blocked by this, so I'll use your commit for now until this PR is merged.

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