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

jose-browser-runtime

Package Overview
Dependencies
Maintainers
1
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jose-browser-runtime - npm Package Compare versions

Comparing version 3.11.4 to 3.11.5

3

dist/browser/jwks/remote.js
import parseJWK from '../jwk/parse.js';
import { JWKSInvalid, JOSENotSupported, JWKSNoMatchingKey, JWKSMultipleMatchingKeys, } from '../util/errors.js';
import fetchJson from '../runtime/fetch.js';
import isObject from '../lib/is_object.js';
function getKtyFromAlg(alg) {

@@ -18,3 +19,3 @@ switch (alg.substr(0, 2)) {

function isJWKLike(key) {
return key && typeof key === 'object';
return isObject(key);
}

@@ -21,0 +22,0 @@ class RemoteJWKSet {

@@ -0,3 +1,16 @@

function isObjectLike(value) {
return typeof value === 'object' && value !== null;
}
export default function isObject(input) {
return typeof input === 'object' && !!input && input.constructor === Object;
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
return false;
}
if (Object.getPrototypeOf(input) === null) {
return true;
}
let proto = input;
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto);
}
return Object.getPrototypeOf(input) === proto;
}

@@ -5,2 +5,3 @@ import { JWTClaimValidationFailed, JWTExpired, JWTInvalid } from '../util/errors.js';

import secs from './secs.js';
import isObject from './is_object.js';
const normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, '');

@@ -29,3 +30,3 @@ const checkAudiencePresence = (audPayload, audOption) => {

}
if (typeof payload !== 'object' || !payload || Array.isArray(payload)) {
if (!isObject(payload)) {
throw new JWTInvalid('JWT Claims Set must be a top-level JSON object');

@@ -32,0 +33,0 @@ }

{
"name": "jose-browser-runtime",
"version": "3.11.4",
"version": "3.11.5",
"description": "(Browser Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK with no dependencies",

@@ -5,0 +5,0 @@ "keywords": [

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