From ed742079277687806d3f14baa0e09ce655e5c8ed Mon Sep 17 00:00:00 2001 From: Anton Averchenkov Date: Tue, 31 Jan 2023 17:52:50 -0500 Subject: [PATCH 1/3] Change gen_openapi.sh to generate schema with generic mount paths --- scripts/gen_openapi.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/gen_openapi.sh b/scripts/gen_openapi.sh index 0119a3198bb6..bd2d0522deb5 100755 --- a/scripts/gen_openapi.sh +++ b/scripts/gen_openapi.sh @@ -20,7 +20,7 @@ then exit 1 fi -vault server -dev -dev-root-token-id=root & +../bin/vault server -dev -dev-root-token-id=root & sleep 2 VAULT_PID=$! @@ -36,7 +36,7 @@ while read -r line; do codeLinesStarted=true elif [[ $line == *"databasePlugins:"* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* || $line == *"consts.Removed"* ]] ; then auth_plugin_previous="" elif [ $codeLinesStarted = true ] && [[ $line =~ ^\s*\"(.*)\"\:.*$ ]] ; then auth_plugin_current=${BASH_REMATCH[1]} @@ -63,7 +63,7 @@ while read -r line; do codeLinesStarted=true elif [[ $line == *"addExternalPlugins("* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* || $line == *"consts.Removed"* ]] ; then secrets_plugin_previous="" elif [ $codeLinesStarted = true ] && [[ $line =~ ^\s*\"(.*)\"\:.*$ ]] ; then secrets_plugin_current=${BASH_REMATCH[1]} @@ -94,7 +94,7 @@ if [ -f $entRegFile ] && [[ -n "${VAULT_LICENSE}" ]]; then codeLinesStarted=true elif [[ $line == *"addExtPluginsEntImpl("* ]] ; then break - elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* ]] ; then + elif [ $codeLinesStarted = true ] && [[ $line == *"consts.Deprecated"* || $line == *"consts.PendingRemoval"* || $line == *"consts.Removed"* ]] ; then secrets_plugin_previous="" elif [ $codeLinesStarted = true ] && [[ $line =~ ^\s*\"(.*)\"\:.*$ ]] ; then ent_plugin_current=${BASH_REMATCH[1]} @@ -116,9 +116,13 @@ fi # Output OpenAPI, optionally formatted if [ "$1" == "-p" ]; then - curl -H "X-Vault-Token: root" "http://127.0.0.1:8200/v1/sys/internal/specs/openapi" | jq > openapi.json + curl --header 'X-Vault-Token: root' \ + --data '{"generic_mount_paths": true}' \ + 'http://127.0.0.1:8200/v1/sys/internal/specs/openapi' | jq > openapi.json else - curl -H "X-Vault-Token: root" "http://127.0.0.1:8200/v1/sys/internal/specs/openapi" > openapi.json + curl --header 'X-Vault-Token: root' \ + --data '{"generic_mount_paths": true}' \ + 'http://127.0.0.1:8200/v1/sys/internal/specs/openapi' > openapi.json fi kill $VAULT_PID From 52d204828b74fea0c178fce74d1f3abe52baacbb Mon Sep 17 00:00:00 2001 From: Anton Averchenkov Date: Tue, 31 Jan 2023 18:07:03 -0500 Subject: [PATCH 2/3] changelog --- changelog/18934.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/18934.txt diff --git a/changelog/18934.txt b/changelog/18934.txt new file mode 100644 index 000000000000..e84f6667ccb2 --- /dev/null +++ b/changelog/18934.txt @@ -0,0 +1,3 @@ +```release-note:improvement +openapi: Change gen_openapi.sh to generate schema with generic mount paths +``` From e0dc0c1470210cec99ce042e1efa7ee97b94068c Mon Sep 17 00:00:00 2001 From: Anton Averchenkov Date: Tue, 31 Jan 2023 18:10:31 -0500 Subject: [PATCH 3/3] remove local testing change --- scripts/gen_openapi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen_openapi.sh b/scripts/gen_openapi.sh index bd2d0522deb5..b92fb883b9ad 100755 --- a/scripts/gen_openapi.sh +++ b/scripts/gen_openapi.sh @@ -20,7 +20,7 @@ then exit 1 fi -../bin/vault server -dev -dev-root-token-id=root & +vault server -dev -dev-root-token-id=root & sleep 2 VAULT_PID=$!