@nestjs/jwt
Advanced tools
Comparing version 8.0.0 to 8.0.1
@@ -13,11 +13,9 @@ ## PR Checklist | ||
<!-- Please check the one that applies to this PR using "x". --> | ||
``` | ||
[ ] Bugfix | ||
[ ] Feature | ||
[ ] Code style update (formatting, local variables) | ||
[ ] Refactoring (no functional changes, no api changes) | ||
[ ] Build related changes | ||
[ ] CI related changes | ||
[ ] Other... Please describe: | ||
``` | ||
- [ ] Bugfix | ||
- [ ] Feature | ||
- [ ] Code style update (formatting, local variables) | ||
- [ ] Refactoring (no functional changes, no api changes) | ||
- [ ] Build related changes | ||
- [ ] CI related changes | ||
- [ ] Other... Please describe: | ||
@@ -34,6 +32,4 @@ ## What is the current behavior? | ||
## Does this PR introduce a breaking change? | ||
``` | ||
[ ] Yes | ||
[ ] No | ||
``` | ||
- [ ] Yes | ||
- [ ] No | ||
@@ -43,2 +39,2 @@ <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> | ||
## Other information | ||
## Other information |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./interfaces")); | ||
__export(require("./jwt.module")); | ||
__export(require("./jwt.service")); | ||
__exportStar(require("./interfaces"), exports); | ||
__exportStar(require("./jwt.module"), exports); | ||
__exportStar(require("./jwt.service"), exports); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./jwt-module-options.interface")); | ||
__exportStar(require("./jwt-module-options.interface"), exports); |
/// <reference types="node" /> | ||
import { ModuleMetadata, Type } from '@nestjs/common/interfaces'; | ||
import { ModuleMetadata, Type } from '@nestjs/common'; | ||
import * as jwt from 'jsonwebtoken'; | ||
@@ -4,0 +4,0 @@ export declare enum JwtSecretRequestType { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JwtSecretRequestType = void 0; | ||
var JwtSecretRequestType; | ||
@@ -4,0 +5,0 @@ (function (JwtSecretRequestType) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JWT_MODULE_OPTIONS = void 0; | ||
exports.JWT_MODULE_OPTIONS = 'JWT_MODULE_OPTIONS'; |
@@ -19,2 +19,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JwtModule = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
@@ -28,3 +29,3 @@ const jwt_constants_1 = require("./jwt.constants"); | ||
module: JwtModule_1, | ||
providers: jwt_providers_1.createJwtProvider(options) | ||
providers: (0, jwt_providers_1.createJwtProvider)(options) | ||
}; | ||
@@ -67,3 +68,3 @@ } | ||
JwtModule = JwtModule_1 = __decorate([ | ||
common_1.Module({ | ||
(0, common_1.Module)({ | ||
providers: [jwt_service_1.JwtService], | ||
@@ -70,0 +71,0 @@ exports: [jwt_service_1.JwtService] |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createJwtProvider = void 0; | ||
const jwt_constants_1 = require("./jwt.constants"); | ||
@@ -4,0 +5,0 @@ function createJwtProvider(options) { |
/// <reference types="node" /> | ||
import * as jwt from 'jsonwebtoken'; | ||
import { JwtModuleOptions, JwtSignOptions, JwtVerifyOptions } from './interfaces/jwt-module-options.interface'; | ||
import { JwtModuleOptions, JwtSignOptions, JwtVerifyOptions } from './interfaces'; | ||
export declare class JwtService { | ||
private readonly options; | ||
private readonly logger; | ||
constructor(options: JwtModuleOptions); | ||
constructor(options?: JwtModuleOptions); | ||
sign(payload: string | Buffer | object, options?: JwtSignOptions): string; | ||
@@ -9,0 +9,0 @@ signAsync(payload: string | Buffer | object, options?: JwtSignOptions): Promise<string>; |
@@ -15,8 +15,9 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JwtService = void 0; | ||
const common_1 = require("@nestjs/common"); | ||
const jwt = require("jsonwebtoken"); | ||
const jwt_module_options_interface_1 = require("./interfaces/jwt-module-options.interface"); | ||
const interfaces_1 = require("./interfaces"); | ||
const jwt_constants_1 = require("./jwt.constants"); | ||
let JwtService = class JwtService { | ||
constructor(options) { | ||
constructor(options = {}) { | ||
this.options = options; | ||
@@ -27,3 +28,3 @@ this.logger = new common_1.Logger('JwtService'); | ||
const signOptions = this.mergeJwtOptions(Object.assign({}, options), 'signOptions'); | ||
const secret = this.getSecretKey(payload, options, 'privateKey', jwt_module_options_interface_1.JwtSecretRequestType.SIGN); | ||
const secret = this.getSecretKey(payload, options, 'privateKey', interfaces_1.JwtSecretRequestType.SIGN); | ||
return jwt.sign(payload, secret, signOptions); | ||
@@ -33,3 +34,3 @@ } | ||
const signOptions = this.mergeJwtOptions(Object.assign({}, options), 'signOptions'); | ||
const secret = this.getSecretKey(payload, options, 'privateKey', jwt_module_options_interface_1.JwtSecretRequestType.SIGN); | ||
const secret = this.getSecretKey(payload, options, 'privateKey', interfaces_1.JwtSecretRequestType.SIGN); | ||
return new Promise((resolve, reject) => jwt.sign(payload, secret, signOptions, (err, encoded) => err ? reject(err) : resolve(encoded))); | ||
@@ -39,3 +40,3 @@ } | ||
const verifyOptions = this.mergeJwtOptions(Object.assign({}, options), 'verifyOptions'); | ||
const secret = this.getSecretKey(token, options, 'publicKey', jwt_module_options_interface_1.JwtSecretRequestType.VERIFY); | ||
const secret = this.getSecretKey(token, options, 'publicKey', interfaces_1.JwtSecretRequestType.VERIFY); | ||
return jwt.verify(token, secret, verifyOptions); | ||
@@ -45,3 +46,3 @@ } | ||
const verifyOptions = this.mergeJwtOptions(Object.assign({}, options), 'verifyOptions'); | ||
const secret = this.getSecretKey(token, options, 'publicKey', jwt_module_options_interface_1.JwtSecretRequestType.VERIFY); | ||
const secret = this.getSecretKey(token, options, 'publicKey', interfaces_1.JwtSecretRequestType.VERIFY); | ||
return new Promise((resolve, reject) => jwt.verify(token, secret, verifyOptions, (err, decoded) => err ? reject(err) : resolve(decoded))); | ||
@@ -82,6 +83,7 @@ } | ||
JwtService = __decorate([ | ||
common_1.Injectable(), | ||
__param(0, common_1.Inject(jwt_constants_1.JWT_MODULE_OPTIONS)), | ||
(0, common_1.Injectable)(), | ||
__param(0, (0, common_1.Optional)()), | ||
__param(0, (0, common_1.Inject)(jwt_constants_1.JWT_MODULE_OPTIONS)), | ||
__metadata("design:paramtypes", [Object]) | ||
], JwtService); | ||
exports.JwtService = JwtService; |
{ | ||
"name": "@nestjs/jwt", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@jwt)", | ||
@@ -24,25 +24,25 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@commitlint/cli": "12.1.4", | ||
"@commitlint/config-angular": "12.1.4", | ||
"jest": "27.0.6", | ||
"ts-jest": "27.0.3", | ||
"@commitlint/cli": "17.0.0", | ||
"@commitlint/config-angular": "17.0.0", | ||
"jest": "28.1.0", | ||
"ts-jest": "28.0.2", | ||
"reflect-metadata": "0.1.13", | ||
"@nestjs/core": "8.0.0", | ||
"@nestjs/testing": "8.0.0", | ||
"@types/jest": "26.0.24", | ||
"@typescript-eslint/eslint-plugin": "4.28.2", | ||
"@typescript-eslint/parser": "4.28.2", | ||
"eslint": "7.30.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-plugin-import": "2.23.4", | ||
"@nestjs/common": "8.0.0", | ||
"@types/node": "14.17.4", | ||
"husky": "7.0.1", | ||
"lint-staged": "11.0.0", | ||
"prettier": "2.3.2", | ||
"release-it": "14.10.0", | ||
"typescript": "4.3.5" | ||
"@nestjs/core": "8.4.5", | ||
"@nestjs/testing": "8.4.5", | ||
"@types/jest": "27.5.1", | ||
"@typescript-eslint/eslint-plugin": "5.25.0", | ||
"@typescript-eslint/parser": "5.25.0", | ||
"eslint": "8.15.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"@nestjs/common": "8.4.5", | ||
"@types/node": "16.11.36", | ||
"husky": "8.0.1", | ||
"lint-staged": "12.4.1", | ||
"prettier": "2.6.2", | ||
"release-it": "15.0.0", | ||
"typescript": "4.6.4" | ||
}, | ||
"dependencies": { | ||
"@types/jsonwebtoken": "8.5.4", | ||
"@types/jsonwebtoken": "8.5.8", | ||
"jsonwebtoken": "8.5.1" | ||
@@ -49,0 +49,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48114
32
359
+ Added@types/jsonwebtoken@8.5.8(transitive)
- Removed@types/jsonwebtoken@8.5.4(transitive)
Updated@types/jsonwebtoken@8.5.8