diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ca0561..70c5fff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,13 +162,17 @@ jobs: token: testtoken secrets: | secret/data/test-json-string jsonString | JSON_STRING ; + secret/data/test-json-data jsondata | JSON_DATA ; - name: Test Vault Action JSON String Format (part 2/2) run: | - echo "${{ steps.import-secrets.outputs.jsonString }}" > secrets.json - cat secrets.json + echo "${{ steps.import-secrets.outputs.jsonString }}" > string.json + echo "${{ steps.import-secrets.outputs.jsonData }}" > data.json + cat string.json + cat data.json # we should be able to parse the output as JSON - jq -c . < secrets.json + jq -c . < string.json + jq -c . < data.json - name: Test Vault Action (cubbyhole) uses: ./ diff --git a/integrationTests/e2e/e2e.test.js b/integrationTests/e2e/e2e.test.js index 3e43490..fac7c8a 100644 --- a/integrationTests/e2e/e2e.test.js +++ b/integrationTests/e2e/e2e.test.js @@ -10,6 +10,7 @@ describe('e2e', () => { expect(process.env.FOO).toBe("bar"); expect(process.env.NAMED_CUBBYSECRET).toBe("zap"); expect(process.env.SUBSEQUENT_TEST_SECRET).toBe("SUBSEQUENT_TEST_SECRET"); + expect(process.env.JSON_DATA).toBe({"x":1,"y":"qux"}); const jsonString = '{"x":1,"y":"qux"}'; let jsonResult = JSON.stringify(jsonString); diff --git a/integrationTests/e2e/setup.js b/integrationTests/e2e/setup.js index 6ef2cf8..0766820 100644 --- a/integrationTests/e2e/setup.js +++ b/integrationTests/e2e/setup.js @@ -49,6 +49,18 @@ const vaultToken = `${process.env.VAULT_TOKEN}` === undefined ? `${process.env.V }, }); + await got(`http://${vaultUrl}/v1/secret/data/test-json-data`, { + method: 'POST', + headers: { + 'X-Vault-Token': vaultToken, + }, + json: { + data: { + jsonData: {"x":1,"y":"qux"}, + }, + }, + }); + await got(`http://${vaultUrl}/v1/sys/mounts/my-secret`, { method: 'POST', headers: {