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

openapi: Fix approle reponse duration types #25510

Merged
merged 3 commits into from
Feb 21, 2024
Merged

openapi: Fix approle reponse duration types #25510

merged 3 commits into from
Feb 21, 2024

Conversation

averche
Copy link
Contributor

@averche averche commented Feb 19, 2024

Fixing the types of the various duration / TTL fields in AppRole responses

framework.TypeDurationSecond => framework.Int64.

Since the actual values returned in the AppRole responses are integers, switching to Int64 is more explicit and will fix the parsing issues in hashicorp/vault-client-go#249.

Background

framework.TypeDurationSecond can be either a string (e.g. 24h) or an integer. It does not translate well into OpenAPI schema and we currently map it to a string:

vault/sdk/framework/openapi.go

Lines 1065 to 1067 in 633dae1

case TypeDurationSecond, TypeSignedDurationSecond:
ret.baseType = "string"
ret.format = "duration"

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Feb 19, 2024
@averche averche marked this pull request as ready for review February 19, 2024 19:04
Copy link

github-actions bot commented Feb 19, 2024

CI Results:
All Go tests succeeded! ✅

Copy link

Build Results:
All builds succeeded! ✅

@averche averche merged commit 8af67e1 into main Feb 21, 2024
108 of 133 checks passed
@averche averche deleted the fix-approle-types branch February 21, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants