From ac2325d801c2ccccd29ae67425135b02b0e6533a Mon Sep 17 00:00:00 2001 From: Annalise Diroff Date: Mon, 11 Apr 2022 12:26:51 -0700 Subject: [PATCH 1/2] Fix script and enable database --- scripts/gen_openapi.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/gen_openapi.sh b/scripts/gen_openapi.sh index e98633b295e5..b85b3c61c4e5 100755 --- a/scripts/gen_openapi.sh +++ b/scripts/gen_openapi.sh @@ -34,7 +34,7 @@ while read -r line; do codeLinesStarted=true elif [ $codeLinesStarted = true ] && [[ $line = *"}"* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line =~ $inQuotesRegex ]] && [[ $line != *"Deprecated"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line =~ $inQuotesRegex ]] ; then backend=${BASH_REMATCH[0]} plugin=$(sed -e 's/^"//' -e 's/"$//' <<<"$backend") vault auth enable "${plugin}" @@ -48,13 +48,14 @@ while read -r line; do codeLinesStarted=true elif [ $codeLinesStarted = true ] && [[ $line = *"}"* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line =~ $inQuotesRegex ]] && [[ $line != *"Deprecated"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line =~ $inQuotesRegex ]] ; then backend=${BASH_REMATCH[0]} plugin=$(sed -e 's/^"//' -e 's/"$//' <<<"$backend") vault secrets enable "${plugin}" fi done <../../vault/helper/builtinplugins/registry.go +vault secrets enable database # Enable enterprise features entRegFile=../../vault/helper/builtinplugins/registry_util_ent.go @@ -68,7 +69,7 @@ if [ -f $entRegFile ] && [[ -n "$VAULT_LICENSE" ]]; then codeLinesStarted=true elif [ $codeLinesStarted = true ] && [[ $line = *"}"* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line =~ $inQuotesRegex ]] && [[ $line != *"Deprecated"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line =~ $inQuotesRegex ]] ; then backend=${BASH_REMATCH[0]} plugin=$(sed -e 's/^"//' -e 's/"$//' <<<"$backend") vault secrets enable "${plugin}" From 9e62584ecd06e72b0d8346e449ebe80c2625e7f3 Mon Sep 17 00:00:00 2001 From: Annalise Diroff Date: Mon, 11 Apr 2022 13:33:34 -0700 Subject: [PATCH 2/2] Add deprecated flag to operatoins --- sdk/framework/openapi.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sdk/framework/openapi.go b/sdk/framework/openapi.go index 87240ecc8586..cb5f0a28fbfa 100644 --- a/sdk/framework/openapi.go +++ b/sdk/framework/openapi.go @@ -325,7 +325,7 @@ func documentPath(p *Path, specialPaths *logical.Paths, requestResponsePrefix st op.Summary = props.Summary op.Description = props.Description - op.Deprecated = props.Deprecated + op.Deprecated = props.Deprecated || isDeprecatedPlugin(requestResponsePrefix) // Add any fields not present in the path as body parameters for POST. if opType == logical.CreateOperation || opType == logical.UpdateOperation { @@ -760,3 +760,15 @@ func (d *OASDocument) CreateOperationIDs(context string) { } } } + +func isDeprecatedPlugin(plugin string) bool { + deprecatedPlugins := []string{"pcf", "cassandra", "mongodb", "mssql", "mysql", "postgresql"} + + for _, v := range deprecatedPlugins { + if v == plugin { + return true + } + } + + return false +}