Move version out of SDK. (#14229)

Move version out of SDK.  For now it's a copy rather than move: the part not addressed by this change is sdk/helper/useragent.String, which we'll want to remove in favour of PluginString.  That will have to wait until we've removed uses of useragent.String from all builtins.
This commit is contained in:
Nick Cabatoff
2022-12-07 13:29:51 -05:00
committed by GitHub
parent b2354e5aed
commit 35df9489c7
47 changed files with 289 additions and 65 deletions

View File

@@ -547,7 +547,16 @@ func (b *Backend) handleRootHelp(req *logical.Request) (*logical.Response, error
genericMountPaths, _ := req.Get("genericMountPaths").(bool)
// Build OpenAPI response for the entire backend
doc := NewOASDocument()
vaultVersion := "unknown"
if b.System() != nil {
env, err := b.System().PluginEnv(context.Background())
if err != nil {
return nil, err
}
vaultVersion = env.VaultVersion
}
doc := NewOASDocument(vaultVersion)
if err := documentPaths(b, requestResponsePrefix, genericMountPaths, doc); err != nil {
b.Logger().Warn("error generating OpenAPI", "error", err)
}