@tsed/jwks 7.0.0-beta.2 → 7.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/jest.config.js ADDED
@@ -0,0 +1,14 @@
1
+ // For a detailed explanation regarding each configuration property, visit:
2
+ // https://jestjs.io/docs/en/configuration.html
3
+
4
+ module.exports = {
5
+ ...require("@tsed/jest-config")(__dirname, "jwk"),
6
+ coverageThreshold: {
7
+ global: {
8
+ statements: 100,
9
+ branches: 85.71,
10
+ functions: 100,
11
+ lines: 100
12
+ }
13
+ }
14
+ };
package/lib/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("jose2"), exports);
5
- (0, tslib_1.__exportStar)(require("./getJwks"), exports);
4
+ tslib_1.__exportStar(require("jose2"), exports);
5
+ tslib_1.__exportStar(require("./getJwks"), exports);
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAsB;AACtB,yDAA0B","sourcesContent":["export * from \"jose2\";\nexport * from \"./getJwks\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,oDAA0B","sourcesContent":["export * from \"jose2\";\nexport * from \"./getJwks\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/lib/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from "jose2";
2
- export * from "./getJwks";
2
+ export * from "./getJwks.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@tsed/jwks",
3
- "version": "7.0.0-beta.2",
3
+ "version": "7.0.0-beta.20",
4
4
  "description": "Utils to generate jwks pair keys",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/cjs/index.js",
7
+ "module": "./lib/esm/index.js",
7
8
  "typings": "./lib/types/index.d.ts",
8
9
  "exports": {
9
10
  "types": "./lib/types/index.d.ts",
@@ -15,12 +16,13 @@
15
16
  "build": "yarn run build:esm && yarn run build:cjs",
16
17
  "build:cjs": "tsc --build tsconfig.compile.json",
17
18
  "build:esm": "tsc --build tsconfig.compile.esm.json",
19
+ "test": "cross-env NODE_ENV=test yarn jest --max-workers=2",
18
20
  "start": "ts-node -r tsconfig-paths/register test/app/index.ts"
19
21
  },
20
22
  "dependencies": {
21
- "fs-extra": "^9.0.1",
23
+ "fs-extra": "^10.0.1",
22
24
  "jose2": "npm:jose@^2.0.4",
23
- "tslib": "2.2.0"
25
+ "tslib": "2.4.0"
24
26
  },
25
27
  "devDependencies": {},
26
28
  "peerDependencies": {},
@@ -28,7 +30,10 @@
28
30
  "bugs": {
29
31
  "url": "https://github.com/tsedio/tsed/issues"
30
32
  },
31
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/security/jwks",
33
+ "homepage": "https://github.com/tsedio/tsed/tree/beta/packages/security/jwks",
32
34
  "author": "Romain Lenzotti",
33
- "license": "MIT"
35
+ "license": "MIT",
36
+ "publishConfig": {
37
+ "tag": "beta"
38
+ }
34
39
  }
package/readme.md CHANGED
@@ -11,7 +11,8 @@
11
11
  [![npm version](https://badge.fury.io/js/%40tsed%2Fcommon.svg)](https://badge.fury.io/js/%40tsed%2Fcommon)
12
12
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
13
13
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
14
- [![backers](https://opencollective.com/tsed/tiers/badge.svg)](https://opencollective.com/tsed)
14
+ [![github](https://img.shields.io/static/v1?label=Github%20sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/romakita)
15
+ [![opencollective](https://img.shields.io/static/v1?label=OpenCollective%20sponsor&message=%E2%9D%A4&logo=OpenCollective&color=%23fe8e86)](https://opencollective.com/tsed)
15
16
 
16
17
  </div>
17
18
 
@@ -43,12 +44,12 @@ npm install --save @tsed/jwks
43
44
  import {generateJwks} from "./getJwks";
44
45
 
45
46
  // Generate only jwks
46
- const jwks = generateJwks()
47
+ const jwks = generateJwks();
47
48
 
48
49
  // Create keys.json file if not exists
49
50
  const jwks = getJwks({
50
51
  path: "path/to/keys.json"
51
- })
52
+ });
52
53
  ```
53
54
 
54
55
  Outputs:
@@ -81,16 +82,16 @@ const jwks = generateJwks({
81
82
  {path: "path/keys/sig.rsa.pub.pem", alg: "RS256", use: "sig", kid: "key-0"},
82
83
  {path: "path/keys/enc.rsa.pub.pem", alg: "RS256", use: "enc", kid: "key-1"}
83
84
  ]
84
- })
85
+ });
85
86
 
86
87
  // Create keys.json file if not exists
87
88
  const jwks = getJwks({
88
89
  path: "path/to/keys.json",
89
90
  certificates: [
90
91
  {path: "path/keys/sig.rsa.pub.pem", alg: "RS256", use: "sig", kid: "key-0"},
91
- {path: "path/keys/enc.rsa.pub.pem", alg: "RS256", use: "enc", kid: "key-1"},
92
+ {path: "path/keys/enc.rsa.pub.pem", alg: "RS256", use: "enc", kid: "key-1"}
92
93
  ]
93
- })
94
+ });
94
95
  ```
95
96
 
96
97
  ## Contributors
@@ -114,7 +115,7 @@ website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
114
115
 
115
116
  The MIT License (MIT)
116
117
 
117
- Copyright (c) 2016 - 2018 Romain Lenzotti
118
+ Copyright (c) 2016 - 2022 Romain Lenzotti
118
119
 
119
120
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
120
121
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
@@ -8,16 +8,5 @@
8
8
  "declaration": true,
9
9
  "declarationDir": "./lib/types"
10
10
  },
11
- "exclude": [
12
- "node_modules",
13
- "test",
14
- "lib",
15
- "benchmark",
16
- "coverage",
17
- "spec",
18
- "**/*.benchmark.ts",
19
- "**/*.spec.ts",
20
- "keys",
21
- "jest.config.js"
22
- ]
11
+ "exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
23
12
  }