Skip to content

Commit d12084e

Browse files
Merge pull request #5 from solid/remove-json-document
Remove dependency on json-document.
2 parents c5cfa0e + 560660b commit d12084e

48 files changed

Lines changed: 2454 additions & 3902 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

LICENSE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 - present [Anvil Research, Inc.](http://anvil.io)
3+
Copyright (c) 2016 [Anvil Research, Inc.](http://anvil.io)
4+
Copyright (c) 2017-2019 The Solid Project
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
- [x] Based on Webcrypto API
66
- [ ] CryptoKey as expected key argument
77
- [x] Isomorphic (Node.js and Browser)
8-
- [ ] JWT Header and Payload Validation with JSON Schema
98
- [ ] Extensible JWT/JWS/JWE classes
109

1110
## Dependencies
@@ -86,4 +85,7 @@ $ npm run karma
8685

8786
## MIT License
8887

88+
[The MIT License](LICENSE.md)
89+
8990
Copyright (c) 2016 Anvil Research, Inc.
91+
Copyright (c) 2017-2019 The Solid Project

examples/HS256.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const crypto = require('@trust/webcrypto')
1+
const crypto = require('isomorphic-webcrypto')
22
const JWA = require('../src/jose/JWA')
33

44
let key

examples/JWS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require('../src/formats')
2-
const crypto = require('@trust/webcrypto')
2+
const crypto = require('isomorphic-webcrypto')
33
const JWT = require('../src/jose/JWT')
44

55
let key, jwt

examples/RS256.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const crypto = require('@trust/webcrypto')
1+
const crypto = require('isomorphic-webcrypto')
22
const JWA = require('../src/jose/JWA')
33

44
let privateKey, publicKey

package-lock.json

Lines changed: 2231 additions & 1247 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22
"name": "@solid/jose",
33
"version": "0.1.8",
44
"description": "JSON Object Signing and Encryption",
5-
"main": "lib/index.js",
5+
"main": "src/index.js",
66
"directories": {
77
"test": "test"
88
},
99
"files": [
10-
"lib",
10+
"src",
1111
"dist"
1212
],
1313
"scripts": {
14-
"build-lib": "babel src -d lib",
15-
"build": "npm run clean-lib && npm run build-lib",
16-
"clean-lib": "rm -rf lib/*",
1714
"build-dist": "webpack --progress",
18-
"dist": "npm run build && npm run build-dist",
19-
"prepare": "npm run build && npm run build-dist",
15+
"dist": "npm run build-dist",
16+
"prepare": "npm run build-dist",
2017
"test": "mocha test",
2118
"jsdoc": "jsdoc -c jsdoc.json -r"
2219
},
@@ -47,18 +44,17 @@
4744
},
4845
"homepage": "https://github.com/solid/jose#README",
4946
"dependencies": {
47+
"@sinonjs/text-encoding": "^0.7.1",
5048
"base64url": "^3.0.0",
51-
"@trust/json-document": "^0.1.4",
52-
"text-encoding": "^0.6.4",
53-
"@trust/webcrypto": "^0.9.2"
49+
"isomorphic-webcrypto": "^2.3.2"
5450
},
5551
"devDependencies": {
5652
"babel-cli": "^6.26.0",
5753
"babel-preset-env": "^1.7.0",
5854
"chai": "^4.1.2",
5955
"chai-as-promised": "^7.1.1",
6056
"dirty-chai": "^2.0.1",
61-
"mocha": "^5.2.0",
57+
"mocha": "^6.2.2",
6258
"webpack": "^4.8.3",
6359
"webpack-cli": "^3.0.2"
6460
}

src/algorithms/HMAC.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @ignore
66
*/
77
const base64url = require('base64url')
8-
const crypto = require('@trust/webcrypto')
8+
const crypto = require('isomorphic-webcrypto')
99
const TextEncoder = require('../text-encoder')
1010

1111
/**

src/algorithms/RSASSA-PKCS1-v1_5.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @ignore
66
*/
77
const base64url = require('base64url')
8-
const crypto = require('@trust/webcrypto')
8+
const crypto = require('isomorphic-webcrypto')
99
const TextEncoder = require('../text-encoder')
1010

1111
/**
@@ -85,7 +85,7 @@ class RSASSA_PKCS1_v1_5 {
8585
* @param {JWK} key
8686
* @returns {Promise}
8787
*/
88-
importKey (key) {
88+
async importKey (key) {
8989
let jwk = Object.assign({}, key)
9090
let algorithm = this.params
9191
let usages = key['key_ops'] || []

src/formats/index.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)