Compare commits

...

10 Commits

Author SHA1 Message Date
Antoine Méausoone 3b9239de79 feat(authenticate): add approle auth method (#10)
* feat(authenticate): add approle auth method

* docs(readme): update readme

* fix: update index.js

* fix: update got to 10.2.2 to fix ncc

* chore: clean up code slightly

* chore: update tests to use got correctly

* chore(test): fix integration tests

* chore: streamline method logic

* chore: make role and secret required in approle

Co-authored-by: Sébastien FAUVART <sebastien.fauvart@gmail.com>
Co-authored-by: Richard Simpson <richardsimpson@outlook.com>
2020-01-28 19:10:19 -06:00
Richard Simpson 7a9634236c chore(build): re-enable builds on PR and restrict publish to master 2020-01-09 10:45:52 -06:00
Richard Simpson ab4dc55b2e fix: actually build namespace changes 2020-01-09 10:31:15 -06:00
dependabot[bot] e394527e23 chore(deps): bump handlebars from 4.2.1 to 4.5.3 (#9)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.2.1 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.2.1...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-29 21:04:07 -06:00
dependabot[bot] 29150a8fd2 chore(deps): bump npm from 6.11.3 to 6.13.4 (#8)
Bumps [npm](https://github.com/npm/cli) from 6.11.3 to 6.13.4.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.11.3...v6.13.4)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-13 13:56:22 -06:00
Richard Simpson 38c189f087 chore(test): organize tests a bit better (#7)
* chore(test): organize tests a bit better

* add caching
2019-11-24 16:00:31 -06:00
Antoine Méausoone 3747195c5f feat(namespace): handle request on vault namespace (#5)
* feat(namespace): handle request on vault namespace
2019-11-24 15:21:11 -06:00
Richard Simpson 0104a02854 doc: fix old docs 2019-10-16 10:23:36 -05:00
Richard Simpson c81d6f1774 doc: add small clarification comment 2019-10-16 10:17:12 -05:00
Richard Simpson da9a93f3f5 fix: package action (#3)
Package action output per github docs.
2019-10-15 14:00:01 -05:00
17 changed files with 6056 additions and 218 deletions
+84 -23
View File
@@ -1,43 +1,87 @@
on: [push] on:
push:
branches:
- master
pull_request:
jobs: jobs:
test: build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: setup npm cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install
run: npm ci
- name: npm build
run: npm run build
- name: npm run test
run: npm run test
integration:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
vault: vaultBasic:
image: vault:1.2.3 image: vault:1.2.3
ports: ports:
- 8200/tcp - 8200/tcp
env: env:
VAULT_DEV_ROOT_TOKEN_ID: testtoken VAULT_DEV_ROOT_TOKEN_ID: testtoken
options: --cap-add=IPC_LOCK options: --cap-add=IPC_LOCK
vaultEnterprise:
image: hashicorp/vault-enterprise:1.3.0_ent
ports:
- 8200/tcp
env:
VAULT_DEV_ROOT_TOKEN_ID: testtoken
options: --cap-add=IPC_LOCK
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Use Node.js 10.x - name: Use Node.js 10.x
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 10.x node-version: 10.x
- name: npm install - name: setup npm cache
run: npm ci uses: actions/cache@v1
- name: npm run test with:
run: npm run test path: ~/.npm
env: key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
CI: true restore-keys: |
- name: npm run test:integration ${{ runner.os }}-node-
run: npm run test:integration - name: npm install
env: run: npm ci
VAULT_HOST: localhost - name: npm build
VAULT_PORT: ${{ job.services.vault.ports[8200] }} run: npm run build
CI: true - name: npm run test:integration:basic
run: npm run test:integration:basic
env:
VAULT_HOST: localhost
VAULT_PORT: ${{ job.services.vaultBasic.ports[8200] }}
CI: true
- name: npm run test:integration:enterprise
run: npm run test:integration:enterprise
env:
VAULT_HOST: localhost
VAULT_PORT: ${{ job.services.vaultEnterprise.ports[8200] }}
CI: true
e2e: e2e:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
vault: vault:
image: vault:1.2.3 image: vault:1.3.0
ports: ports:
- 8200/tcp - 8200/tcp
env: env:
@@ -50,10 +94,19 @@ jobs:
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 10.x node-version: 10.x
- name: setup npm cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install - name: npm install
run: npm ci run: npm ci
- name: npm build
run: npm run build
- name: setup vault - name: setup vault
run: node ./e2e/setup.js run: node ./integrationTests/e2e/setup.js
env: env:
VAULT_HOST: localhost VAULT_HOST: localhost
VAULT_PORT: ${{ job.services.vault.ports[8200] }} VAULT_PORT: ${{ job.services.vault.ports[8200] }}
@@ -70,14 +123,22 @@ jobs:
run: npm run test:e2e run: npm run test:e2e
publish: publish:
if: github.event_name == 'push' && contains(github.ref, 'master')
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test, e2e] needs: [build, integration, e2e]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Use Node.js 10.x - name: Use Node.js 10.x
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 10.x node-version: 10.x
- name: setup npm cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install - name: npm install
run: npm ci run: npm ci
- name: release - name: release
+42 -2
View File
@@ -1,6 +1,6 @@
# vault-action # vault-action
A helper action for easily pulling secrets from the v2 K/V backend of vault. A helper action for easily pulling secrets from the default v2 K/V backend of vault.
## Example Usage ## Example Usage
@@ -22,6 +22,26 @@ jobs:
# ... # ...
``` ```
## Authentication method
The `method` parameter can have these value :
- **token**: (by default) you must provide a token parameter
```yaml
...
with:
url: https://vault.mycompany.com:8200
token: ${{ secrets.VaultToken }}
```
- **approle**: you must provide a roleId & secretId parameter
```yaml
...
with:
url: https://vault.mycompany.com:8200
method: approle
roleId: ${{ secrets.roleId }}
secretId : ${{ secrets.secretId }}
```
## Key Syntax ## Key Syntax
The `secrets` parameter is a set of multiple secret requests separated by the `;` character. The `secrets` parameter is a set of multiple secret requests separated by the `;` character.
@@ -68,11 +88,31 @@ This action can take multi-line input, so say you had your AWS keys stored in a
```yaml ```yaml
with: with:
keys: | secrets: |
ci/aws accessKey | AWS_ACCESS_KEY_ID ; ci/aws accessKey | AWS_ACCESS_KEY_ID ;
ci/aws secretKey | AWS_SECRET_ACCESS_KEY ci/aws secretKey | AWS_SECRET_ACCESS_KEY
``` ```
### Namespace
This action could be use with namespace Vault Enterprise feature. You can specify namespace in request :
```yaml
steps:
# ...
- name: Import Secrets
uses: RichiCoder1/vault-action
with:
url: https://vault-enterprise.mycompany.com:8200
method: token
token: ${{ secrets.VaultToken }}
namespace: ns1
secrets: |
ci/aws accessKey | AWS_ACCESS_KEY_ID ;
ci/aws secretKey | AWS_SECRET_ACCESS_KEY ;
ci npm_token
```
## Masking ## Masking
This action uses Github Action's built in masking, so all variables will automatically be masked if printed to the console or to logs. This action uses Github Action's built in masking, so all variables will automatically be masked if printed to the console or to logs.
+48 -7
View File
@@ -2,20 +2,61 @@ const core = require('@actions/core');
const command = require('@actions/core/lib/command'); const command = require('@actions/core/lib/command');
const got = require('got'); const got = require('got');
const AUTH_METHODS = ['approle', 'token'];
async function exportSecrets() { async function exportSecrets() {
const vaultUrl = core.getInput('url', { required: true }); const vaultUrl = core.getInput('url', { required: true });
const vaultToken = core.getInput('token', { required: true }); const vaultNamespace = core.getInput('namespace', { required: false });
const secretsInput = core.getInput('secrets', { required: true }); const secretsInput = core.getInput('secrets', { required: true });
const secrets = parseSecretsInput(secretsInput); const secrets = parseSecretsInput(secretsInput);
const vaultMethod = core.getInput('method', { required: false }) || 'token';
if (!AUTH_METHODS.includes(vaultMethod)) {
throw Error(`Sorry, the authentication method ${vaultMethod} is not currently supported.`);
}
let vaultToken = null;
switch (vaultMethod) {
case 'approle':
const vaultRoleId = core.getInput('roleId', { required: true });
const vaultSecretId = core.getInput('secretId', { required: true });
core.debug('Try to retrieve Vault Token from approle');
var options = {
headers: {},
json: { role_id: vaultRoleId, secret_id: vaultSecretId },
responseType: 'json'
};
if (vaultNamespace != null) {
options.headers["X-Vault-Namespace"] = vaultNamespace;
}
const result = await got.post(`${vaultUrl}/v1/auth/approle/login`, options);
if (result && result.body && result.body.auth && result.body.auth.client_token) {
vaultToken = result.body.auth.client_token;
core.debug('✔ Vault Token has retrieved from approle');
} else {
throw Error(`No token was retrieved with the role_id and secret_id provided.`);
}
break;
default:
vaultToken = core.getInput('token', { required: true });
break;
}
for (const secret of secrets) { for (const secret of secrets) {
const { secretPath, outputName, secretKey } = secret; const { secretPath, outputName, secretKey } = secret;
const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, { const requestOptions = {
headers: { headers: {
'X-Vault-Token': vaultToken 'X-Vault-Token': vaultToken
} },
}); };
if (vaultNamespace != null) {
requestOptions.headers["X-Vault-Namespace"] = vaultNamespace;
}
const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, requestOptions);
const parsedResponse = JSON.parse(result.body); const parsedResponse = JSON.parse(result.body);
const vaultKeyData = parsedResponse.data; const vaultKeyData = parsedResponse.data;
@@ -29,7 +70,7 @@ async function exportSecrets() {
/** /**
* Parses a secrets input string into key paths and their resulting environment variable name. * Parses a secrets input string into key paths and their resulting environment variable name.
* @param {string} secretsInput * @param {string} secretsInput
*/ */
function parseSecretsInput(secretsInput) { function parseSecretsInput(secretsInput) {
const secrets = secretsInput const secrets = secretsInput
@@ -80,7 +121,7 @@ function parseSecretsInput(secretsInput) {
} }
/** /**
* Replaces any forward-slash characters to * Replaces any forward-slash characters to
* @param {string} dataKey * @param {string} dataKey
*/ */
function normalizeOutputKey(dataKey) { function normalizeOutputKey(dataKey) {
@@ -91,4 +132,4 @@ module.exports = {
exportSecrets, exportSecrets,
parseSecretsInput, parseSecretsInput,
normalizeOutputKey normalizeOutputKey
}; };
+5 -2
View File
@@ -10,9 +10,12 @@ inputs:
secrets: secrets:
description: 'A semicolon-separated list of secrets to retrieve. These will automatically be converted to environmental variable keys. See README for more details' description: 'A semicolon-separated list of secrets to retrieve. These will automatically be converted to environmental variable keys. See README for more details'
required: true required: true
namespace:
description: 'The Vault namespace from which to query secrets. Vault Enterprise only, unset by default'
required: false
runs: runs:
using: 'node12' using: 'node12'
main: 'index.js' main: 'dist/index.js'
branding: branding:
icon: 'unlock' icon: 'unlock'
color: 'gray-dark' color: 'gray-dark'
+5331
View File
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
# Start vault server locally for the purposes of integration tests.
version: "3.0"
services:
vault:
image: vault:1.3.0
environment:
VAULT_DEV_ROOT_TOKEN_ID: testtoken
ports:
- 8200:8200
privileged: true
vault-enterprise:
image: hashicorp/vault-enterprise:1.3.0_ent
environment:
VAULT_DEV_ROOT_TOKEN_ID: testtoken
ports:
- 8201:8200
privileged: true
@@ -5,51 +5,50 @@ const core = require('@actions/core');
const got = require('got'); const got = require('got');
const { when } = require('jest-when'); const { when } = require('jest-when');
const { exportSecrets } = require('../action'); const { exportSecrets } = require('../../action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
describe('integration', () => { describe('integration', () => {
beforeAll(async () => { beforeAll(async () => {
// Verify Connection // Verify Connection
await got(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/config`, { await got(`${vaultUrl}/v1/secret/config`, {
headers: { headers: {
'X-Vault-Token': 'testtoken', 'X-Vault-Token': 'testtoken',
}, },
}); });
await got(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/data/test`, { await got(`${vaultUrl}/v1/secret/data/test`, {
method: 'POST', method: 'POST',
headers: { headers: {
'X-Vault-Token': 'testtoken', 'X-Vault-Token': 'testtoken',
}, },
body: { json: {
data: { data: {
secret: "SUPERSECRET", secret: 'SUPERSECRET',
}, },
}, },
json: true,
}); });
await got(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/data/nested/test`, { await got(`${vaultUrl}/v1/secret/data/nested/test`, {
method: 'POST', method: 'POST',
headers: { headers: {
'X-Vault-Token': 'testtoken', 'X-Vault-Token': 'testtoken',
}, },
body: { json: {
data: { data: {
otherSecret: "OTHERSUPERSECRET", otherSecret: 'OTHERSUPERSECRET',
}, },
}, },
json: true,
}); });
}) });
beforeEach(() => { beforeEach(() => {
jest.resetAllMocks(); jest.resetAllMocks();
when(core.getInput) when(core.getInput)
.calledWith('url') .calledWith('url')
.mockReturnValue(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}`); .mockReturnValue(`${vaultUrl}`);
when(core.getInput) when(core.getInput)
.calledWith('token') .calledWith('token')
@@ -63,7 +62,7 @@ describe('integration', () => {
} }
it('get simple secret', async () => { it('get simple secret', async () => {
mockInput('test secret') mockInput('test secret');
await exportSecrets(); await exportSecrets();
@@ -71,7 +70,7 @@ describe('integration', () => {
}); });
it('re-map secret', async () => { it('re-map secret', async () => {
mockInput('test secret | TEST_KEY') mockInput('test secret | TEST_KEY');
await exportSecrets(); await exportSecrets();
@@ -79,7 +78,7 @@ describe('integration', () => {
}); });
it('get nested secret', async () => { it('get nested secret', async () => {
mockInput('nested/test otherSecret') mockInput('nested/test otherSecret');
await exportSecrets(); await exportSecrets();
@@ -100,4 +99,4 @@ describe('integration', () => {
expect(core.exportVariable).toBeCalledWith('NAMED_SECRET', 'SUPERSECRET'); expect(core.exportVariable).toBeCalledWith('NAMED_SECRET', 'SUPERSECRET');
expect(core.exportVariable).toBeCalledWith('OTHERSECRET', 'OTHERSUPERSECRET'); expect(core.exportVariable).toBeCalledWith('OTHERSECRET', 'OTHERSUPERSECRET');
}); });
}); });
+4
View File
@@ -0,0 +1,4 @@
# e2e tests
This test suite runs `vault-action` as a GitHub Action in the context of a live build, and then verifies that the appropriate environmental variables are set.
These tests are intended to mostly be very simple smoke tests to verify that the action is being compiled and run correctly in context.
@@ -14,12 +14,11 @@ const got = require('got');
headers: { headers: {
'X-Vault-Token': 'testtoken', 'X-Vault-Token': 'testtoken',
}, },
body: { json: {
data: { data: {
secret: "SUPERSECRET", secret: 'SUPERSECRET',
}, },
}, },
json: true,
}); });
await got(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/data/nested/test`, { await got(`http://${process.env.VAULT_HOST}:${process.env.VAULT_PORT}/v1/secret/data/nested/test`, {
@@ -27,15 +26,14 @@ const got = require('got');
headers: { headers: {
'X-Vault-Token': 'testtoken', 'X-Vault-Token': 'testtoken',
}, },
body: { json: {
data: { data: {
otherSecret: "OTHERSUPERSECRET", otherSecret: 'OTHERSUPERSECRET',
}, },
}, },
json: true,
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
process.exit(1); process.exit(1);
} }
})(); })();
@@ -0,0 +1,273 @@
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
const got = require('got');
const { when } = require('jest-when');
const { exportSecrets } = require('../../action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8201'}`;
describe('integration', () => {
beforeAll(async () => {
try {
// Verify Connection
await got(`${vaultUrl}/v1/secret/config`, {
headers: {
'X-Vault-Token': 'testtoken',
},
});
// Create namespace
await got(`${vaultUrl}/v1/sys/namespaces/ns1`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
}
});
// Enable secret engine
await got(`${vaultUrl}/v1/sys/mounts/secret`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns1',
},
json: { path: 'secret', type: 'kv', config: {}, options: { version: 2 }, generate_signing_key: true },
});
await got(`${vaultUrl}/v1/secret/data/test`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns1',
},
json: {
data: {
secret: 'SUPERSECRET_IN_NAMESPACE',
},
},
});
await got(`${vaultUrl}/v1/secret/data/nested/test`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns1',
},
json: {
data: {
otherSecret: 'OTHERSUPERSECRET_IN_NAMESPACE',
},
},
});
} catch (e) {
console.error('Failed to setup test', e);
throw e;
}
});
beforeEach(() => {
jest.resetAllMocks();
when(core.getInput)
.calledWith('url')
.mockReturnValue(`${vaultUrl}`);
when(core.getInput)
.calledWith('token')
.mockReturnValue('testtoken');
when(core.getInput)
.calledWith('namespace')
.mockReturnValue('ns1');
});
function mockInput(secrets) {
when(core.getInput)
.calledWith('secrets')
.mockReturnValue(secrets);
}
it('get simple secret', async () => {
mockInput('test secret');
await exportSecrets();
expect(core.exportVariable).toBeCalledWith('SECRET', 'SUPERSECRET_IN_NAMESPACE');
});
it('re-map secret', async () => {
mockInput('test secret | TEST_KEY');
await exportSecrets();
expect(core.exportVariable).toBeCalledWith('TEST_KEY', 'SUPERSECRET_IN_NAMESPACE');
});
it('get nested secret', async () => {
mockInput('nested/test otherSecret');
await exportSecrets();
expect(core.exportVariable).toBeCalledWith('OTHERSECRET', 'OTHERSUPERSECRET_IN_NAMESPACE');
});
it('get multiple secrets', async () => {
mockInput(`
test secret ;
test secret | NAMED_SECRET ;
nested/test otherSecret ;`);
await exportSecrets();
expect(core.exportVariable).toBeCalledTimes(3);
expect(core.exportVariable).toBeCalledWith('SECRET', 'SUPERSECRET_IN_NAMESPACE');
expect(core.exportVariable).toBeCalledWith('NAMED_SECRET', 'SUPERSECRET_IN_NAMESPACE');
expect(core.exportVariable).toBeCalledWith('OTHERSECRET', 'OTHERSUPERSECRET_IN_NAMESPACE');
});
});
describe('authenticate with approle', () => {
let roleId;
let secretId;
beforeAll(async () => {
try {
// Verify Connection
await got(`${vaultUrl}/v1/secret/config`, {
headers: {
'X-Vault-Token': 'testtoken',
},
});
// Create namespace
await got(`${vaultUrl}/v1/sys/namespaces/ns2`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
},
});
// Enable secret engine
await got(`${vaultUrl}/v1/sys/mounts/secret`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
json: { path: 'secret', type: 'kv', config: {}, options: { version: 2 }, generate_signing_key: true },
});
// Add secret
await got(`${vaultUrl}/v1/secret/data/test`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
json: {
data: {
secret: 'SUPERSECRET_WITH_APPROLE',
},
},
});
// Enable approle
await got(`${vaultUrl}/v1/sys/auth/approle`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
json: {
type: 'approle'
},
});
// Create policies
await got(`${vaultUrl}/v1/sys/policies/acl/test`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
json: {
"name":"test",
"policy":"path \"auth/approle/*\" {\n capabilities = [\"read\", \"list\"]\n}\npath \"auth/approle/role/my-role/role-id\"\n{\n capabilities = [\"create\", \"read\", \"update\", \"delete\", \"list\"]\n}\npath \"auth/approle/role/my-role/secret-id\"\n{\n capabilities = [\"create\", \"read\", \"update\", \"delete\", \"list\"]\n}\n\npath \"secret/data/*\" {\n capabilities = [\"list\"]\n}\npath \"secret/metadata/*\" {\n capabilities = [\"list\"]\n}\n\npath \"secret/data/test\" {\n capabilities = [\"read\", \"list\"]\n}\npath \"secret/metadata/test\" {\n capabilities = [\"read\", \"list\"]\n}\npath \"secret/data/test/*\" {\n capabilities = [\"read\", \"list\"]\n}\npath \"secret/metadata/test/*\" {\n capabilities = [\"read\", \"list\"]\n}\n"
},
});
// Create approle
await got(`${vaultUrl}/v1/auth/approle/role/my-role`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
json: {
policies: 'test'
},
});
// Get role-id
const roldIdResponse = await got(`${vaultUrl}/v1/auth/approle/role/my-role/role-id`, {
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
responseType: 'json',
});
roleId = roldIdResponse.body.data.role_id;
// Get secret-id
const secretIdResponse = await got(`${vaultUrl}/v1/auth/approle/role/my-role/secret-id`, {
method: 'POST',
headers: {
'X-Vault-Token': 'testtoken',
'X-Vault-Namespace': 'ns2',
},
responseType: 'json',
});
secretId = secretIdResponse.body.data.secret_id;
} catch(err) {
console.warn('Create approle', err);
throw err;
}
});
beforeEach(() => {
jest.resetAllMocks();
when(core.getInput)
.calledWith('method')
.mockReturnValue('approle');
when(core.getInput)
.calledWith('roleId')
.mockReturnValue(roleId);
when(core.getInput)
.calledWith('secretId')
.mockReturnValue(secretId);
when(core.getInput)
.calledWith('url')
.mockReturnValue(`${vaultUrl}`);
when(core.getInput)
.calledWith('namespace')
.mockReturnValue('ns2');
});
function mockInput(secrets) {
when(core.getInput)
.calledWith('secrets')
.mockReturnValue(secrets);
}
it('authenticate with approle', async()=> {
mockInput('test secret');
await exportSecrets();
expect(core.exportVariable).toBeCalledWith('SECRET', 'SUPERSECRET_WITH_APPROLE');
})
});
@@ -0,0 +1,3 @@
module.exports = {
verbose: true
};
+1 -1
View File
@@ -1,3 +1,3 @@
module.exports = { module.exports = {
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/integration/', '<rootDir>/e2e/'], testPathIgnorePatterns: ['/node_modules/', '<rootDir>/integrationTests/'],
}; };
+220 -155
View File
@@ -810,16 +810,16 @@
} }
}, },
"@sindresorhus/is": { "@sindresorhus/is": {
"version": "0.14.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-1.2.0.tgz",
"integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" "integrity": "sha512-mwhXGkRV5dlvQc4EgPDxDxO6WuMBVymGFd1CA+2Y+z5dG9MNspoQ+AWjl/Ld1MnpCL8AKbosZlDVohqcIwuWsw=="
}, },
"@szmarczak/http-timer": { "@szmarczak/http-timer": {
"version": "1.1.2", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.0.tgz",
"integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", "integrity": "sha512-3yoXv8OtGr/r3R5gaWWNQ3VUoQ5G3Gmo8DXX95V14ZVvE2b7Pj6Ide9uIDON8ym4D/ItyfL9ejohYUPqOyvRXw==",
"requires": { "requires": {
"defer-to-connect": "^1.0.1" "defer-to-connect": "^1.1.1"
} }
}, },
"@types/babel__core": { "@types/babel__core": {
@@ -863,6 +863,17 @@
"@babel/types": "^7.3.0" "@babel/types": "^7.3.0"
} }
}, },
"@types/cacheable-request": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz",
"integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==",
"requires": {
"@types/http-cache-semantics": "*",
"@types/keyv": "*",
"@types/node": "*",
"@types/responselike": "*"
}
},
"@types/events": { "@types/events": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
@@ -880,6 +891,11 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/http-cache-semantics": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz",
"integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A=="
},
"@types/istanbul-lib-coverage": { "@types/istanbul-lib-coverage": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz",
@@ -920,6 +936,14 @@
"integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==", "integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==",
"dev": true "dev": true
}, },
"@types/keyv": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz",
"integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==",
"requires": {
"@types/node": "*"
}
},
"@types/minimatch": { "@types/minimatch": {
"version": "3.0.3", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@@ -929,8 +953,7 @@
"@types/node": { "@types/node": {
"version": "12.7.5", "version": "12.7.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz",
"integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==", "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w=="
"dev": true
}, },
"@types/normalize-package-data": { "@types/normalize-package-data": {
"version": "2.4.0", "version": "2.4.0",
@@ -938,6 +961,14 @@
"integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
"dev": true "dev": true
}, },
"@types/responselike": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz",
"integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==",
"requires": {
"@types/node": "*"
}
},
"@types/retry": { "@types/retry": {
"version": "0.12.0", "version": "0.12.0",
"resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz",
@@ -965,6 +996,12 @@
"integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==", "integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg==",
"dev": true "dev": true
}, },
"@zeit/ncc": {
"version": "0.20.5",
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.20.5.tgz",
"integrity": "sha512-XU6uzwvv95DqxciQx+aOLhbyBx/13ky+RK1y88Age9Du3BlA4mMPCy13BGjayOrrumOzlq1XV3SD/BWiZENXlw==",
"dev": true
},
"JSONStream": { "JSONStream": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
@@ -1457,10 +1494,18 @@
"unset-value": "^1.0.0" "unset-value": "^1.0.0"
} }
}, },
"cacheable-lookup": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-0.2.1.tgz",
"integrity": "sha512-BQ8MRjxJASEq2q+w0SusPU3B054gS278K8sj58QCLMZIso5qG05+MdCdmXxuyVlfvI8h4bPsNOavVUauVCGxrg==",
"requires": {
"keyv": "^3.1.0"
}
},
"cacheable-request": { "cacheable-request": {
"version": "6.1.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.0.tgz",
"integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", "integrity": "sha512-UVG4gMn3WjnAeFBBx7RFoprgOANIAkMwN5Dta6ONmfSwrCxfm0Ip7g0mIBxIRJZX9aDsoID0Ry3dU5Pr0csKKA==",
"requires": { "requires": {
"clone-response": "^1.0.2", "clone-response": "^1.0.2",
"get-stream": "^5.1.0", "get-stream": "^5.1.0",
@@ -1468,7 +1513,7 @@
"keyv": "^3.0.0", "keyv": "^3.0.0",
"lowercase-keys": "^2.0.0", "lowercase-keys": "^2.0.0",
"normalize-url": "^4.1.0", "normalize-url": "^4.1.0",
"responselike": "^1.0.2" "responselike": "^2.0.0"
}, },
"dependencies": { "dependencies": {
"get-stream": { "get-stream": {
@@ -1478,11 +1523,6 @@
"requires": { "requires": {
"pump": "^3.0.0" "pump": "^3.0.0"
} }
},
"lowercase-keys": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
"integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
} }
} }
}, },
@@ -1640,6 +1680,13 @@
"integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=",
"requires": { "requires": {
"mimic-response": "^1.0.0" "mimic-response": "^1.0.0"
},
"dependencies": {
"mimic-response": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
}
} }
}, },
"co": { "co": {
@@ -1946,11 +1993,11 @@
"dev": true "dev": true
}, },
"decompress-response": { "decompress-response": {
"version": "3.3.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-5.0.0.tgz",
"integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "integrity": "sha512-TLZWWybuxWgoW7Lykv+gq9xvzOsUjQ9tF09Tj6NSTYGMTCHNXzrPnD6Hi+TgZq19PyTAGH4Ll/NIM/eTGglnMw==",
"requires": { "requires": {
"mimic-response": "^1.0.0" "mimic-response": "^2.0.0"
} }
}, },
"deep-extend": { "deep-extend": {
@@ -1966,9 +2013,9 @@
"dev": true "dev": true
}, },
"defer-to-connect": { "defer-to-connect": {
"version": "1.0.2", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.0.2.tgz", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.1.tgz",
"integrity": "sha512-k09hcQcTDY+cwgiwa6PYKLm3jlagNzQ+RSvhjzESOGOx+MNOuXkxTfEvPrO1IOQ81tArCFYQgi631clB70RpQw==" "integrity": "sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ=="
}, },
"define-properties": { "define-properties": {
"version": "1.1.3", "version": "1.1.3",
@@ -3178,6 +3225,7 @@
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
"dev": true,
"requires": { "requires": {
"pump": "^3.0.0" "pump": "^3.0.0"
} }
@@ -3276,21 +3324,39 @@
} }
}, },
"got": { "got": {
"version": "9.6.0", "version": "10.2.2",
"resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", "resolved": "https://registry.npmjs.org/got/-/got-10.2.2.tgz",
"integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", "integrity": "sha512-QibZN13xHH/mc7H5uuU2xq28xxs8moEPsJrW9AQQX0jAV4DkGdllHDVE9cxw1nntIPFk8xzzOrgJZBg194AWrg==",
"requires": { "requires": {
"@sindresorhus/is": "^0.14.0", "@sindresorhus/is": "^1.0.0",
"@szmarczak/http-timer": "^1.1.2", "@szmarczak/http-timer": "^4.0.0",
"cacheable-request": "^6.0.0", "@types/cacheable-request": "^6.0.1",
"decompress-response": "^3.3.0", "cacheable-lookup": "^0.2.1",
"cacheable-request": "^7.0.0",
"decompress-response": "^5.0.0",
"duplexer3": "^0.1.4", "duplexer3": "^0.1.4",
"get-stream": "^4.1.0", "get-stream": "^5.0.0",
"lowercase-keys": "^1.0.1", "lowercase-keys": "^2.0.0",
"mimic-response": "^1.0.1", "mimic-response": "^2.0.0",
"p-cancelable": "^1.0.0", "p-cancelable": "^2.0.0",
"to-readable-stream": "^1.0.0", "responselike": "^2.0.0",
"url-parse-lax": "^3.0.0" "to-readable-stream": "^2.0.0",
"type-fest": "^0.8.0"
},
"dependencies": {
"get-stream": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz",
"integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==",
"requires": {
"pump": "^3.0.0"
}
},
"type-fest": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA=="
}
} }
}, },
"graceful-fs": { "graceful-fs": {
@@ -3306,9 +3372,9 @@
"dev": true "dev": true
}, },
"handlebars": { "handlebars": {
"version": "4.2.1", "version": "4.5.3",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.2.1.tgz", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
"integrity": "sha512-bqPIlDk06UWbVEIFoYj+LVo42WhK96J+b25l7hbFDpxrOXMphFM3fNIm+cluwg4Pk2jiLjWU5nHQY7igGE75NQ==", "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==",
"dev": true, "dev": true,
"requires": { "requires": {
"neo-async": "^2.6.0", "neo-async": "^2.6.0",
@@ -4663,9 +4729,9 @@
} }
}, },
"lowercase-keys": { "lowercase-keys": {
"version": "1.0.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
"integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
}, },
"lru-cache": { "lru-cache": {
"version": "5.1.1", "version": "5.1.1",
@@ -4883,9 +4949,9 @@
"dev": true "dev": true
}, },
"mimic-response": { "mimic-response": {
"version": "1.0.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.0.0.tgz",
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" "integrity": "sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ=="
}, },
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
@@ -5131,9 +5197,9 @@
"integrity": "sha512-rjH3yRt0Ssx19mUwS0hrDUOdG9VI+oRLpLHJ7tXRdjcuQ7v7wo6qPvOZppHRrqfslTKr0L2yBhjj4UXd7c3cQg==" "integrity": "sha512-rjH3yRt0Ssx19mUwS0hrDUOdG9VI+oRLpLHJ7tXRdjcuQ7v7wo6qPvOZppHRrqfslTKr0L2yBhjj4UXd7c3cQg=="
}, },
"npm": { "npm": {
"version": "6.11.3", "version": "6.13.4",
"resolved": "https://registry.npmjs.org/npm/-/npm-6.11.3.tgz", "resolved": "https://registry.npmjs.org/npm/-/npm-6.13.4.tgz",
"integrity": "sha512-K2h+MPzZiY39Xf6eHEdECe/LKoJXam4UCflz5kIxoskN3LQFeYs5fqBGT5i4TtM/aBk+86Mcf+jgXs/WuWAutQ==", "integrity": "sha512-vTcUL4SCg3AzwInWTbqg1OIaOXlzKSS8Mb8kc5avwrJpcvevDA5J9BhYSuei+fNs3pwOp4lzA5x2FVDXACvoXA==",
"dev": true, "dev": true,
"requires": { "requires": {
"JSONStream": "^1.3.5", "JSONStream": "^1.3.5",
@@ -5142,12 +5208,12 @@
"ansistyles": "~0.1.3", "ansistyles": "~0.1.3",
"aproba": "^2.0.0", "aproba": "^2.0.0",
"archy": "~1.0.0", "archy": "~1.0.0",
"bin-links": "^1.1.3", "bin-links": "^1.1.6",
"bluebird": "^3.5.5", "bluebird": "^3.5.5",
"byte-size": "^5.0.1", "byte-size": "^5.0.1",
"cacache": "^12.0.3", "cacache": "^12.0.3",
"call-limit": "^1.1.1", "call-limit": "^1.1.1",
"chownr": "^1.1.2", "chownr": "^1.1.3",
"ci-info": "^2.0.0", "ci-info": "^2.0.0",
"cli-columns": "^3.1.2", "cli-columns": "^3.1.2",
"cli-table3": "^0.5.1", "cli-table3": "^0.5.1",
@@ -5163,11 +5229,11 @@
"find-npm-prefix": "^1.0.2", "find-npm-prefix": "^1.0.2",
"fs-vacuum": "~1.2.10", "fs-vacuum": "~1.2.10",
"fs-write-stream-atomic": "~1.0.10", "fs-write-stream-atomic": "~1.0.10",
"gentle-fs": "^2.2.1", "gentle-fs": "^2.3.0",
"glob": "^7.1.4", "glob": "^7.1.4",
"graceful-fs": "^4.2.2", "graceful-fs": "^4.2.3",
"has-unicode": "~2.0.1", "has-unicode": "~2.0.1",
"hosted-git-info": "^2.8.2", "hosted-git-info": "^2.8.5",
"iferr": "^1.0.2", "iferr": "^1.0.2",
"imurmurhash": "*", "imurmurhash": "*",
"infer-owner": "^1.0.4", "infer-owner": "^1.0.4",
@@ -5178,7 +5244,7 @@
"is-cidr": "^3.0.0", "is-cidr": "^3.0.0",
"json-parse-better-errors": "^1.0.2", "json-parse-better-errors": "^1.0.2",
"lazy-property": "~1.0.0", "lazy-property": "~1.0.0",
"libcipm": "^4.0.3", "libcipm": "^4.0.7",
"libnpm": "^3.0.1", "libnpm": "^3.0.1",
"libnpmaccess": "^3.0.2", "libnpmaccess": "^3.0.2",
"libnpmhook": "^5.0.3", "libnpmhook": "^5.0.3",
@@ -5204,33 +5270,33 @@
"mississippi": "^3.0.0", "mississippi": "^3.0.0",
"mkdirp": "~0.5.1", "mkdirp": "~0.5.1",
"move-concurrently": "^1.0.1", "move-concurrently": "^1.0.1",
"node-gyp": "^5.0.3", "node-gyp": "^5.0.5",
"nopt": "~4.0.1", "nopt": "~4.0.1",
"normalize-package-data": "^2.5.0", "normalize-package-data": "^2.5.0",
"npm-audit-report": "^1.3.2", "npm-audit-report": "^1.3.2",
"npm-cache-filename": "~1.0.2", "npm-cache-filename": "~1.0.2",
"npm-install-checks": "~3.0.0", "npm-install-checks": "^3.0.2",
"npm-lifecycle": "^3.1.3", "npm-lifecycle": "^3.1.4",
"npm-package-arg": "^6.1.1", "npm-package-arg": "^6.1.1",
"npm-packlist": "^1.4.4", "npm-packlist": "^1.4.7",
"npm-pick-manifest": "^3.0.2", "npm-pick-manifest": "^3.0.2",
"npm-profile": "^4.0.2", "npm-profile": "^4.0.2",
"npm-registry-fetch": "^4.0.0", "npm-registry-fetch": "^4.0.2",
"npm-user-validate": "~1.0.0", "npm-user-validate": "~1.0.0",
"npmlog": "~4.1.2", "npmlog": "~4.1.2",
"once": "~1.4.0", "once": "~1.4.0",
"opener": "^1.5.1", "opener": "^1.5.1",
"osenv": "^0.1.5", "osenv": "^0.1.5",
"pacote": "^9.5.8", "pacote": "^9.5.11",
"path-is-inside": "~1.0.2", "path-is-inside": "~1.0.2",
"promise-inflight": "~1.0.1", "promise-inflight": "~1.0.1",
"qrcode-terminal": "^0.12.0", "qrcode-terminal": "^0.12.0",
"query-string": "^6.8.2", "query-string": "^6.8.2",
"qw": "~1.0.1", "qw": "~1.0.1",
"read": "~1.0.7", "read": "~1.0.7",
"read-cmd-shim": "^1.0.4", "read-cmd-shim": "^1.0.5",
"read-installed": "~4.0.3", "read-installed": "~4.0.3",
"read-package-json": "^2.1.0", "read-package-json": "^2.1.1",
"read-package-tree": "^5.3.1", "read-package-tree": "^5.3.1",
"readable-stream": "^3.4.0", "readable-stream": "^3.4.0",
"readdir-scoped-modules": "^1.1.0", "readdir-scoped-modules": "^1.1.0",
@@ -5244,8 +5310,8 @@
"sorted-object": "~2.0.1", "sorted-object": "~2.0.1",
"sorted-union-stream": "~2.1.3", "sorted-union-stream": "~2.1.3",
"ssri": "^6.0.1", "ssri": "^6.0.1",
"stringify-package": "^1.0.0", "stringify-package": "^1.0.1",
"tar": "^4.4.10", "tar": "^4.4.13",
"text-table": "~0.2.0", "text-table": "~0.2.0",
"tiny-relative-date": "^1.3.0", "tiny-relative-date": "^1.3.0",
"uid-number": "0.0.6", "uid-number": "0.0.6",
@@ -5253,7 +5319,7 @@
"unique-filename": "^1.1.1", "unique-filename": "^1.1.1",
"unpipe": "~1.0.0", "unpipe": "~1.0.0",
"update-notifier": "^2.5.0", "update-notifier": "^2.5.0",
"uuid": "^3.3.2", "uuid": "^3.3.3",
"validate-npm-package-license": "^3.0.4", "validate-npm-package-license": "^3.0.4",
"validate-npm-package-name": "~3.0.0", "validate-npm-package-name": "~3.0.0",
"which": "^1.3.1", "which": "^1.3.1",
@@ -5424,14 +5490,15 @@
} }
}, },
"bin-links": { "bin-links": {
"version": "1.1.3", "version": "1.1.6",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"bluebird": "^3.5.3", "bluebird": "^3.5.3",
"cmd-shim": "^3.0.0", "cmd-shim": "^3.0.0",
"gentle-fs": "^2.0.1", "gentle-fs": "^2.3.0",
"graceful-fs": "^4.1.15", "graceful-fs": "^4.1.15",
"npm-normalize-package-bin": "^1.0.0",
"write-file-atomic": "^2.3.0" "write-file-atomic": "^2.3.0"
} }
}, },
@@ -5536,7 +5603,7 @@
} }
}, },
"chownr": { "chownr": {
"version": "1.1.2", "version": "1.1.3",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
@@ -6174,11 +6241,22 @@
} }
}, },
"fs-minipass": { "fs-minipass": {
"version": "1.2.6", "version": "1.2.7",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"minipass": "^2.2.1" "minipass": "^2.6.0"
},
"dependencies": {
"minipass": {
"version": "2.9.0",
"bundled": true,
"dev": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
}
}
} }
}, },
"fs-vacuum": { "fs-vacuum": {
@@ -6279,12 +6357,13 @@
"dev": true "dev": true
}, },
"gentle-fs": { "gentle-fs": {
"version": "2.2.1", "version": "2.3.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"aproba": "^1.1.2", "aproba": "^1.1.2",
"chownr": "^1.1.2", "chownr": "^1.1.2",
"cmd-shim": "^3.0.3",
"fs-vacuum": "^1.2.10", "fs-vacuum": "^1.2.10",
"graceful-fs": "^4.1.11", "graceful-fs": "^4.1.11",
"iferr": "^0.1.5", "iferr": "^0.1.5",
@@ -6375,7 +6454,7 @@
} }
}, },
"graceful-fs": { "graceful-fs": {
"version": "4.2.2", "version": "4.2.3",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
@@ -6417,12 +6496,9 @@
"dev": true "dev": true
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.2", "version": "2.8.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"requires": {
"lru-cache": "^5.1.1"
}
}, },
"http-cache-semantics": { "http-cache-semantics": {
"version": "3.8.1", "version": "3.8.1",
@@ -6449,7 +6525,7 @@
} }
}, },
"https-proxy-agent": { "https-proxy-agent": {
"version": "2.2.2", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -6479,7 +6555,7 @@
"dev": true "dev": true
}, },
"ignore-walk": { "ignore-walk": {
"version": "3.0.1", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -6733,7 +6809,7 @@
} }
}, },
"libcipm": { "libcipm": {
"version": "4.0.3", "version": "4.0.7",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7036,7 +7112,7 @@
} }
}, },
"make-fetch-happen": { "make-fetch-happen": {
"version": "5.0.0", "version": "5.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7044,7 +7120,7 @@
"cacache": "^12.0.0", "cacache": "^12.0.0",
"http-cache-semantics": "^3.8.1", "http-cache-semantics": "^3.8.1",
"http-proxy-agent": "^2.1.0", "http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.1", "https-proxy-agent": "^2.2.3",
"lru-cache": "^5.1.1", "lru-cache": "^5.1.1",
"mississippi": "^3.0.0", "mississippi": "^3.0.0",
"node-fetch-npm": "^2.0.2", "node-fetch-npm": "^2.0.2",
@@ -7097,30 +7173,25 @@
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"minipass": { "minizlib": {
"version": "2.3.3", "version": "1.3.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "minipass": "^2.9.0"
"yallist": "^3.0.0"
}, },
"dependencies": { "dependencies": {
"yallist": { "minipass": {
"version": "3.0.2", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
}
} }
} }
}, },
"minizlib": {
"version": "1.2.1",
"bundled": true,
"dev": true,
"requires": {
"minipass": "^2.2.1"
}
},
"mississippi": { "mississippi": {
"version": "3.0.0", "version": "3.0.0",
"bundled": true, "bundled": true,
@@ -7187,7 +7258,7 @@
} }
}, },
"node-gyp": { "node-gyp": {
"version": "5.0.3", "version": "5.0.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7200,7 +7271,7 @@
"request": "^2.87.0", "request": "^2.87.0",
"rimraf": "2", "rimraf": "2",
"semver": "~5.3.0", "semver": "~5.3.0",
"tar": "^4.4.8", "tar": "^4.4.12",
"which": "1" "which": "1"
}, },
"dependencies": { "dependencies": {
@@ -7259,9 +7330,12 @@
} }
}, },
"npm-bundled": { "npm-bundled": {
"version": "1.0.6", "version": "1.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"requires": {
"npm-normalize-package-bin": "^1.0.1"
}
}, },
"npm-cache-filename": { "npm-cache-filename": {
"version": "1.0.2", "version": "1.0.2",
@@ -7269,7 +7343,7 @@
"dev": true "dev": true
}, },
"npm-install-checks": { "npm-install-checks": {
"version": "3.0.0", "version": "3.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7277,7 +7351,7 @@
} }
}, },
"npm-lifecycle": { "npm-lifecycle": {
"version": "3.1.3", "version": "3.1.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7296,6 +7370,11 @@
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"npm-normalize-package-bin": {
"version": "1.0.1",
"bundled": true,
"dev": true
},
"npm-package-arg": { "npm-package-arg": {
"version": "6.1.1", "version": "6.1.1",
"bundled": true, "bundled": true,
@@ -7308,7 +7387,7 @@
} }
}, },
"npm-packlist": { "npm-packlist": {
"version": "1.4.4", "version": "1.4.7",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7337,7 +7416,7 @@
} }
}, },
"npm-registry-fetch": { "npm-registry-fetch": {
"version": "4.0.0", "version": "4.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7346,7 +7425,15 @@
"figgy-pudding": "^3.4.1", "figgy-pudding": "^3.4.1",
"lru-cache": "^5.1.1", "lru-cache": "^5.1.1",
"make-fetch-happen": "^5.0.0", "make-fetch-happen": "^5.0.0",
"npm-package-arg": "^6.1.0" "npm-package-arg": "^6.1.0",
"safe-buffer": "^5.2.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.2.0",
"bundled": true,
"dev": true
}
} }
}, },
"npm-run-path": { "npm-run-path": {
@@ -7482,7 +7569,7 @@
} }
}, },
"pacote": { "pacote": {
"version": "9.5.8", "version": "9.5.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7500,6 +7587,7 @@
"mississippi": "^3.0.0", "mississippi": "^3.0.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"normalize-package-data": "^2.4.0", "normalize-package-data": "^2.4.0",
"npm-normalize-package-bin": "^1.0.0",
"npm-package-arg": "^6.1.0", "npm-package-arg": "^6.1.0",
"npm-packlist": "^1.1.12", "npm-packlist": "^1.1.12",
"npm-pick-manifest": "^3.0.0", "npm-pick-manifest": "^3.0.0",
@@ -7518,7 +7606,7 @@
}, },
"dependencies": { "dependencies": {
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7751,7 +7839,7 @@
} }
}, },
"read-cmd-shim": { "read-cmd-shim": {
"version": "1.0.4", "version": "1.0.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7773,7 +7861,7 @@
} }
}, },
"read-package-json": { "read-package-json": {
"version": "2.1.0", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
@@ -7781,7 +7869,7 @@
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
"json-parse-better-errors": "^1.0.1", "json-parse-better-errors": "^1.0.1",
"normalize-package-data": "^2.0.0", "normalize-package-data": "^2.0.0",
"slash": "^1.0.0" "npm-normalize-package-bin": "^1.0.0"
} }
}, },
"read-package-tree": { "read-package-tree": {
@@ -7956,28 +8044,23 @@
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"slash": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"slide": { "slide": {
"version": "1.1.6", "version": "1.1.6",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"smart-buffer": { "smart-buffer": {
"version": "4.0.2", "version": "4.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
"socks": { "socks": {
"version": "2.3.2", "version": "2.3.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"ip": "^1.1.5", "ip": "1.1.5",
"smart-buffer": "4.0.2" "smart-buffer": "^4.1.0"
} }
}, },
"socks-proxy-agent": { "socks-proxy-agent": {
@@ -8192,7 +8275,7 @@
} }
}, },
"stringify-package": { "stringify-package": {
"version": "1.0.0", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
@@ -8223,13 +8306,13 @@
} }
}, },
"tar": { "tar": {
"version": "4.4.10", "version": "4.4.13",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"chownr": "^1.1.1", "chownr": "^1.1.1",
"fs-minipass": "^1.2.5", "fs-minipass": "^1.2.5",
"minipass": "^2.3.5", "minipass": "^2.8.6",
"minizlib": "^1.2.1", "minizlib": "^1.2.1",
"mkdirp": "^0.5.0", "mkdirp": "^0.5.0",
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
@@ -8237,18 +8320,13 @@
}, },
"dependencies": { "dependencies": {
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.9.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
} }
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
} }
} }
}, },
@@ -8429,7 +8507,7 @@
} }
}, },
"uuid": { "uuid": {
"version": "3.3.2", "version": "3.3.3",
"bundled": true, "bundled": true,
"dev": true "dev": true
}, },
@@ -8773,9 +8851,9 @@
} }
}, },
"p-cancelable": { "p-cancelable": {
"version": "1.1.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.0.0.tgz",
"integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" "integrity": "sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg=="
}, },
"p-each-series": { "p-each-series": {
"version": "1.0.0", "version": "1.0.0",
@@ -9023,11 +9101,6 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
"dev": true "dev": true
}, },
"prepend-http": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
},
"pretty-format": { "pretty-format": {
"version": "24.9.0", "version": "24.9.0",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz",
@@ -9324,11 +9397,11 @@
"dev": true "dev": true
}, },
"responselike": { "responselike": {
"version": "1.0.2", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz",
"integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==",
"requires": { "requires": {
"lowercase-keys": "^1.0.0" "lowercase-keys": "^2.0.0"
} }
}, },
"ret": { "ret": {
@@ -10239,9 +10312,9 @@
} }
}, },
"to-readable-stream": { "to-readable-stream": {
"version": "1.0.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-2.1.0.tgz",
"integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" "integrity": "sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w=="
}, },
"to-regex": { "to-regex": {
"version": "3.0.2", "version": "3.0.2",
@@ -10437,14 +10510,6 @@
"integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==",
"dev": true "dev": true
}, },
"url-parse-lax": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
"integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=",
"requires": {
"prepend-http": "^2.0.0"
}
},
"use": { "use": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
+7 -4
View File
@@ -2,11 +2,13 @@
"name": "vault-action", "name": "vault-action",
"version": "0.1.0", "version": "0.1.0",
"description": "A Github Action that allows you to consume vault secrets as secure environment variables.", "description": "A Github Action that allows you to consume vault secrets as secure environment variables.",
"main": "index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"build": "ncc build index.js -o dist",
"test": "jest", "test": "jest",
"test:integration": "jest -c integration/jest.config.js", "test:integration:basic": "jest -c integrationTests/basic/jest.config.js",
"test:e2e": "jest -c e2e/jest.config.js" "test:integration:enterprise": "jest -c integrationTests/enterprise/jest.config.js",
"test:e2e": "jest -c integrationTests/e2e/jest.config.js"
}, },
"release": { "release": {
"branch": "master", "branch": "master",
@@ -37,10 +39,11 @@
"homepage": "https://github.com/RichiCoder1/vault-action#readme", "homepage": "https://github.com/RichiCoder1/vault-action#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.1.1", "@actions/core": "^1.1.1",
"got": "^9.6.0" "got": "^10.2.2"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^24.0.18", "@types/jest": "^24.0.18",
"@zeit/ncc": "^0.20.5",
"jest": "^24.9.0", "jest": "^24.9.0",
"jest-when": "^2.7.0", "jest-when": "^2.7.0",
"semantic-release": "^15.13.24" "semantic-release": "^15.13.24"