oauth4webapi
Advanced tools
Comparing version 2.0.0 to 2.0.1
let USER_AGENT; | ||
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) { | ||
const NAME = 'oauth4webapi'; | ||
const VERSION = 'v2.0.0'; | ||
const VERSION = 'v2.0.1'; | ||
USER_AGENT = `${NAME}/${VERSION}`; | ||
@@ -435,2 +435,17 @@ } | ||
} | ||
if (parameters.has('claims')) { | ||
const value = parameters.get('claims'); | ||
if (value === '[object Object]') { | ||
throw new OPE('"claims" parameter must be passed as a UTF-8 encoded JSON'); | ||
} | ||
try { | ||
claims.claims = JSON.parse(value); | ||
} | ||
catch { | ||
throw new OPE('failed to parse the "claims" parameter as JSON'); | ||
} | ||
if (!isJsonObject(claims.claims)) { | ||
throw new OPE('"claims" parameter must be a top level object'); | ||
} | ||
} | ||
return jwt({ | ||
@@ -473,5 +488,10 @@ alg: determineJWSAlgorithm(key), | ||
} | ||
const jwkCache = Symbol(); | ||
async function publicJwk(key) { | ||
if (key[jwkCache]) { | ||
return key[jwkCache]; | ||
} | ||
const { kty, e, n, x, y, crv } = await crypto.subtle.exportKey('jwk', key); | ||
return { kty, crv, e, n, x, y }; | ||
const jwk = (key[jwkCache] = { kty, e, n, x, y, crv }); | ||
return jwk; | ||
} | ||
@@ -478,0 +498,0 @@ export async function pushedAuthorizationRequest(as, client, parameters, options) { |
{ | ||
"name": "oauth4webapi", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "OAuth 2 / OpenID Connect for Web Platform API JavaScript runtimes", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -42,3 +42,3 @@ # OAuth 2 / OpenID Connect for Web Platform API JavaScript runtimes | ||
```js | ||
import * as oauth2 from 'https://deno.land/x/oauth4webapi/mod.ts' | ||
import * as oauth2 from 'https://deno.land/x/oauth4webapi@v2.0.1/mod.ts' | ||
``` | ||
@@ -75,3 +75,2 @@ | ||
- JSON Web Encryption (JWE) | ||
- JSON Web Signature (JWS) rarely used algorithms and HMAC | ||
- Automatic polyfills of any kind |
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
118721
2629
75