vault/website/content/api-docs/secret
Max Bowsher 43ae739971
Refactor identity/mfa/method/* endpoints to fix bad OpenAPI (#20879)
* Refactor `identity/mfa/method/*` endpoints to fix bad OpenAPI

There is a problem with how the `identity/mfa/method/*` endpoints are
defined, resulting in incorrect OpenAPI generation.

I raised hashicorp/vault-client-go#180 to track a consequence, and
opened #20873 which explains the problem and adds a log message to
detect it.

This PR is now the fix.

It's actually quite an interesting problem, that has come about through
some particular implementation choices, in Vault's first/only case where
REST API objects are created by writing to the collection URL, and have
their ID allocated by the server, instead of the client.

The triggering cause of the malfunction was trying to have a single
framework.Path struct instance which optionally includes or excludes the
method_id path parameter, and also another framework.Path struct
instance handling list operations.

The fix is to simplify the path regexes, and have one framework.Path
which handles the method_id being present, and one that handles it being
absent.

The diff is somewhat large, because the affected code had been
copy/pasted four times (TOTP, Okta, Duo, PingID) - so I took the
opportunity to fix the duplication, creating appropriate helper methods
so that the quadruplicated code could be re-unified.

* Revise documentation

This update refactors how the documentation presents these endpoints to
users, both for clarity, and to align with the new structure of the
code.

From a user perspective, it clears up some unclear presentation of when
the `method_id` parameter should and should not be present, adds
a missing description of the response to create requests, and changes
the `method_id` parameter name to be used consistently (rather than `id`
in some cases, unlike the actual code/OpenAPI).

* Fix incorrect acronym (review fix)

* Accept suggestion of tweaked grammar in documentation

Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>

* Add changelog

---------

Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
2023-06-23 13:32:41 -04:00
..
databases website: fix typo in postgresql.mdx (#20847) 2023-05-30 19:28:20 +01:00
identity Refactor identity/mfa/method/* endpoints to fix bad OpenAPI (#20879) 2023-06-23 13:32:41 -04:00
key-management docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
kv Some small KV API docs improvements (#21395) 2023-06-22 13:39:47 -04:00
ad.mdx sdk/ldaputil: add connection_timeout configurable (#20144) 2023-04-13 12:43:28 -04:00
alicloud.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
aws.mdx Update aws static credential fields to match dynamic credential fields (#21017) 2023-06-06 14:30:39 -05:00
azure.mdx secrets/azure: changes permission recommendation to be minimally permissive (#18937) 2023-02-01 11:07:57 -08:00
cassandra.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
consul.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
cubbyhole.mdx Some small KV API docs improvements (#21395) 2023-06-22 13:39:47 -04:00
gcp.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
gcpkms.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
index.mdx feat(website): migrates nav data format and updates docs pages (#11242) 2021-04-06 13:49:04 -04:00
kmip.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
kubernetes.mdx update API docs for kubernetes secrets engine (#20726) 2023-05-26 07:38:22 -07:00
ldap.mdx sdk/ldaputil: add connection_timeout configurable (#20144) 2023-04-13 12:43:28 -04:00
mongodbatlas.mdx add missing mongodb atlas fields to the docs (#20207) 2023-04-17 14:10:07 -07:00
nomad.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
pki.mdx Fix naming of enable_templating parameter (#21319) 2023-06-16 17:04:37 +00:00
rabbitmq.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
ssh.mdx Update Create Role heading to Create/Update Role (#20000) 2023-04-06 11:42:22 +01:00
terraform.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
totp.mdx docs: Migrate link formats (#18696) 2023-01-25 16:12:15 -08:00
transform.mdx Document the 'convergent' tokenization transform option (#19249) 2023-02-17 13:15:40 -06:00
transit.mdx Remove bump_version from transit import docs (#21393) 2023-06-21 15:36:52 -04:00