mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
Vault API endpoints are defined using regexes in instances of the SDK's framework.Path structure. However, OpenAPI does not use regexes, so a translation is performed. It is technically possible that this translation produces colliding OpenAPI paths from multiple framework.Path structures. When this happens, there has formerly been no diagnostic, and one result silently overwrites the other in a map. As a result of this, several operations are currently accidentally missing from the Vault OpenAPI, which is also the trigger for https://github.com/hashicorp/vault-client-go/issues/180. This PR adds a log message, to help catch such accidents so that they can be fixed. Much of the PR is propagating a logger to the point where it is needed, and adjusting tests for the API change. With current Vault, this will result in the following being logged each time a request is made which triggers OpenAPI generation: ``` [WARN] secrets.identity.identity_0cd35e4d: OpenAPI spec generation: multiple framework.Path instances generated the same path; last processed wins: path=/mfa/method [WARN] secrets.identity.identity_0cd35e4d: OpenAPI spec generation: multiple framework.Path instances generated the same path; last processed wins: path=/mfa/method/totp [WARN] secrets.identity.identity_0cd35e4d: OpenAPI spec generation: multiple framework.Path instances generated the same path; last processed wins: path=/mfa/method/okta [WARN] secrets.identity.identity_0cd35e4d: OpenAPI spec generation: multiple framework.Path instances generated the same path; last processed wins: path=/mfa/method/duo [WARN] secrets.identity.identity_0cd35e4d: OpenAPI spec generation: multiple framework.Path instances generated the same path; last processed wins: path=/mfa/method/pingid ``` I will submit a further PR to fix the issue - this one is just to add the diagnostic.
Vault SDK libs
This package provides the sdk package which contains code useful for
developing Vault plugins.
Although we try not to break functionality, we reserve the right to reorganize
the code at will and may occasionally cause breaks if they are warranted. As
such we expect the tag of this module will stay less than v1.0.0.
For any major changes we will try to give advance notice in the CHANGES section of Vault's CHANGELOG.md.