-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
vault /auth/token/create
returns ignoring unrecognized parameters [meta]
when creating token
#18550
Labels
Comments
noahehall
changed the title
vault
vault Dec 24, 2022
/auth/token/create
returns ignoring unrecognized parameters [meta] when creating token and
display_name` not being set/auth/token/create
returns ignoring unrecognized parameters [meta]
when creating token and display_name
not being set
noahehall
changed the title
vault
vault Dec 25, 2022
/auth/token/create
returns ignoring unrecognized parameters [meta]
when creating token and display_name
not being set/auth/token/create
returns ignoring unrecognized parameters [meta]
when creating token
maxb
added a commit
to maxb/vault
that referenced
this issue
Dec 26, 2022
Fixes hashicorp#18550 Currently, the `auth/token/create` family of APIs (`create`, `create-orphan`, `create/{role}`) does non-standard parsing of requests, by directly using `mapstructure.WeakDecode(request.Data, ...)` instead of using the standard `framework.FieldData` abstraction. Furthermore, the fields declared for these APIs are incorrect, leading to inappropriate OpenAPI generation, and inappropriate warnings about ignored parameters. Detailed changes: * Factor out triplicated definitions of common fields across these three APIs. * Remove incorrect `role_name` field from `create-orphan`. * Add missing `lease` deprecated field. * Rename incorrectly named `metadata` field to `meta`, and change from `TypeMap` to `TypeKVPairs` to reflect actual underlying Go type is `map[string]string`. * Remove entirely incorrect `format` field. * Add declarative `Default: true` to `renewable` field, to match behaviour currently implemented in code. * Having fixed the field definitions to match current usage, remove the secondary decoding of the request via `mapstructure` inside `handleCreateCommon`, and migrate to using `FieldData` APIs like a normal operation function.
averche
pushed a commit
that referenced
this issue
Jul 10, 2023
* Fix aspects of `auth/token/create` request parsing Fixes #18550 Currently, the `auth/token/create` family of APIs (`create`, `create-orphan`, `create/{role}`) does non-standard parsing of requests, by directly using `mapstructure.WeakDecode(request.Data, ...)` instead of using the standard `framework.FieldData` abstraction. Furthermore, the fields declared for these APIs are incorrect, leading to inappropriate OpenAPI generation, and inappropriate warnings about ignored parameters. Detailed changes: * Factor out triplicated definitions of common fields across these three APIs. * Remove incorrect `role_name` field from `create-orphan`. * Add missing `lease` deprecated field. * Rename incorrectly named `metadata` field to `meta`, and change from `TypeMap` to `TypeKVPairs` to reflect actual underlying Go type is `map[string]string`. * Remove entirely incorrect `format` field. * Add declarative `Default: true` to `renewable` field, to match behaviour currently implemented in code. * Having fixed the field definitions to match current usage, remove the secondary decoding of the request via `mapstructure` inside `handleCreateCommon`, and migrate to using `FieldData` APIs like a normal operation function. * Add changelog * Rephrase comment.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A clear and concise description of what the bug is.
/auth/token/create
returnsignoring unrecognized parameters [meta]
when creating tokenTo Reproduce
Steps to reproduce the behavior:
/auth/token/create
Expected behavior
A clear and concise description of what you expected to happen.
Environment:
vault status
):vault version
):Vault server configuration file(s):
Additional context
The text was updated successfully, but these errors were encountered: