Skip to content

feat(build): 0.5.0 #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

module.exports = {
env: {
node: true,
mocha: true
},
parserOptions: {
ecmaVersion: 2020
},
rules: {
"no-shadow": 0,
"no-underscore-dangle": 0,
"strict": [2, "global"],
"yoda": 0
}
};
21 changes: 21 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CD

on:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: initialize Node at v4
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- run: yarn version patch
# - run: get npm token
# - run: yarn publish
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on:
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: initialize Node at v4
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- run: yarn lint
- run: yarn test
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
node_modules/
coverage/
dist/
old/
.nyc_output/
.pnp.*
.yarn/
7 changes: 0 additions & 7 deletions .hgtags

This file was deleted.

15 changes: 0 additions & 15 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/dubnium
lts/jod
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-4.9.1.cjs
nodeLinker: 'pnpm'
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Release Notes

<a name="0.5.0"></a>
## [0.5.0](https://github.com/cisco/node-kms/compare/0.3.2...0.5.0) (2025-05-20)


### Breaking Changes

* Upgraded to require Node.js 20.0.0 or later
* Migrated from Gulp to Yarn for build process
* Switched to Webpack for bundling

### Build

* Added webpack configuration for both standard and minified builds
* Added GitHub Actions workflows for continuous integration
* Updated some dependencies to recent versions

<a name="0.3.2"></a>
## [0.3.2](https://github.com/cisco/node-kms/compare/0.3.1...0.3.2) (2016-08-23)

Expand Down Expand Up @@ -27,6 +43,6 @@


<a name="0.3.0"></a>
# [0.3.0] (2015-09-17)
## [0.3.0] (2015-09-17)

Initial public release.
50 changes: 31 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# node-kms #
# node-kms

A JavaScript implementation of Key Management Service (KMS) for current web browsers and node.js-based servers. The KMS API is described in [[draft-abiggs-saag-key-management-service-02](https://tools.ietf.org/html/draft-abiggs-saag-key-management-service-02)].

Expand All @@ -7,6 +7,8 @@ A JavaScript implementation of Key Management Service (KMS) for current web brow
<a name='toc'>

- [Installing](#installing)
- [Using NPM](#using-npm)
- [Using Yarn](#using-yarn)
- [Basics](#basics)
- [KeyObjects](#keyobjects)
- [Creating](#creating)
Expand All @@ -27,6 +29,8 @@ A JavaScript implementation of Key Management Service (KMS) for current web brow

## Installing ##

### Using NPM

To install the latest from [NPM](https://npmjs.com/):

```
Expand All @@ -36,16 +40,24 @@ To install the latest from [NPM](https://npmjs.com/):
Or to install a specific release:

```
npm install node-kms@0.3.0
npm install node-kms@0.5.0
```

Alternatively, the latest unpublished code can be installed directly from the repository:
### Using Yarn

To install the latest from [NPM](https://npmjs.com/) using Yarn:

```
yarn add node-kms
```

Or to install a specific release:

```
npm install git+ssh://[email protected]:cisco/node-kms.git
yarn add node-kms@0.5.0
```

## Basics ##
## Basics

Require the library as normal:

Expand All @@ -57,11 +69,11 @@ This library uses [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaSc

This library supports [Browserify](http://browserify.org/). To use in a web browser, `require('node-kms')` and bundle with the rest of your app.

## KeyObjects ##
## KeyObjects

A KMS KeyObject wraps a JSON Web Key (JWK) to provide more semantics: a URI to locate it; the creating user and client; the date/time of when a key is created, bound, and/or expires; and the owning resource (once bound).

### Creating ###
### Creating

To create an empty KeyObject:

Expand All @@ -80,7 +92,7 @@ Alternatively, to create a KeyObject from a JSON or POJO representation:
var keyobj = new.KeyObject(input);
```

### Importing/Exporting ###
### Importing/Exporting

**NOTE**: The JSON representation includes all properties for a KeyObject, including the full JWK (if present). This can expose secret key material if not carefully handled; do not save to durable storage without protecting it (e.g., encrypting to a JWE).

Expand All @@ -102,7 +114,7 @@ To export a KeyObject to a JSON object:
var output = keyobj.toJSON();
```

### Obtaining a `node-jose` Key ###
### Obtaining a `node-jose` Key

To convert the `jwk` property of a KeyObject to a `node-jose` Key (to use for encryption or signatures):

Expand All @@ -117,11 +129,11 @@ keyobj.asKey().

If `jwk` is not set on the KeyObject, the returned Promise is rejected.

## Contexts ##
## Contexts

The KMS.Context holds onto information necessary to wrap Requests and unwrap Responses.

### Creating and Initializing ###
### Creating and Initializing

To create an empty Context:

Expand Down Expand Up @@ -150,7 +162,7 @@ kmsCtx.serverInfo = {
};
```

### Generating an Ephemeral EC Key ###
### Generating an Ephemeral EC Key

To create a KeyObject representing the local ECDH key:

Expand All @@ -162,7 +174,7 @@ kmsCtx.createECDHKey().
})
```

### Deriving an Ephemeral Shared Key ###
### Deriving an Ephemeral Shared Key

To derive an ephemeral shared key -- such as the result of the ECDHE handshake:

Expand All @@ -175,7 +187,7 @@ kmsCrx.deriveEphemeralKey(remoteECDH).
});
```

## Requests ##
## Requests

The KMS.Request embodies a single request from a client to the KMS.

Expand All @@ -189,7 +201,7 @@ A Request instance has the following (read/write) properties:

When a new `body` is set, the previous `requestId`, `method`, and `uri` are remembered, overwriting any new values that might have been in the provided JSON.

### Creating ###
### Creating

To create an empty request:

Expand All @@ -204,7 +216,7 @@ To create a request starting with a constructed body:
var request = new KMS.Request(input);
```

### Wrapping ###
### Wrapping

To wrap (encrypt) the Request into a JWE for transmitting to a KMS server, using an ephemeral shared key:

Expand All @@ -218,7 +230,7 @@ request.wrap(kmsCtx).
});
```

## Responses ##
## Responses

The KMS.Response embodies a single response to a client from the KMS.

Expand All @@ -230,7 +242,7 @@ A Response instance has the following (read/write) properties:
* `reason` -- the string reason (if any)
* `wrapped` -- the protected (encrypted or signed) `body`

### Creating ###
### Creating

To create an empty KMS.Response:

Expand All @@ -245,7 +257,7 @@ To creat a KMS.Response with a received wrapped body:
var response = new KMS.Response(input);
```

### Unwrapping ###
### Unwrapping

To unwrap a response into the plaintext body:

Expand Down
Loading