jose-browser-runtime
Advanced tools
Comparing version 3.17.0 to 3.18.0
import { encoder, decoder } from '../lib/buffer_utils.js'; | ||
import globalThis from './global.js'; | ||
export const encode = (input) => { | ||
export const encodeBase64 = (input) => { | ||
let unencoded = input; | ||
@@ -13,5 +13,13 @@ if (typeof unencoded === 'string') { | ||
} | ||
const base64string = globalThis.btoa(arr.join('')); | ||
return base64string.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); | ||
return globalThis.btoa(arr.join('')); | ||
}; | ||
export const encode = (input) => { | ||
return encodeBase64(input).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); | ||
}; | ||
export const decodeBase64 = (encoded) => { | ||
return new Uint8Array(globalThis | ||
.atob(encoded) | ||
.split('') | ||
.map((c) => c.charCodeAt(0))); | ||
}; | ||
export const decode = (input) => { | ||
@@ -24,6 +32,3 @@ let encoded = input; | ||
try { | ||
return new Uint8Array(globalThis | ||
.atob(encoded) | ||
.split('') | ||
.map((c) => c.charCodeAt(0))); | ||
return decodeBase64(encoded); | ||
} | ||
@@ -30,0 +35,0 @@ catch (_a) { |
import { JOSEError } from '../util/errors.js'; | ||
import globalThis from './global.js'; | ||
import globalThis, { isCloudflareWorkers } from './global.js'; | ||
const fetchJwks = async (url, timeout) => { | ||
@@ -13,3 +13,3 @@ let controller; | ||
method: 'GET', | ||
...(globalThis.WebSocketPair === undefined | ||
...(!isCloudflareWorkers() | ||
? { | ||
@@ -16,0 +16,0 @@ referrerPolicy: 'no-referrer', |
{ | ||
"name": "jose-browser-runtime", | ||
"version": "3.17.0", | ||
"version": "3.18.0", | ||
"description": "(Browser Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK with no dependencies", | ||
"keywords": [ | ||
"browser", | ||
"cloudflare", | ||
"compact", | ||
@@ -11,4 +12,2 @@ "decode", | ||
"detached", | ||
"cloudflare", | ||
"workers", | ||
"ec", | ||
@@ -31,8 +30,13 @@ "ecdsa", | ||
"payload", | ||
"pem", | ||
"pkcs8", | ||
"rsa", | ||
"sign", | ||
"signature", | ||
"spki", | ||
"validate", | ||
"verify", | ||
"webcrypto" | ||
"webcrypto", | ||
"workers", | ||
"x509" | ||
], | ||
@@ -69,2 +73,4 @@ "homepage": "https://github.com/panva/jose", | ||
"./jwt/verify": "./dist/browser/jwt/verify.js", | ||
"./key/export": "./dist/browser/key/export.js", | ||
"./key/import": "./dist/browser/key/import.js", | ||
"./util/base64url": "./dist/browser/util/base64url.js", | ||
@@ -71,0 +77,0 @@ "./util/decode_protected_header": "./dist/browser/util/decode_protected_header.js", |
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
141223
108
3525