@relaybox/rest
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -43,5 +43,5 @@ "use strict"; | ||
(0, validation_1.validatePermissions)(permissions); | ||
const { keyName, secretKey } = this.apiKeyParts; | ||
const { publicKey, secretKey } = this.apiKeyParts; | ||
const timestamp = new Date().toISOString(); | ||
const payload = Object.assign(Object.assign({ keyName, | ||
const payload = Object.assign(Object.assign({ publicKey, | ||
timestamp, tokenType: DEFAULT_TOKEN_TYPE }, (permissions && { permissions })), (clientId && clientId != 'null' && { clientId })); | ||
@@ -96,3 +96,3 @@ const token = (0, signature_1.generateAuthToken)(payload, secretKey, expiresIn); | ||
}); | ||
const { keyName: publicKey, secretKey } = this.apiKeyParts; | ||
const { publicKey: publicKey, secretKey } = this.apiKeyParts; | ||
const signature = (0, signature_1.generateHmacSignature)(body, secretKey); | ||
@@ -114,3 +114,3 @@ return [body, signature, publicKey]; | ||
return { | ||
keyName: parts[0], | ||
publicKey: parts[0], | ||
secretKey: parts[1] | ||
@@ -117,0 +117,0 @@ }; |
@@ -5,4 +5,4 @@ export interface RelayBoxOptions { | ||
export interface ApiKeyParts { | ||
keyName: string; | ||
publicKey: string; | ||
secretKey: string; | ||
} |
import { JwtPayload } from 'jsonwebtoken'; | ||
import { Permissions, Permission } from './permission.types'; | ||
export interface ExtendedJwtPayload extends JwtPayload { | ||
keyName: string; | ||
publicKey: string; | ||
clientId?: string | string[]; | ||
@@ -6,0 +6,0 @@ timestamp: string; |
{ | ||
"name": "@relaybox/rest", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "RelayBox REST Services SDK. Enables seemless integration between server-side applications and RelayBox's authentication and realtime services. It provides robust functionality for generating authentication tokens, publishing events, and interacting efficiently with RelayBox's suite of services.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
30136