Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oslo

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oslo - npm Package Compare versions

Comparing version 0.10.3 to 0.10.4

6

dist/jwt/index.js

@@ -28,6 +28,6 @@ import { ECDSA, HMAC, RSASSAPKCS1v1_5, RSASSAPSS } from "../crypto/index.js";

const payloadPart = encodeBase64url(textEncoder.encode(JSON.stringify(payloadWithClaims)));
const signatureBody = textEncoder.encode([headerPart, payloadPart].join("."));
const signature = await getAlgorithm(algorithm).sign(key, signatureBody);
const data = textEncoder.encode([headerPart, payloadPart].join("."));
const signature = await getAlgorithm(algorithm).sign(key, data);
const signaturePart = encodeBase64url(signature);
return [signatureBody, signaturePart].join(".");
return [headerPart, payloadPart, signaturePart].join(".");
}

@@ -34,0 +34,0 @@ export async function validateJWT(algorithm, key, jwt) {

{
"name": "oslo",
"type": "module",
"version": "0.10.3",
"version": "0.10.4",
"description": "A collection of auth-related utilities",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -127,3 +127,3 @@ # `oslo`

const secret = new HMAC("SHA-256").generateKey();
const secret = await new HMAC("SHA-256").generateKey();

@@ -150,3 +150,3 @@ const payload = {

// check JWT signature, expiration, and not-before timestamp
const { payload, header, expiresAt } = await validateJWT("HS256", jwt, secret);
const { payload, header, expiresAt } = await validateJWT("HS256", secret, jwt);
} catch {

@@ -153,0 +153,0 @@ // invalid JWT

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc