Socket
Socket
Sign inDemoInstall

adobe-ims-servicetoken

Package Overview
Dependencies
1
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.0.2

7

dist/adobe-ims-servicetoken.js

@@ -6,3 +6,3 @@ /**

* @license BSD-3-Clause
* @version 3.0.1
* @version 3.0.2
*/

@@ -62,3 +62,3 @@ import murmurHash3 from'murmurhash3js';const hash128 = murmurHash3.x64.hash128,

const data = await res.json();
const data = res.ok ? await res.clone().json() : await res.clone().text();

@@ -73,3 +73,4 @@ if (res.ok) {

} else {
throw new Error(`[${res.status}] ${data.error}: ${data.error_description}`);
const errorMsg = typeof data === "string" ? res.statusText : `${data?.error}: ${data?.error_description}`;
throw new Error(`[${res.status}] ${errorMsg}`);
}

@@ -76,0 +77,0 @@ } else {

/*!
2023 Jason Mulligan <jason.mulligan@avoidwork.com>
@version 3.0.1
@version 3.0.2
*/
import e from"murmurhash3js";const t=e.x64.hash128,n=new Map;async function s({url:e="https://ims-na1.adobelogin.com/ims/token",grant_type:s="authorization_code",client_id:o="",client_secret:r="",code:a="",jwt_token:c=""}={}){const i=t(`${e}|${o}|${s}`);let p;if(!1===n.has(i)){const t=new FormData;let d;s.length>0&&t.append("grant_type",s),t.append("client_id",o),t.append("client_secret",r),a.length>0&&t.append("code",a),c.length>0&&t.append("jwt_token",c);try{d=await fetch(e,{method:"POST",headers:{"content-type":"multipart/form-data"},body:t})}catch(e){d={ok:!1,statusText:e.message||e,json:async()=>({error:d.statusText,error_description:e.message}),text:async()=>e.message||e}}const l=await d.json();if(!d.ok)throw new Error(`[${d.status}] ${l.error}: ${l.error_description}`);n.set(i,l.access_token),p=structuredClone(l.access_token),void 0!==l.expires_in&&setTimeout((()=>n.delete(i)),l.expires_in)}else p=structuredClone(n.get(i));return p}export{s as token};//# sourceMappingURL=adobe-ims-servicetoken.min.js.map
import e from"murmurhash3js";const t=e.x64.hash128,n=new Map;async function s({url:e="https://ims-na1.adobelogin.com/ims/token",grant_type:s="authorization_code",client_id:o="",client_secret:r="",code:a="",jwt_token:c=""}={}){const i=t(`${e}|${o}|${s}`);let p;if(!1===n.has(i)){const t=new FormData;let d;s.length>0&&t.append("grant_type",s),t.append("client_id",o),t.append("client_secret",r),a.length>0&&t.append("code",a),c.length>0&&t.append("jwt_token",c);try{d=await fetch(e,{method:"POST",headers:{"content-type":"multipart/form-data"},body:t})}catch(e){d={ok:!1,statusText:e.message||e,json:async()=>({error:d.statusText,error_description:e.message}),text:async()=>e.message||e}}const l=d.ok?await d.clone().json():await d.clone().text();if(!d.ok){const e="string"==typeof l?d.statusText:`${l?.error}: ${l?.error_description}`;throw new Error(`[${d.status}] ${e}`)}n.set(i,l.access_token),p=structuredClone(l.access_token),void 0!==l.expires_in&&setTimeout((()=>n.delete(i)),l.expires_in)}else p=structuredClone(n.get(i));return p}export{s as token};//# sourceMappingURL=adobe-ims-servicetoken.min.js.map
{
"name": "adobe-ims-servicetoken",
"version": "3.0.1",
"version": "3.0.2",
"description": "Adobe IMS Service Token lifecycle management",

@@ -5,0 +5,0 @@ "source": "src/ims.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc