Socket
Socket
Sign inDemoInstall

@adobe/fetch

Package Overview
Dependencies
Maintainers
45
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adobe/fetch - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

8

index.js

@@ -42,6 +42,12 @@ /*

function addAuthHeaders(token, options, authOptions) {
let apiKey = authOptions.clientId;
if (options.headers && options.headers['x-api-key']) {
apiKey = options.headers['x-api-key'];
}
return merge(options, {
headers: {
authorization: `${token.token_type} ${token.access_token}`,
'x-api-key': authOptions.clientId,
'x-api-key': apiKey,
'x-gw-ims-org-id': authOptions.orgId

@@ -48,0 +54,0 @@ }

2

package.json
{
"name": "@adobe/fetch",
"version": "0.1.6",
"version": "0.1.7",
"description": "Call Adobe APIs",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,3 +26,3 @@ /* eslint-disable require-atomic-updates */

if (!cache.disableStorage) {
cache.tokens = await cache.read() || {};
cache.tokens = (await cache.read()) || {};
cache.readOnce = true;

@@ -29,0 +29,0 @@ }

@@ -141,2 +141,18 @@ /*

test('allows x-api-key override', async () => {
expect.assertions(4);
fetch.mockImplementation((url, options) => {
expect(options.headers).toBeDefined();
expect(options.headers['authorization']).toBe(
`${mockData.token2.token_type} ${mockData.token.access_token}`
);
expect(options.headers['x-api-key']).toBe('test-override');
expect(options.headers['x-gw-ims-org-id']).toBe(mockData.config.orgId);
return Promise.resolve({ status: 200, url: url });
});
await testFetch(mockData.url, {
headers: { 'x-api-key': 'test-override' }
});
});
test('token stored in default storage', async () => {

@@ -143,0 +159,0 @@ expect.assertions(6);

Sorry, the diff of this file is not supported yet

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