Skip to content

Commit

Permalink
Update dependencies, enforce node >10
Browse files Browse the repository at this point in the history
  • Loading branch information
tongrhj committed Aug 29, 2020
1 parent 2385922 commit 628b789
Show file tree
Hide file tree
Showing 34 changed files with 4,636 additions and 1,899 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc.js

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
env:
mocha: true
node: true
es6: true
extends:
- eslint:recommended
- prettier
parserOptions:
ecmaVersion: 10
plugins:
- prettier
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "aws-sdk"
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: test
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10', '12', '14']
name: node-${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run test
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@ node_modules
#OS STUFF
.DS_Store
.tmp


#Test results folder
test/results
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

24 changes: 19 additions & 5 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
The MIT License (MIT)
Copyright (c) 2016 Vivint Solar
(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2012-present

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
nodecredstash
=============
# aws-credstash

[![Build Status](https://travis-ci.org/DavidTanner/nodecredstash.svg?branch=master)](https://travis-ci.org/DavidTanner/nodecredstash)
[![Coverage Status](https://coveralls.io/repos/github/DavidTanner/nodecredstash/badge.svg?branch=master)](https://coveralls.io/github/DavidTanner/nodecredstash?branch=master)
[![npm version](https://badge.fury.io/js/nodecredstash.svg)](https://badge.fury.io/js/nodecredstash)
[![dependencies](https://img.shields.io/david/DavidTanner%2Fnodecredstash.svg)](https://www.npmjs.com/package/nodecredstash)
Node.js port of [credstash](https://github.com/fugue/credstash)

[Node.js](https://nodejs.org/en/) port of [credstash](https://github.com/fugue/credstash)
Fork of [nodecredstash](https://www.npmjs.com/package/nodecredstash), largely unmodified.

=============
Main changes:
- Added requirement of >= Node 10
- Copied `@types/nodecredstash` into this module
- Moved `aws-sdk` to a peerdependency: the api of the module remains unchanged, and you should be able to swap nodecredstash out for this without anything breaking.

## Installation

$ npm install --save nodecredstash

Expand All @@ -23,9 +24,9 @@ credstash.putSecret({name: 'Death Star vulnerability', secret: 'Exhaust vent', v
```
Options
=======
## API
### Options
table
-----
Expand Down Expand Up @@ -64,8 +65,7 @@ Options that are specific to the KMS configuration. Defaults can still be assig
kms here
Function arguments
Arguments
==================
name
Expand Down Expand Up @@ -99,7 +99,7 @@ credstash.getSecret({
})
```
Functions
API
=========
.createDdbTable([cb])
Expand Down Expand Up @@ -250,7 +250,3 @@ credstash.deleteSecrets({name: 'Death Star vulnerability'})
```js
[]
```
69 changes: 69 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Type definitions for nodecredstash 2.0
// Project: https://github.com/DavidTanner/nodecredstash
// Definitions by: Mike Cook <https://github.com/migstopheles>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node"/>
import * as AWS from "aws-sdk";

interface CredstashConfig {
table?: string;
awsOpts?: AWS.KMS.ClientConfiguration;
dynamoOpts?: AWS.DynamoDB.ClientConfiguration;
kmsKey?: string;
kmsOpts?: AWS.KMS.ClientConfiguration;
}

interface CredstashContext {
[key: string]: string;
}

interface PutSecretOptions {
name: string;
secret: string;
context: CredstashContext;
digest?: string;
version?: number;
}

interface Credstash {
getHighestVersion: (options: {
name: string;
}) => Promise<AWS.DynamoDB.AttributeMap>;
incrementVersion: (options: { name: string }) => Promise<string>;
putSecret: (
options: PutSecretOptions
) => Promise<AWS.DynamoDB.DocumentClient.PutItemOutput>;
decryptStash: (
stash: { key: string },
context?: CredstashContext
) => Promise<AWS.KMS.DecryptResponse>;
getAllVersions: (options: {
name: string;
context?: CredstashContext;
limit?: number;
}) => Promise<Array<{ version: string; secret: string }>>;
getSecret: (options: {
name: string;
context?: CredstashContext;
version?: number;
}) => Promise<string>;
deleteSecrets: (options: {
name: string;
}) => Promise<AWS.DynamoDB.DocumentClient.DeleteItemOutput[]>;
deleteSecret: (options: {
name: string;
version: number;
}) => Promise<AWS.DynamoDB.DocumentClient.DeleteItemOutput>;
listSecrets: () => Promise<string[]>;
getAllSecrets: (options: {
version?: number;
context?: CredstashContext;
startsWith?: string;
}) => Promise<{ [key: string]: string }>;
createDdbTable: () => Promise<void>;
}

declare function Credstash(config: CredstashConfig): Credstash;

export = Credstash;
Loading

0 comments on commit 628b789

Please sign in to comment.