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

@friendsofshopware/app-server-sdk

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@friendsofshopware/app-server-sdk - npm Package Compare versions

Comparing version 0.0.38 to 0.0.39

esm/app.d.ts

20

esm/registration.js

@@ -16,7 +16,7 @@ export class Registration {

!url.searchParams.has("timestamp")) {
throw new Error("Invalid Request");
return new InvalidRequestResponse('Invalid Request');
}
const v = await this.app.signer.verify(req.headers.get("shopware-app-signature"), `shop-id=${url.searchParams.get("shop-id")}&shop-url=${url.searchParams.get("shop-url")}&timestamp=${url.searchParams.get("timestamp")}`, this.app.cfg.appSecret);
if (!v) {
throw new Error("Cannot validate app signature");
return new InvalidRequestResponse('Cannot validate app signature');
}

@@ -41,7 +41,7 @@ const shop = this.app.repository.createShopStruct(url.searchParams.get("shop-id"), url.searchParams.get("shop-url"), randomString());

!req.headers.has("shopware-shop-signature")) {
throw new Error("Invalid Request");
return new InvalidRequestResponse('Invalid Request');
}
const shop = await this.app.repository.getShopById(body.shopId);
if (shop === null) {
throw new Error(`Cannot find shop for this id: ${body.shopId}`);
return new InvalidRequestResponse('Invalid shop given');
}

@@ -52,3 +52,3 @@ const v = await this.app.signer.verify(req.headers.get("shopware-shop-signature"), bodyContent, shop.getShopSecret());

await this.app.repository.deleteShop(shop.getShopId());
throw new Error("Cannot validate app signature");
return new InvalidRequestResponse('Cannot validate app signature');
}

@@ -64,1 +64,11 @@ shop.setShopCredentials(body.apiKey, body.secretKey);

}
class InvalidRequestResponse extends Response {
constructor(message, status = 401) {
super(JSON.stringify({ message }), {
status,
headers: {
"content-type": "application/json",
},
});
}
}
{
"module": "./esm/mod.js",
"types": "./types/mod.d.ts",
"name": "@friendsofshopware/app-server-sdk",
"version": "0.0.38",
"version": "0.0.39",
"description": "Shopware App Server SDK",

@@ -26,8 +25,5 @@ "keywords": [

".": {
"import": {
"types": "./types/mod.d.ts",
"default": "./esm/mod.js"
}
"import": "./esm/mod.js"
}
}
}
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