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.27 to 0.0.28

1

esm/mod.js
export { AppServer } from "./app.js";
export { InMemoryShopRepository, SimpleShop } from "./repository.js";
export { HttpClient, HttpClientResponse } from "./http-client.js";
export { AbstractHmacSigner, WebCryptoHmacSigner } from "./signer.js";

13

esm/signer.js

@@ -1,2 +0,2 @@

export class HmacSigner {
export class AbstractHmacSigner {
async signResponse(response, secret) {

@@ -6,10 +6,9 @@ response.headers.set("shopware-app-signature", await this.sign(await response.text(), secret));

async verifyGetRequest(request, secret) {
// @ts-ignore
const params = new URLSearchParams(request.query);
const signature = params.get("shopware-shop-signature");
params.delete("shopware-shop-signature");
return await this.verify(signature, params.toString(), secret);
const url = new URL(request.url);
const signature = url.searchParams.get("shopware-shop-signature");
url.searchParams.delete("shopware-shop-signature");
return await this.verify(signature, url.searchParams.toString(), secret);
}
}
export class WebCryptoHmacSigner extends HmacSigner {
export class WebCryptoHmacSigner extends AbstractHmacSigner {
constructor() {

@@ -16,0 +15,0 @@ super();

@@ -5,3 +5,3 @@ {

"name": "@friendsofshopware/app-server-sdk",
"version": "0.0.27",
"version": "0.0.28",
"description": "Shopware App Server SDK",

@@ -8,0 +8,0 @@ "keywords": [

import { Registration } from "./registration.js";
import { HmacSigner } from "./signer.js";
import { AbstractHmacSigner } from "./signer.js";
import { ShopRepositoryInterface } from "./repository.js";

@@ -8,6 +8,6 @@ import { ContextResolver } from "./context-resolver.js";

repository: ShopRepositoryInterface;
signer: HmacSigner;
signer: AbstractHmacSigner;
registration: Registration;
contextResolver: ContextResolver;
constructor(cfg: AppConfigurationInterface, repository: ShopRepositoryInterface, signer: HmacSigner);
constructor(cfg: AppConfigurationInterface, repository: ShopRepositoryInterface, signer: AbstractHmacSigner);
}

@@ -14,0 +14,0 @@ export interface AppConfigurationInterface {

@@ -6,1 +6,2 @@ export { AppServer } from "./app.js";

export { HttpClient, HttpClientResponse } from "./http-client.js";
export { AbstractHmacSigner, WebCryptoHmacSigner } from "./signer.js";

@@ -1,2 +0,2 @@

export declare abstract class HmacSigner {
export declare abstract class AbstractHmacSigner {
abstract sign(message: string, secret: string): Promise<string>;

@@ -7,3 +7,3 @@ abstract verify(signature: string, data: string, secret: string): Promise<boolean>;

}
export declare class WebCryptoHmacSigner extends HmacSigner {
export declare class WebCryptoHmacSigner extends AbstractHmacSigner {
private encoder;

@@ -10,0 +10,0 @@ private keyCache;

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