Skip to content

Fix duration response types - #260

Open
JaniAnttonen wants to merge 1 commit into
hashicorp:mainfrom
JaniAnttonen:main
Open

Fix duration response types#260
JaniAnttonen wants to merge 1 commit into
hashicorp:mainfrom
JaniAnttonen:main

Conversation

@JaniAnttonen

@JaniAnttonen JaniAnttonen commented Apr 12, 2024

Copy link
Copy Markdown

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
@hashicorp-cla-app

hashicorp-cla-app Bot commented Apr 12, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app

Copy link
Copy Markdown

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
Copy Markdown

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

@barisere

Copy link
Copy Markdown

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

@ArcRiiad

Copy link
Copy Markdown

Any update on this PR?

@WqyJh

WqyJh commented Dec 17, 2024

Copy link
Copy Markdown

Same problem

@WqyJh

WqyJh commented Dec 17, 2024

Copy link
Copy Markdown

This PR contains a huge amount of unnecessary changes, please consider to cherry-pick this commit WqyJh@cd7bc62 instead. @JaniAnttonen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants