This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 0e82b2b5c8 issue #7326 : Add a variable resolver for OpenBAO (#7365)
0e82b2b5c8 is described below
commit 0e82b2b5c8864a8687cb21a71654de274ba3fdda
Author: Matt Casters <[email protected]>
AuthorDate: Wed Jul 1 15:14:00 2026 +0200
issue #7326 : Add a variable resolver for OpenBAO (#7365)
* issue #7326 : Add a variable resolver for OpenBAO
* minor fix
* issue #7326 : Add a variable resolver for OpenBAO (IT fix)
---------
Co-authored-by: Hans Van Akelyen <[email protected]>
---
...esolver.yaml => integration-tests-openbao.yaml} | 18 +-
...-resolver.yaml => integration-tests-vault.yaml} | 0
docs/hop-user-manual/modules/ROOT/nav.adoc | 1 +
.../hashicorp-vault-variable-resolver.adoc | 1 +
.../metadata-types/variable-resolver/index.adoc | 1 +
.../openbao-variable-resolver.adoc | 66 +++++++
.../0001-openbao-add-secrets.hpl} | 4 +-
.../0001-openbao-resolve-secrets-with-prefix.hpl} | 16 +-
.../0001-openbao-resolve-secrets.hpl} | 14 +-
.../0002-pipeline-get-configurations.hpl | 0
.../0002-pipeline-resolver-test.hpl | 0
.../{resolver => openbao}/0003-nested-resolver.hpl | 0
.../datasets/0001-golden-resolved-variables.csv | 0
.../datasets/0002-golden-pipeline-resolver.csv | 0
.../datasets/0003-golden-nested-resolver.csv | 0
.../{resolver => openbao}/dev-env-config.json | 2 +-
.../{resolver => openbao}/files/db1.properties | 0
.../{resolver => openbao}/files/db2.properties | 0
.../{resolver => openbao}/files/db3.properties | 0
.../{resolver => openbao}/hop-config.json | 0
.../main-0001-resolve-secrets.hwf | 12 +-
.../main-0002-pipeline-resolver.hwf | 0
.../main-0003-nested-resolver.hwf | 0
.../dataset/0001-golden-resolved-variables.json | 0
.../dataset/0002-golden-pipeline-resolver.json | 0
.../dataset/0003-golden-nested-resolver.json | 0
.../metadata/pipeline-run-configuration/local.json | 0
.../0001-openbao-resolve-secrets UNIT.json} | 4 +-
...-openbao-resolve-secrets-with-prefix UNIT.json} | 4 +-
.../0002-pipeline-resolver-test UNIT.json | 0
.../unit-test/0003-nested-resolver UNIT.json | 0
.../metadata/variable-resolver/conf.json | 0
.../variable-resolver/openbao-prefix.json} | 8 +-
.../metadata/variable-resolver/openbao.json} | 8 +-
.../metadata/variable-resolver/pipeline.json | 0
.../metadata/workflow-run-configuration/local.json | 0
.../{resolver => openbao}/project-config.json | 0
.../{resolver => vault}/0001-vault-add-secrets.hpl | 0
.../0001-vault-resolve-secrets-with-prefix.hpl | 0
.../0001-vault-resolve-secrets.hpl | 0
.../0002-pipeline-get-configurations.hpl | 0
.../0002-pipeline-resolver-test.hpl | 0
.../{resolver => vault}/0003-nested-resolver.hpl | 0
.../datasets/0001-golden-resolved-variables.csv | 0
.../datasets/0002-golden-pipeline-resolver.csv | 0
.../datasets/0003-golden-nested-resolver.csv | 0
.../{resolver => vault}/dev-env-config.json | 0
.../{resolver => vault}/files/db1.properties | 0
.../{resolver => vault}/files/db2.properties | 0
.../{resolver => vault}/files/db3.properties | 0
.../{resolver => vault}/hop-config.json | 0
.../main-0001-resolve-secrets.hwf | 0
.../main-0002-pipeline-resolver.hwf | 0
.../main-0003-nested-resolver.hwf | 0
.../dataset/0001-golden-resolved-variables.json | 0
.../dataset/0002-golden-pipeline-resolver.json | 0
.../dataset/0003-golden-nested-resolver.json | 0
.../metadata/pipeline-run-configuration/local.json | 0
.../unit-test/0001-vault-resolve-secrets UNIT.json | 0
...001-vault-resolve-secrets-with-prefix UNIT.json | 0
.../0002-pipeline-resolver-test UNIT.json | 0
.../unit-test/0003-nested-resolver UNIT.json | 0
.../metadata/variable-resolver/conf.json | 0
.../metadata/variable-resolver/pipeline.json | 0
.../metadata/variable-resolver/vault-prefix.json | 0
.../metadata/variable-resolver/vault.json | 0
.../metadata/workflow-run-configuration/local.json | 0
.../{resolver => vault}/project-config.json | 0
plugins/tech/vault/pom.xml | 4 +-
...esolver.java => BaseVaultVariableResolver.java} | 68 ++++---
.../resolver/vault/OpenBaoVariableResolver.java | 41 ++++
.../resolver/vault/VaultVariableResolver.java | 210 +--------------------
.../vault/messages/messages_en_US.properties | 1 +
.../vault/messages/messages_pt_BR.properties | 1 +
.../vault/messages/messages_zh_CN.properties | 1 +
75 files changed, 198 insertions(+), 287 deletions(-)
diff --git a/docker/integration-tests/integration-tests-resolver.yaml
b/docker/integration-tests/integration-tests-openbao.yaml
similarity index 81%
copy from docker/integration-tests/integration-tests-resolver.yaml
copy to docker/integration-tests/integration-tests-openbao.yaml
index 6af5ae6e11..c73dfdea61 100644
--- a/docker/integration-tests/integration-tests-resolver.yaml
+++ b/docker/integration-tests/integration-tests-openbao.yaml
@@ -16,26 +16,26 @@
# under the License.
services:
- integration_test_vault:
+ integration_test_openbao:
extends:
file: integration-tests-base.yaml
service: integration_test
depends_on:
- vault:
+ openbao:
condition: service_healthy
links:
- - vault
- vault:
- image: hashicorp/vault
+ - openbao
+ openbao:
+ image: quay.io/openbao/openbao:latest
ports:
- "8200"
environment:
- - VAULT_DEV_ROOT_TOKEN_ID=myroot
- - VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200
+ - BAO_DEV_ROOT_TOKEN_ID=myroot
+ - BAO_DEV_LISTEN_ADDRESS=0.0.0.0:8200
- SKIP_SETCAP=true
- - VAULT_DISABLE_MLOCK=true
+ - BAO_DISABLE_MLOCK=true
healthcheck:
- test: [ "CMD", "wget", "--spider", "--proxy", "off",
"http://vault:8200/v1/sys/health?standbyok=true" ]
+ test: [ "CMD", "wget", "--spider", "--proxy", "off",
"http://openbao:8200/v1/sys/health?standbyok=true" ]
interval: 10s
timeout: 3s
retries: 10
diff --git a/docker/integration-tests/integration-tests-resolver.yaml
b/docker/integration-tests/integration-tests-vault.yaml
similarity index 100%
rename from docker/integration-tests/integration-tests-resolver.yaml
rename to docker/integration-tests/integration-tests-vault.yaml
diff --git a/docs/hop-user-manual/modules/ROOT/nav.adoc
b/docs/hop-user-manual/modules/ROOT/nav.adoc
index 972aeac08d..b81ffb068b 100644
--- a/docs/hop-user-manual/modules/ROOT/nav.adoc
+++ b/docs/hop-user-manual/modules/ROOT/nav.adoc
@@ -464,6 +464,7 @@ under the License.
***
xref:metadata-types/variable-resolver/azure-key-vault-variable-resolver.adoc[Azure
Key Vault variable resolver]
***
xref:metadata-types/variable-resolver/google-secret-manager-variable-resolver.adoc[Google
Secret Manager variable resolver]
***
xref:metadata-types/variable-resolver/hashicorp-vault-variable-resolver.adoc[Hashicorp
Vault variable resolver]
+***
xref:metadata-types/variable-resolver/openbao-variable-resolver.adoc[OpenBAO
variable resolver]
***
xref:metadata-types/variable-resolver/pipeline-variable-resolver.adoc[Pipeline
variable resolver]
** xref:metadata-types/static-schema-definition.adoc[Static Schema Definition]
** xref:hop-server/web-service.adoc[Web Service]
diff --git
a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/hashicorp-vault-variable-resolver.adoc
b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/hashicorp-vault-variable-resolver.adoc
index 85db1acc79..4e8948b83e 100644
---
a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/hashicorp-vault-variable-resolver.adoc
+++
b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/hashicorp-vault-variable-resolver.adoc
@@ -27,6 +27,7 @@ Here are the options to use:
* Vault address: The base address and port of the Vault server (for example:
https://vault-server:8200)
* Vault token: The token to use to authenticate
+* Namespace: The Vault namespace to use (optional, primarily used in
enterprise/multi-tenant setups)
* Path prefix: an optional path prefix which gets added before the key paths
in the resolver expressions. For example, if you put `kv-other/data` in here,
expression
[source]
diff --git
a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/index.adoc
b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/index.adoc
index 9a54924694..c758199e3e 100644
---
a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/index.adoc
+++
b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/index.adoc
@@ -59,4 +59,5 @@ Here are the available variable resolver plugins:
*
xref:metadata-types/variable-resolver/azure-key-vault-variable-resolver.adoc[Azure
Key Vault variable resolver]
*
xref:metadata-types/variable-resolver/google-secret-manager-variable-resolver.adoc[Google
Secret Manager Variable Resolver]
*
xref:metadata-types/variable-resolver/hashicorp-vault-variable-resolver.adoc[Hashicorp
Vault variable resolver]
+* xref:metadata-types/variable-resolver/openbao-variable-resolver.adoc[OpenBAO
variable resolver]
*
xref:metadata-types/variable-resolver/pipeline-variable-resolver.adoc[Pipeline
variable resolver]
diff --git
a/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/openbao-variable-resolver.adoc
b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/openbao-variable-resolver.adoc
new file mode 100644
index 0000000000..4ece79afce
--- /dev/null
+++
b/docs/hop-user-manual/modules/ROOT/pages/metadata-types/variable-resolver/openbao-variable-resolver.adoc
@@ -0,0 +1,66 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+[[OpenBaoVariableResolver]]
+:imagesdir: ../assets/images
+:openvar: #{
+:closevar: }
+:description: This describes the usage of a variable resolver to retrieve
secrets from an OpenBAO vault
+
+== Functionality
+
+This variable resolver can retrieve secrets from an
https://openbao.org/[OpenBAO] instance.
+Here are the options to use:
+
+* OpenBAO address: The base address and port of the OpenBAO server (for
example: https://openbao-server:8200)
+* OpenBAO token: The token to use to authenticate
+* Namespace: The namespace to use (optional, primarily used in
enterprise/multi-tenant setups)
+* Path prefix: an optional path prefix which gets added before the key paths
in the resolver expressions. For example, if you put `kv-other/data` in here,
expression
+
+[source]
+----
+#{openbao:db:password}
+----
+
+will resolve internally to:
+
+[source]
+----
+#{openbao:kv-other/data/db:password}
+----
+
+
+* Validate HTTPS connections?: It's recommended to enable connection
validation in production. This secures the connection with the X.509
certificate specified in one of either next option.
+* PEM file path: The name of the file (VFS) containing the X.509 certificate
string
+* PEM string: The X.509 string itself in case you're not using a file
+* Open connection timeout: The connection timeout when getting a http(s)
connection in milliseconds.
+* Read connection timeout: The timeout in milliseconds when reading.
+
+The variable expression you can resolve with this plugin type is (as always)
in the following format:
+
+`{openvar}name:path-key:value-key{closevar}`
+
+* name: the name of the variable resolver metadata element to use
+* path-key: the path to the secret in OpenBAO.
+* value-key: the key of the value to retrieve.
+
+In case we don't specify a `value-key`, you will give back the complete JSON
string of the secret.
+
+== Example
+
+We can define a connection called `openbao` and retrieve values with
expressions:
+
+* `{openvar}openbao:hop/data/some-db:hostname{closevar}` : localhost
+* `{openvar}openbao:hop/data/some-db:username{closevar}` : john
+* `{openvar}openbao:hop/data/some-db{closevar}` :
`{"db":"test","hostname":"localhost","password":"some-password","port":"3306","username":"john"}`
diff --git a/integration-tests/resolver/0001-vault-add-secrets.hpl
b/integration-tests/openbao/0001-openbao-add-secrets.hpl
similarity index 97%
copy from integration-tests/resolver/0001-vault-add-secrets.hpl
copy to integration-tests/openbao/0001-openbao-add-secrets.hpl
index 445ccfc401..0a1716c55e 100644
--- a/integration-tests/resolver/0001-vault-add-secrets.hpl
+++ b/integration-tests/openbao/0001-openbao-add-secrets.hpl
@@ -19,7 +19,7 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0001-vault-add-secrets</name>
+ <name>0001-openbao-add-secrets</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@@ -107,7 +107,7 @@ limitations under the License.
<data>
<line>
<item>myroot</item>
- <item>http://vault:8200/v1/secret/data/hop</item>
+ <item>http://openbao:8200/v1/secret/data/hop</item>
<item>application/json</item>
<item>{
"data": {
diff --git
a/integration-tests/resolver/0001-vault-resolve-secrets-with-prefix.hpl
b/integration-tests/openbao/0001-openbao-resolve-secrets-with-prefix.hpl
similarity index 89%
copy from integration-tests/resolver/0001-vault-resolve-secrets-with-prefix.hpl
copy to integration-tests/openbao/0001-openbao-resolve-secrets-with-prefix.hpl
index e19f293819..a5571fb5da 100644
--- a/integration-tests/resolver/0001-vault-resolve-secrets-with-prefix.hpl
+++ b/integration-tests/openbao/0001-openbao-resolve-secrets-with-prefix.hpl
@@ -19,7 +19,7 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0001-vault-resolve-secrets-with-prefix</name>
+ <name>0001-openbao-resolve-secrets-with-prefix</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@@ -53,7 +53,7 @@ limitations under the License.
<height>32</height>
<xloc>48</xloc>
<yloc>112</yloc>
- <note>The vault-prefix resolver contains the path prefix making the
expressions shorter.
+ <note>The openbao-prefix resolver contains the path prefix making the
expressions shorter.
This tests that functionality.</note>
<width>32</width>
</notepad>
@@ -83,7 +83,7 @@ This tests that functionality.</note>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault-prefix:hop}</variable>
+ <variable>#{openbao-prefix:hop}</variable>
</field>
<field>
<length>-1</length>
@@ -91,7 +91,7 @@ This tests that functionality.</note>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault-prefix:hop:hostname}</variable>
+ <variable>#{openbao-prefix:hop:hostname}</variable>
</field>
<field>
<length>-1</length>
@@ -99,7 +99,7 @@ This tests that functionality.</note>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault-prefix:hop:port}</variable>
+ <variable>#{openbao-prefix:hop:port}</variable>
</field>
<field>
<length>-1</length>
@@ -107,7 +107,7 @@ This tests that functionality.</note>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault-prefix:hop:db}</variable>
+ <variable>#{openbao-prefix:hop:db}</variable>
</field>
<field>
<length>-1</length>
@@ -115,7 +115,7 @@ This tests that functionality.</note>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault-prefix:hop:username}</variable>
+ <variable>#{openbao-prefix:hop:username}</variable>
</field>
<field>
<length>-1</length>
@@ -123,7 +123,7 @@ This tests that functionality.</note>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault-prefix:hop:password}</variable>
+ <variable>#{openbao-prefix:hop:password}</variable>
</field>
</fields>
<attributes/>
diff --git a/integration-tests/resolver/0001-vault-resolve-secrets.hpl
b/integration-tests/openbao/0001-openbao-resolve-secrets.hpl
similarity index 89%
copy from integration-tests/resolver/0001-vault-resolve-secrets.hpl
copy to integration-tests/openbao/0001-openbao-resolve-secrets.hpl
index 91e8878485..31cc14a0af 100644
--- a/integration-tests/resolver/0001-vault-resolve-secrets.hpl
+++ b/integration-tests/openbao/0001-openbao-resolve-secrets.hpl
@@ -19,7 +19,7 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0001-vault-resolve-secrets</name>
+ <name>0001-openbao-resolve-secrets</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@@ -62,7 +62,7 @@ limitations under the License.
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault:secret/data/hop}</variable>
+ <variable>#{openbao:secret/data/hop}</variable>
</field>
<field>
<length>-1</length>
@@ -70,7 +70,7 @@ limitations under the License.
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault:secret/data/hop:hostname}</variable>
+ <variable>#{openbao:secret/data/hop:hostname}</variable>
</field>
<field>
<length>-1</length>
@@ -78,7 +78,7 @@ limitations under the License.
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault:secret/data/hop:port}</variable>
+ <variable>#{openbao:secret/data/hop:port}</variable>
</field>
<field>
<length>-1</length>
@@ -86,7 +86,7 @@ limitations under the License.
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault:secret/data/hop:db}</variable>
+ <variable>#{openbao:secret/data/hop:db}</variable>
</field>
<field>
<length>-1</length>
@@ -94,7 +94,7 @@ limitations under the License.
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault:secret/data/hop:username}</variable>
+ <variable>#{openbao:secret/data/hop:username}</variable>
</field>
<field>
<length>-1</length>
@@ -102,7 +102,7 @@ limitations under the License.
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
- <variable>#{vault:secret/data/hop:password}</variable>
+ <variable>#{openbao:secret/data/hop:password}</variable>
</field>
</fields>
<attributes/>
diff --git a/integration-tests/resolver/0002-pipeline-get-configurations.hpl
b/integration-tests/openbao/0002-pipeline-get-configurations.hpl
similarity index 100%
copy from integration-tests/resolver/0002-pipeline-get-configurations.hpl
copy to integration-tests/openbao/0002-pipeline-get-configurations.hpl
diff --git a/integration-tests/resolver/0002-pipeline-resolver-test.hpl
b/integration-tests/openbao/0002-pipeline-resolver-test.hpl
similarity index 100%
copy from integration-tests/resolver/0002-pipeline-resolver-test.hpl
copy to integration-tests/openbao/0002-pipeline-resolver-test.hpl
diff --git a/integration-tests/resolver/0003-nested-resolver.hpl
b/integration-tests/openbao/0003-nested-resolver.hpl
similarity index 100%
copy from integration-tests/resolver/0003-nested-resolver.hpl
copy to integration-tests/openbao/0003-nested-resolver.hpl
diff --git
a/integration-tests/resolver/datasets/0001-golden-resolved-variables.csv
b/integration-tests/openbao/datasets/0001-golden-resolved-variables.csv
similarity index 100%
copy from integration-tests/resolver/datasets/0001-golden-resolved-variables.csv
copy to integration-tests/openbao/datasets/0001-golden-resolved-variables.csv
diff --git
a/integration-tests/resolver/datasets/0002-golden-pipeline-resolver.csv
b/integration-tests/openbao/datasets/0002-golden-pipeline-resolver.csv
similarity index 100%
copy from integration-tests/resolver/datasets/0002-golden-pipeline-resolver.csv
copy to integration-tests/openbao/datasets/0002-golden-pipeline-resolver.csv
diff --git
a/integration-tests/resolver/datasets/0003-golden-nested-resolver.csv
b/integration-tests/openbao/datasets/0003-golden-nested-resolver.csv
similarity index 100%
copy from integration-tests/resolver/datasets/0003-golden-nested-resolver.csv
copy to integration-tests/openbao/datasets/0003-golden-nested-resolver.csv
diff --git a/integration-tests/resolver/dev-env-config.json
b/integration-tests/openbao/dev-env-config.json
similarity index 87%
copy from integration-tests/resolver/dev-env-config.json
copy to integration-tests/openbao/dev-env-config.json
index 2988766768..7c2a4e64ff 100644
--- a/integration-tests/resolver/dev-env-config.json
+++ b/integration-tests/openbao/dev-env-config.json
@@ -13,7 +13,7 @@
"description" : ""
}, {
"name" : "DB_PASSWORD",
- "value" : "#{vault:secret/data/hop:password}",
+ "value" : "#{openbao:secret/data/hop:password}",
"description" : ""
} ]
}
\ No newline at end of file
diff --git a/integration-tests/resolver/files/db1.properties
b/integration-tests/openbao/files/db1.properties
similarity index 100%
copy from integration-tests/resolver/files/db1.properties
copy to integration-tests/openbao/files/db1.properties
diff --git a/integration-tests/resolver/files/db2.properties
b/integration-tests/openbao/files/db2.properties
similarity index 100%
copy from integration-tests/resolver/files/db2.properties
copy to integration-tests/openbao/files/db2.properties
diff --git a/integration-tests/resolver/files/db3.properties
b/integration-tests/openbao/files/db3.properties
similarity index 100%
copy from integration-tests/resolver/files/db3.properties
copy to integration-tests/openbao/files/db3.properties
diff --git a/integration-tests/resolver/hop-config.json
b/integration-tests/openbao/hop-config.json
similarity index 100%
copy from integration-tests/resolver/hop-config.json
copy to integration-tests/openbao/hop-config.json
diff --git a/integration-tests/resolver/main-0001-resolve-secrets.hwf
b/integration-tests/openbao/main-0001-resolve-secrets.hwf
similarity index 92%
copy from integration-tests/resolver/main-0001-resolve-secrets.hwf
copy to integration-tests/openbao/main-0001-resolve-secrets.hwf
index de9c30c47b..28fe6af13f 100644
--- a/integration-tests/resolver/main-0001-resolve-secrets.hwf
+++ b/integration-tests/openbao/main-0001-resolve-secrets.hwf
@@ -50,7 +50,7 @@ limitations under the License.
<attributes_hac/>
</action>
<action>
- <name>0001-vault-add-secrets.hpl</name>
+ <name>0001-openbao-add-secrets.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
@@ -60,7 +60,7 @@ limitations under the License.
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
- <filename>${PROJECT_HOME}/0001-vault-add-secrets.hpl</filename>
+ <filename>${PROJECT_HOME}/0001-openbao-add-secrets.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
@@ -82,10 +82,10 @@ limitations under the License.
<attributes/>
<test_names>
<test_name>
- <name>0001-vault-resolve-secrets UNIT</name>
+ <name>0001-openbao-resolve-secrets UNIT</name>
</test_name>
<test_name>
- <name>0001-vault-resolve-secrets-with-prefix UNIT</name>
+ <name>0001-openbao-resolve-secrets-with-prefix UNIT</name>
</test_name>
</test_names>
<parallel>N</parallel>
@@ -97,13 +97,13 @@ limitations under the License.
<hops>
<hop>
<from>Start</from>
- <to>0001-vault-add-secrets.hpl</to>
+ <to>0001-openbao-add-secrets.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
- <from>0001-vault-add-secrets.hpl</from>
+ <from>0001-openbao-add-secrets.hpl</from>
<to>Run Pipeline Unit Tests</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
diff --git a/integration-tests/resolver/main-0002-pipeline-resolver.hwf
b/integration-tests/openbao/main-0002-pipeline-resolver.hwf
similarity index 100%
copy from integration-tests/resolver/main-0002-pipeline-resolver.hwf
copy to integration-tests/openbao/main-0002-pipeline-resolver.hwf
diff --git a/integration-tests/resolver/main-0003-nested-resolver.hwf
b/integration-tests/openbao/main-0003-nested-resolver.hwf
similarity index 100%
copy from integration-tests/resolver/main-0003-nested-resolver.hwf
copy to integration-tests/openbao/main-0003-nested-resolver.hwf
diff --git
a/integration-tests/resolver/metadata/dataset/0001-golden-resolved-variables.json
b/integration-tests/openbao/metadata/dataset/0001-golden-resolved-variables.json
similarity index 100%
copy from
integration-tests/resolver/metadata/dataset/0001-golden-resolved-variables.json
copy to
integration-tests/openbao/metadata/dataset/0001-golden-resolved-variables.json
diff --git
a/integration-tests/resolver/metadata/dataset/0002-golden-pipeline-resolver.json
b/integration-tests/openbao/metadata/dataset/0002-golden-pipeline-resolver.json
similarity index 100%
copy from
integration-tests/resolver/metadata/dataset/0002-golden-pipeline-resolver.json
copy to
integration-tests/openbao/metadata/dataset/0002-golden-pipeline-resolver.json
diff --git
a/integration-tests/resolver/metadata/dataset/0003-golden-nested-resolver.json
b/integration-tests/openbao/metadata/dataset/0003-golden-nested-resolver.json
similarity index 100%
copy from
integration-tests/resolver/metadata/dataset/0003-golden-nested-resolver.json
copy to
integration-tests/openbao/metadata/dataset/0003-golden-nested-resolver.json
diff --git
a/integration-tests/resolver/metadata/pipeline-run-configuration/local.json
b/integration-tests/openbao/metadata/pipeline-run-configuration/local.json
similarity index 100%
copy from
integration-tests/resolver/metadata/pipeline-run-configuration/local.json
copy to integration-tests/openbao/metadata/pipeline-run-configuration/local.json
diff --git
a/integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
b/integration-tests/openbao/metadata/unit-test/0001-openbao-resolve-secrets
UNIT.json
similarity index 91%
copy from
integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
copy to
integration-tests/openbao/metadata/unit-test/0001-openbao-resolve-secrets
UNIT.json
index ef349db454..d64bd982bd 100644
--- a/integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
+++ b/integration-tests/openbao/metadata/unit-test/0001-openbao-resolve-secrets
UNIT.json
@@ -47,7 +47,7 @@
}
],
"input_data_sets": [],
- "name": "0001-vault-resolve-secrets UNIT",
+ "name": "0001-openbao-resolve-secrets UNIT",
"trans_test_tweaks": [],
- "pipeline_filename": "./0001-vault-resolve-secrets.hpl"
+ "pipeline_filename": "./0001-openbao-resolve-secrets.hpl"
}
\ No newline at end of file
diff --git
a/integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
b/integration-tests/openbao/metadata/unit-test/0001-openbao-resolve-secrets-with-prefix
UNIT.json
similarity index 89%
copy from
integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
copy to
integration-tests/openbao/metadata/unit-test/0001-openbao-resolve-secrets-with-prefix
UNIT.json
index 8a5f7271cc..c5fccc371c 100644
---
a/integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
+++
b/integration-tests/openbao/metadata/unit-test/0001-openbao-resolve-secrets-with-prefix
UNIT.json
@@ -47,7 +47,7 @@
}
],
"input_data_sets": [],
- "name": "0001-vault-resolve-secrets-with-prefix UNIT",
+ "name": "0001-openbao-resolve-secrets-with-prefix UNIT",
"trans_test_tweaks": [],
- "pipeline_filename": "./0001-vault-resolve-secrets-with-prefix.hpl"
+ "pipeline_filename": "./0001-openbao-resolve-secrets-with-prefix.hpl"
}
\ No newline at end of file
diff --git
a/integration-tests/resolver/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
b/integration-tests/openbao/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
similarity index 100%
copy from
integration-tests/resolver/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
copy to
integration-tests/openbao/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
diff --git a/integration-tests/resolver/metadata/unit-test/0003-nested-resolver
UNIT.json b/integration-tests/openbao/metadata/unit-test/0003-nested-resolver
UNIT.json
similarity index 100%
copy from integration-tests/resolver/metadata/unit-test/0003-nested-resolver
UNIT.json
copy to integration-tests/openbao/metadata/unit-test/0003-nested-resolver
UNIT.json
diff --git a/integration-tests/resolver/metadata/variable-resolver/conf.json
b/integration-tests/openbao/metadata/variable-resolver/conf.json
similarity index 100%
copy from integration-tests/resolver/metadata/variable-resolver/conf.json
copy to integration-tests/openbao/metadata/variable-resolver/conf.json
diff --git
a/integration-tests/resolver/metadata/variable-resolver/vault-prefix.json
b/integration-tests/openbao/metadata/variable-resolver/openbao-prefix.json
similarity index 64%
copy from
integration-tests/resolver/metadata/variable-resolver/vault-prefix.json
copy to integration-tests/openbao/metadata/variable-resolver/openbao-prefix.json
index 4f4165e96f..9bde7503ae 100644
--- a/integration-tests/resolver/metadata/variable-resolver/vault-prefix.json
+++ b/integration-tests/openbao/metadata/variable-resolver/openbao-prefix.json
@@ -1,10 +1,10 @@
{
"virtualPath": "",
- "name": "vault-prefix",
- "description": "Hashicorp Vault",
+ "name": "openbao-prefix",
+ "description": "OpenBAO",
"variable-resolver": {
- "Vault-Variable-Resolver": {
- "vaultAddress": "http://vault:8200",
+ "OpenBao-Variable-Resolver": {
+ "vaultAddress": "http://openbao:8200",
"pemString": "",
"openTimeout": "",
"verifyingSsl": false,
diff --git a/integration-tests/resolver/metadata/variable-resolver/vault.json
b/integration-tests/openbao/metadata/variable-resolver/openbao.json
similarity index 61%
copy from integration-tests/resolver/metadata/variable-resolver/vault.json
copy to integration-tests/openbao/metadata/variable-resolver/openbao.json
index ca4c198621..d1107ca33d 100644
--- a/integration-tests/resolver/metadata/variable-resolver/vault.json
+++ b/integration-tests/openbao/metadata/variable-resolver/openbao.json
@@ -1,10 +1,10 @@
{
"virtualPath": "",
- "name": "vault",
- "description": "Hashicorp Vault",
+ "name": "openbao",
+ "description": "OpenBAO",
"variable-resolver": {
- "Vault-Variable-Resolver": {
- "vaultAddress": "http://vault:8200",
+ "OpenBao-Variable-Resolver": {
+ "vaultAddress": "http://openbao:8200",
"pemString": "",
"openTimeout": "",
"verifyingSsl": false,
diff --git
a/integration-tests/resolver/metadata/variable-resolver/pipeline.json
b/integration-tests/openbao/metadata/variable-resolver/pipeline.json
similarity index 100%
copy from integration-tests/resolver/metadata/variable-resolver/pipeline.json
copy to integration-tests/openbao/metadata/variable-resolver/pipeline.json
diff --git
a/integration-tests/resolver/metadata/workflow-run-configuration/local.json
b/integration-tests/openbao/metadata/workflow-run-configuration/local.json
similarity index 100%
copy from
integration-tests/resolver/metadata/workflow-run-configuration/local.json
copy to integration-tests/openbao/metadata/workflow-run-configuration/local.json
diff --git a/integration-tests/resolver/project-config.json
b/integration-tests/openbao/project-config.json
similarity index 100%
copy from integration-tests/resolver/project-config.json
copy to integration-tests/openbao/project-config.json
diff --git a/integration-tests/resolver/0001-vault-add-secrets.hpl
b/integration-tests/vault/0001-vault-add-secrets.hpl
similarity index 100%
rename from integration-tests/resolver/0001-vault-add-secrets.hpl
rename to integration-tests/vault/0001-vault-add-secrets.hpl
diff --git
a/integration-tests/resolver/0001-vault-resolve-secrets-with-prefix.hpl
b/integration-tests/vault/0001-vault-resolve-secrets-with-prefix.hpl
similarity index 100%
rename from
integration-tests/resolver/0001-vault-resolve-secrets-with-prefix.hpl
rename to integration-tests/vault/0001-vault-resolve-secrets-with-prefix.hpl
diff --git a/integration-tests/resolver/0001-vault-resolve-secrets.hpl
b/integration-tests/vault/0001-vault-resolve-secrets.hpl
similarity index 100%
rename from integration-tests/resolver/0001-vault-resolve-secrets.hpl
rename to integration-tests/vault/0001-vault-resolve-secrets.hpl
diff --git a/integration-tests/resolver/0002-pipeline-get-configurations.hpl
b/integration-tests/vault/0002-pipeline-get-configurations.hpl
similarity index 100%
rename from integration-tests/resolver/0002-pipeline-get-configurations.hpl
rename to integration-tests/vault/0002-pipeline-get-configurations.hpl
diff --git a/integration-tests/resolver/0002-pipeline-resolver-test.hpl
b/integration-tests/vault/0002-pipeline-resolver-test.hpl
similarity index 100%
rename from integration-tests/resolver/0002-pipeline-resolver-test.hpl
rename to integration-tests/vault/0002-pipeline-resolver-test.hpl
diff --git a/integration-tests/resolver/0003-nested-resolver.hpl
b/integration-tests/vault/0003-nested-resolver.hpl
similarity index 100%
rename from integration-tests/resolver/0003-nested-resolver.hpl
rename to integration-tests/vault/0003-nested-resolver.hpl
diff --git
a/integration-tests/resolver/datasets/0001-golden-resolved-variables.csv
b/integration-tests/vault/datasets/0001-golden-resolved-variables.csv
similarity index 100%
rename from
integration-tests/resolver/datasets/0001-golden-resolved-variables.csv
rename to integration-tests/vault/datasets/0001-golden-resolved-variables.csv
diff --git
a/integration-tests/resolver/datasets/0002-golden-pipeline-resolver.csv
b/integration-tests/vault/datasets/0002-golden-pipeline-resolver.csv
similarity index 100%
rename from
integration-tests/resolver/datasets/0002-golden-pipeline-resolver.csv
rename to integration-tests/vault/datasets/0002-golden-pipeline-resolver.csv
diff --git
a/integration-tests/resolver/datasets/0003-golden-nested-resolver.csv
b/integration-tests/vault/datasets/0003-golden-nested-resolver.csv
similarity index 100%
rename from integration-tests/resolver/datasets/0003-golden-nested-resolver.csv
rename to integration-tests/vault/datasets/0003-golden-nested-resolver.csv
diff --git a/integration-tests/resolver/dev-env-config.json
b/integration-tests/vault/dev-env-config.json
similarity index 100%
rename from integration-tests/resolver/dev-env-config.json
rename to integration-tests/vault/dev-env-config.json
diff --git a/integration-tests/resolver/files/db1.properties
b/integration-tests/vault/files/db1.properties
similarity index 100%
rename from integration-tests/resolver/files/db1.properties
rename to integration-tests/vault/files/db1.properties
diff --git a/integration-tests/resolver/files/db2.properties
b/integration-tests/vault/files/db2.properties
similarity index 100%
rename from integration-tests/resolver/files/db2.properties
rename to integration-tests/vault/files/db2.properties
diff --git a/integration-tests/resolver/files/db3.properties
b/integration-tests/vault/files/db3.properties
similarity index 100%
rename from integration-tests/resolver/files/db3.properties
rename to integration-tests/vault/files/db3.properties
diff --git a/integration-tests/resolver/hop-config.json
b/integration-tests/vault/hop-config.json
similarity index 100%
rename from integration-tests/resolver/hop-config.json
rename to integration-tests/vault/hop-config.json
diff --git a/integration-tests/resolver/main-0001-resolve-secrets.hwf
b/integration-tests/vault/main-0001-resolve-secrets.hwf
similarity index 100%
rename from integration-tests/resolver/main-0001-resolve-secrets.hwf
rename to integration-tests/vault/main-0001-resolve-secrets.hwf
diff --git a/integration-tests/resolver/main-0002-pipeline-resolver.hwf
b/integration-tests/vault/main-0002-pipeline-resolver.hwf
similarity index 100%
rename from integration-tests/resolver/main-0002-pipeline-resolver.hwf
rename to integration-tests/vault/main-0002-pipeline-resolver.hwf
diff --git a/integration-tests/resolver/main-0003-nested-resolver.hwf
b/integration-tests/vault/main-0003-nested-resolver.hwf
similarity index 100%
rename from integration-tests/resolver/main-0003-nested-resolver.hwf
rename to integration-tests/vault/main-0003-nested-resolver.hwf
diff --git
a/integration-tests/resolver/metadata/dataset/0001-golden-resolved-variables.json
b/integration-tests/vault/metadata/dataset/0001-golden-resolved-variables.json
similarity index 100%
rename from
integration-tests/resolver/metadata/dataset/0001-golden-resolved-variables.json
rename to
integration-tests/vault/metadata/dataset/0001-golden-resolved-variables.json
diff --git
a/integration-tests/resolver/metadata/dataset/0002-golden-pipeline-resolver.json
b/integration-tests/vault/metadata/dataset/0002-golden-pipeline-resolver.json
similarity index 100%
rename from
integration-tests/resolver/metadata/dataset/0002-golden-pipeline-resolver.json
rename to
integration-tests/vault/metadata/dataset/0002-golden-pipeline-resolver.json
diff --git
a/integration-tests/resolver/metadata/dataset/0003-golden-nested-resolver.json
b/integration-tests/vault/metadata/dataset/0003-golden-nested-resolver.json
similarity index 100%
rename from
integration-tests/resolver/metadata/dataset/0003-golden-nested-resolver.json
rename to
integration-tests/vault/metadata/dataset/0003-golden-nested-resolver.json
diff --git
a/integration-tests/resolver/metadata/pipeline-run-configuration/local.json
b/integration-tests/vault/metadata/pipeline-run-configuration/local.json
similarity index 100%
rename from
integration-tests/resolver/metadata/pipeline-run-configuration/local.json
rename to integration-tests/vault/metadata/pipeline-run-configuration/local.json
diff --git
a/integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
b/integration-tests/vault/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
similarity index 100%
rename from
integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
rename to integration-tests/vault/metadata/unit-test/0001-vault-resolve-secrets
UNIT.json
diff --git
a/integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
b/integration-tests/vault/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
similarity index 100%
rename from
integration-tests/resolver/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
rename to
integration-tests/vault/metadata/unit-test/0001-vault-resolve-secrets-with-prefix
UNIT.json
diff --git
a/integration-tests/resolver/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
b/integration-tests/vault/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
similarity index 100%
rename from
integration-tests/resolver/metadata/unit-test/0002-pipeline-resolver-test
UNIT.json
rename to
integration-tests/vault/metadata/unit-test/0002-pipeline-resolver-test UNIT.json
diff --git a/integration-tests/resolver/metadata/unit-test/0003-nested-resolver
UNIT.json b/integration-tests/vault/metadata/unit-test/0003-nested-resolver
UNIT.json
similarity index 100%
rename from integration-tests/resolver/metadata/unit-test/0003-nested-resolver
UNIT.json
rename to integration-tests/vault/metadata/unit-test/0003-nested-resolver
UNIT.json
diff --git a/integration-tests/resolver/metadata/variable-resolver/conf.json
b/integration-tests/vault/metadata/variable-resolver/conf.json
similarity index 100%
rename from integration-tests/resolver/metadata/variable-resolver/conf.json
rename to integration-tests/vault/metadata/variable-resolver/conf.json
diff --git
a/integration-tests/resolver/metadata/variable-resolver/pipeline.json
b/integration-tests/vault/metadata/variable-resolver/pipeline.json
similarity index 100%
rename from integration-tests/resolver/metadata/variable-resolver/pipeline.json
rename to integration-tests/vault/metadata/variable-resolver/pipeline.json
diff --git
a/integration-tests/resolver/metadata/variable-resolver/vault-prefix.json
b/integration-tests/vault/metadata/variable-resolver/vault-prefix.json
similarity index 100%
rename from
integration-tests/resolver/metadata/variable-resolver/vault-prefix.json
rename to integration-tests/vault/metadata/variable-resolver/vault-prefix.json
diff --git a/integration-tests/resolver/metadata/variable-resolver/vault.json
b/integration-tests/vault/metadata/variable-resolver/vault.json
similarity index 100%
rename from integration-tests/resolver/metadata/variable-resolver/vault.json
rename to integration-tests/vault/metadata/variable-resolver/vault.json
diff --git
a/integration-tests/resolver/metadata/workflow-run-configuration/local.json
b/integration-tests/vault/metadata/workflow-run-configuration/local.json
similarity index 100%
rename from
integration-tests/resolver/metadata/workflow-run-configuration/local.json
rename to integration-tests/vault/metadata/workflow-run-configuration/local.json
diff --git a/integration-tests/resolver/project-config.json
b/integration-tests/vault/project-config.json
similarity index 100%
rename from integration-tests/resolver/project-config.json
rename to integration-tests/vault/project-config.json
diff --git a/plugins/tech/vault/pom.xml b/plugins/tech/vault/pom.xml
index 665e6e4ef4..e348d677b6 100755
--- a/plugins/tech/vault/pom.xml
+++ b/plugins/tech/vault/pom.xml
@@ -29,12 +29,12 @@
<name>Hop Plugins Technology Hashicorp Vault</name>
<properties>
- <vault.driver.version>2.0.0</vault.driver.version>
+ <vault.driver.version>6.2.2</vault.driver.version>
</properties>
<dependencies>
<dependency>
- <groupId>com.bettercloud</groupId>
+ <groupId>io.github.jopenlibs</groupId>
<artifactId>vault-java-driver</artifactId>
<version>${vault.driver.version}</version>
</dependency>
diff --git
a/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
b/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/BaseVaultVariableResolver.java
similarity index 83%
copy from
plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
copy to
plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/BaseVaultVariableResolver.java
index 2d28956165..221a214f4c 100644
---
a/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
+++
b/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/BaseVaultVariableResolver.java
@@ -18,9 +18,10 @@
package org.apache.hop.core.variables.resolver.vault;
-import com.bettercloud.vault.Vault;
-import com.bettercloud.vault.VaultConfig;
-import com.bettercloud.vault.response.LogicalResponse;
+import io.github.jopenlibs.vault.SslConfig;
+import io.github.jopenlibs.vault.Vault;
+import io.github.jopenlibs.vault.VaultConfig;
+import io.github.jopenlibs.vault.response.LogicalResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -32,25 +33,17 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.hop.core.Const;
import org.apache.hop.core.exception.HopException;
import org.apache.hop.core.gui.plugin.GuiElementType;
-import org.apache.hop.core.gui.plugin.GuiPlugin;
import org.apache.hop.core.gui.plugin.GuiWidgetElement;
import org.apache.hop.core.logging.LogChannel;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.variables.resolver.IVariableResolver;
import org.apache.hop.core.variables.resolver.VariableResolver;
-import org.apache.hop.core.variables.resolver.VariableResolverPlugin;
import org.apache.hop.core.vfs.HopVfs;
import org.apache.hop.metadata.api.HopMetadataProperty;
@Getter
@Setter
-@GuiPlugin
-@VariableResolverPlugin(
- id = "Vault-Variable-Resolver",
- name = "Hashicorp Vault Variable Resolver",
- description = "Look up values of secrets in Hashicorp Vault",
- documentationUrl =
"/metadata-types/variable-resolver/hashicorp-vault-variable-resolver.html")
-public class VaultVariableResolver implements IVariableResolver {
+public abstract class BaseVaultVariableResolver implements IVariableResolver {
@GuiWidgetElement(
id = "vaultAddress",
@@ -60,7 +53,7 @@ public class VaultVariableResolver implements
IVariableResolver {
type = GuiElementType.TEXT,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String vaultAddress;
+ protected String vaultAddress;
@GuiWidgetElement(
id = "vaultToken",
@@ -71,7 +64,7 @@ public class VaultVariableResolver implements
IVariableResolver {
password = true,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String vaultToken;
+ protected String vaultToken;
@GuiWidgetElement(
id = "pathPrefix",
@@ -81,7 +74,17 @@ public class VaultVariableResolver implements
IVariableResolver {
type = GuiElementType.TEXT,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String pathPrefix;
+ protected String pathPrefix;
+
+ @GuiWidgetElement(
+ id = "namespace",
+ order = "35",
+ label =
+
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.namespace",
+ type = GuiElementType.TEXT,
+ parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
+ @HopMetadataProperty
+ protected String namespace;
@GuiWidgetElement(
id = "verifyingSsl",
@@ -93,7 +96,7 @@ public class VaultVariableResolver implements
IVariableResolver {
type = GuiElementType.CHECKBOX,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private boolean verifyingSsl;
+ protected boolean verifyingSsl;
@GuiWidgetElement(
id = "pemFilePath",
@@ -103,7 +106,7 @@ public class VaultVariableResolver implements
IVariableResolver {
type = GuiElementType.FILENAME,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String pemFilePath;
+ protected String pemFilePath;
@GuiWidgetElement(
id = "pemString",
@@ -114,7 +117,7 @@ public class VaultVariableResolver implements
IVariableResolver {
password = true,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String pemString;
+ protected String pemString;
@GuiWidgetElement(
id = "openTimeout",
@@ -124,7 +127,7 @@ public class VaultVariableResolver implements
IVariableResolver {
type = GuiElementType.TEXT,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String openTimeout;
+ protected String openTimeout;
@GuiWidgetElement(
id = "readTimeout",
@@ -134,7 +137,7 @@ public class VaultVariableResolver implements
IVariableResolver {
type = GuiElementType.TEXT,
parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
@HopMetadataProperty
- private String readTimeout;
+ protected String readTimeout;
@Override
public String resolve(String secretPath, IVariables variables) throws
HopException {
@@ -150,8 +153,14 @@ public class VaultVariableResolver implements
IVariableResolver {
final VaultConfig vaultConfig = new VaultConfig();
vaultConfig.address(actualVaultAddress);
vaultConfig.token(actualVaultToken);
+ vaultConfig.engineVersion(1);
+
+ if (StringUtils.isNotEmpty(namespace)) {
+ vaultConfig.nameSpace(variables.resolve(namespace));
+ }
- vaultConfig.sslVerify(isVerifyingSsl());
+ final SslConfig sslConfig = new SslConfig();
+ sslConfig.verify(isVerifyingSsl());
String pemUtf8 = null;
// Is our PEM String located in a file?
//
@@ -163,8 +172,10 @@ public class VaultVariableResolver implements
IVariableResolver {
pemUtf8 = variables.resolve(pemString);
}
if (StringUtils.isNotEmpty(pemUtf8)) {
- vaultConfig.sslPemUTF8(pemUtf8);
+ sslConfig.pemUTF8(pemUtf8);
}
+ sslConfig.build();
+ vaultConfig.sslConfig(sslConfig);
if (StringUtils.isNotEmpty(openTimeout)) {
int timeOut = Const.toInt(variables.resolve(openTimeout), -1);
@@ -181,7 +192,7 @@ public class VaultVariableResolver implements
IVariableResolver {
vaultConfig.build();
- final Vault vault = new Vault(vaultConfig);
+ final Vault vault = Vault.create(vaultConfig);
String path;
if (StringUtils.isNotEmpty(pathPrefix)) {
@@ -201,8 +212,7 @@ public class VaultVariableResolver implements
IVariableResolver {
return logicalResponse.getData().get("data");
} catch (Exception e) {
LogChannel.GENERAL.logError(
- "Error looking up secret '" + secretPath + "' in the Hashicorp Vault
Variable resolver",
- e);
+ "Error looking up secret '" + secretPath + "' in the Variable
resolver", e);
return null;
}
}
@@ -233,9 +243,7 @@ public class VaultVariableResolver implements
IVariableResolver {
}
@Override
- public String getPluginId() {
- return "Vault-Variable-Resolver";
- }
+ public abstract String getPluginId();
@Override
public void setPluginName(String pluginName) {
@@ -243,7 +251,5 @@ public class VaultVariableResolver implements
IVariableResolver {
}
@Override
- public String getPluginName() {
- return "Hashicorp Vault Variable Resolver";
- }
+ public abstract String getPluginName();
}
diff --git
a/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/OpenBaoVariableResolver.java
b/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/OpenBaoVariableResolver.java
new file mode 100644
index 0000000000..cc8508766c
--- /dev/null
+++
b/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/OpenBaoVariableResolver.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.hop.core.variables.resolver.vault;
+
+import org.apache.hop.core.gui.plugin.GuiPlugin;
+import org.apache.hop.core.variables.resolver.VariableResolverPlugin;
+
+@GuiPlugin
+@VariableResolverPlugin(
+ id = "OpenBao-Variable-Resolver",
+ name = "OpenBAO Variable Resolver",
+ description = "Look up values of secrets in OpenBAO",
+ documentationUrl =
"/metadata-types/variable-resolver/openbao-variable-resolver.html")
+public class OpenBaoVariableResolver extends BaseVaultVariableResolver {
+
+ @Override
+ public String getPluginId() {
+ return "OpenBao-Variable-Resolver";
+ }
+
+ @Override
+ public String getPluginName() {
+ return "OpenBAO Variable Resolver";
+ }
+}
diff --git
a/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
b/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
index 2d28956165..07aaa0baa5 100644
---
a/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
+++
b/plugins/tech/vault/src/main/java/org/apache/hop/core/variables/resolver/vault/VaultVariableResolver.java
@@ -18,230 +18,22 @@
package org.apache.hop.core.variables.resolver.vault;
-import com.bettercloud.vault.Vault;
-import com.bettercloud.vault.VaultConfig;
-import com.bettercloud.vault.response.LogicalResponse;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.hop.core.Const;
-import org.apache.hop.core.exception.HopException;
-import org.apache.hop.core.gui.plugin.GuiElementType;
import org.apache.hop.core.gui.plugin.GuiPlugin;
-import org.apache.hop.core.gui.plugin.GuiWidgetElement;
-import org.apache.hop.core.logging.LogChannel;
-import org.apache.hop.core.variables.IVariables;
-import org.apache.hop.core.variables.resolver.IVariableResolver;
-import org.apache.hop.core.variables.resolver.VariableResolver;
import org.apache.hop.core.variables.resolver.VariableResolverPlugin;
-import org.apache.hop.core.vfs.HopVfs;
-import org.apache.hop.metadata.api.HopMetadataProperty;
-@Getter
-@Setter
@GuiPlugin
@VariableResolverPlugin(
id = "Vault-Variable-Resolver",
name = "Hashicorp Vault Variable Resolver",
description = "Look up values of secrets in Hashicorp Vault",
documentationUrl =
"/metadata-types/variable-resolver/hashicorp-vault-variable-resolver.html")
-public class VaultVariableResolver implements IVariableResolver {
-
- @GuiWidgetElement(
- id = "vaultAddress",
- order = "10",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.vaultAddress",
- type = GuiElementType.TEXT,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String vaultAddress;
-
- @GuiWidgetElement(
- id = "vaultToken",
- order = "20",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.vaultToken",
- type = GuiElementType.TEXT,
- password = true,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String vaultToken;
-
- @GuiWidgetElement(
- id = "pathPrefix",
- order = "30",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.pathPrefix",
- type = GuiElementType.TEXT,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String pathPrefix;
-
- @GuiWidgetElement(
- id = "verifyingSsl",
- order = "40",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.verifyingSsl",
- toolTip =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.tooltip.verifyingSsl",
- type = GuiElementType.CHECKBOX,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private boolean verifyingSsl;
-
- @GuiWidgetElement(
- id = "pemFilePath",
- order = "50",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.pemFilePath",
- type = GuiElementType.FILENAME,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String pemFilePath;
-
- @GuiWidgetElement(
- id = "pemString",
- order = "60",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.pemString",
- type = GuiElementType.TEXT,
- password = true,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String pemString;
-
- @GuiWidgetElement(
- id = "openTimeout",
- order = "70",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.openTimeout",
- type = GuiElementType.TEXT,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String openTimeout;
-
- @GuiWidgetElement(
- id = "readTimeout",
- order = "80",
- label =
-
"i18n:org.apache.hop.core.variables.resolver.vault:VaultVariableResolver.label.readTimeout",
- type = GuiElementType.TEXT,
- parentId = VariableResolver.GUI_PLUGIN_ELEMENT_PARENT_ID)
- @HopMetadataProperty
- private String readTimeout;
-
- @Override
- public String resolve(String secretPath, IVariables variables) throws
HopException {
- try {
- // If we don't have any argument, give up immediately.
- //
- if (StringUtils.isEmpty(secretPath)) {
- return null;
- }
-
- String actualVaultToken = variables.resolve(vaultToken);
- String actualVaultAddress = variables.resolve(vaultAddress);
- final VaultConfig vaultConfig = new VaultConfig();
- vaultConfig.address(actualVaultAddress);
- vaultConfig.token(actualVaultToken);
-
- vaultConfig.sslVerify(isVerifyingSsl());
- String pemUtf8 = null;
- // Is our PEM String located in a file?
- //
- if (StringUtils.isNotEmpty(pemFilePath)) {
- try (InputStream is =
HopVfs.getInputStream(variables.resolve(pemFilePath))) {
- pemUtf8 = readUtf8StringFromInputStream(is);
- }
- } else if (StringUtils.isNotEmpty(pemString)) {
- pemUtf8 = variables.resolve(pemString);
- }
- if (StringUtils.isNotEmpty(pemUtf8)) {
- vaultConfig.sslPemUTF8(pemUtf8);
- }
-
- if (StringUtils.isNotEmpty(openTimeout)) {
- int timeOut = Const.toInt(variables.resolve(openTimeout), -1);
- if (timeOut >= 0) {
- vaultConfig.openTimeout(timeOut);
- }
- }
- if (StringUtils.isNotEmpty(readTimeout)) {
- int timeOut = Const.toInt(variables.resolve(readTimeout), -1);
- if (timeOut >= 0) {
- vaultConfig.readTimeout(timeOut);
- }
- }
-
- vaultConfig.build();
-
- final Vault vault = new Vault(vaultConfig);
-
- String path;
- if (StringUtils.isNotEmpty(pathPrefix)) {
- path = variables.resolve(pathPrefix) + secretPath;
- } else {
- path = secretPath;
- }
-
- LogicalResponse logicalResponse = vault.logical().read(path);
- if (logicalResponse == null) {
- LogChannel.GENERAL.logDetailed(
- "The secret with path '" + secretPath + "' was not found in the
vault");
- return null;
- }
- // If we don't have a value to retrieve, simple return the "data" value.
- //
- return logicalResponse.getData().get("data");
- } catch (Exception e) {
- LogChannel.GENERAL.logError(
- "Error looking up secret '" + secretPath + "' in the Hashicorp Vault
Variable resolver",
- e);
- return null;
- }
- }
-
- // Read the PEM file content in UTF8 from an input stream.
- //
- private String readUtf8StringFromInputStream(final InputStream input) throws
IOException {
- final StringBuilder utf8 = new StringBuilder();
- try (BufferedReader in =
- new BufferedReader(new InputStreamReader(input,
StandardCharsets.UTF_8))) {
- String string;
- while ((string = in.readLine()) != null) {
- utf8.append(string);
- utf8.append(Const.CR);
- }
- }
- return utf8.toString();
- }
-
- @Override
- public void setPluginId() {
- // Nothing to set
- }
-
- @Override
- public void init() {
- // Not used today
- }
+public class VaultVariableResolver extends BaseVaultVariableResolver {
@Override
public String getPluginId() {
return "Vault-Variable-Resolver";
}
- @Override
- public void setPluginName(String pluginName) {
- // Nothing to set
- }
-
@Override
public String getPluginName() {
return "Hashicorp Vault Variable Resolver";
diff --git
a/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_en_US.properties
b/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_en_US.properties
index 361b8e92d1..ca6271ddc7 100644
---
a/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_en_US.properties
+++
b/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_en_US.properties
@@ -19,6 +19,7 @@
VaultVariableResolver.label.vaultAddress = Vault address
VaultVariableResolver.label.vaultToken = Vault token
VaultVariableResolver.label.pathPrefix = Path prefix (optional)
+VaultVariableResolver.label.namespace = Namespace
VaultVariableResolver.label.verifyingSsl = Validate HTTPS connections?
VaultVariableResolver.tooltip.verifyingSsl = Enable this in production! It
validates connections with an X.509 certificate specified with one of the PEM
options below.
VaultVariableResolver.label.pemFilePath = PEM (X.509 certificate) file path
diff --git
a/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_pt_BR.properties
b/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_pt_BR.properties
index f5a11a3c9b..997f2f0fe5 100644
---
a/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_pt_BR.properties
+++
b/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_pt_BR.properties
@@ -26,3 +26,4 @@ VaultVariableResolver.label.pemString =PEM (certificado
X.509) String
VaultVariableResolver.label.openTimeout =Tempo limite de conexão aberto
VaultVariableResolver.label.readTimeout =Tempo limite de leitura
VaultVariableResolver.label.pathPrefix=Prefixo do caminho (opcional)
+VaultVariableResolver.label.namespace=Espaço de nomes (Namespace)
diff --git
a/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_zh_CN.properties
b/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_zh_CN.properties
index 075cd246e4..e20bb2feab 100644
---
a/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_zh_CN.properties
+++
b/plugins/tech/vault/src/main/resources/org/apache/hop/core/variables/resolver/vault/messages/messages_zh_CN.properties
@@ -18,3 +18,4 @@
#
VaultVariableResolver.label.vaultAddress=\u4FDD\u9669\u5E93\u5730\u5740
+VaultVariableResolver.label.namespace=\u547D\u540D\u7A7A\u95F4 (Namespace)