mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
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:
@@ -317,7 +317,19 @@ func (p *Path) helpCallback(b *Backend) OperationFunc {
|
||||
}
|
||||
|
||||
// Build OpenAPI response for this path
|
||||
doc := NewOASDocument()
|
||||
vaultVersion := "unknown"
|
||||
if b.System() != nil {
|
||||
// b.System() should always be non-nil, except tests might create a
|
||||
// Backend without one.
|
||||
env, err := b.System().PluginEnv(context.Background())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if env != nil {
|
||||
vaultVersion = env.VaultVersion
|
||||
}
|
||||
}
|
||||
doc := NewOASDocument(vaultVersion)
|
||||
if err := documentPath(p, b.SpecialPaths(), requestResponsePrefix, false, b.BackendType, doc); err != nil {
|
||||
b.Logger().Warn("error generating OpenAPI", "error", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user