Socket
Socket
Sign inDemoInstall

@opengovsg/formsg-sdk

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opengovsg/formsg-sdk - npm Package Compare versions

Comparing version 0.6.1 to 0.7.0

coverage/base.css

2

dist/crypto.d.ts

@@ -31,3 +31,3 @@ /**

declare function decryptFile(formSecretKey: string, { submissionPublicKey, nonce, binary: encryptedBinary }: EncryptedFileContent): Promise<Uint8Array | null>;
declare const _default: ({ mode }: Pick<PackageInitParams, "mode">) => {
declare const _default: ({ mode }: Pick<PackageInitParams, "mode" | "verificationOptions">) => {
encrypt: typeof encrypt;

@@ -34,0 +34,0 @@ decrypt: (formSecretKey: string, encryptedContent: string, verifiedContent?: string | undefined) => DecryptedContent | null;

@@ -25,2 +25,9 @@ declare const _default: (options?: PackageInitParams) => {

};
verification: {
authenticate: Function;
generateSignature: ({ transactionId, formId, fieldId, answer }: VerificationSignatureOptions) => string;
} | {
authenticate?: undefined;
generateSignature?: undefined;
};
};

@@ -27,0 +34,0 @@ /**

@@ -7,5 +7,6 @@ "use strict";

var crypto_1 = __importDefault(require("./crypto"));
var verification_1 = __importDefault(require("./verification"));
module.exports = function (options) {
if (options === void 0) { options = {}; }
var mode = options.mode, webhookSecretKey = options.webhookSecretKey;
var mode = options.mode, webhookSecretKey = options.webhookSecretKey, verificationOptions = options.verificationOptions;
return {

@@ -19,3 +20,7 @@ webhooks: webhooks_1.default({

}),
verification: verification_1.default({
mode: mode || 'production',
verificationOptions: verificationOptions
})
};
};

@@ -6,2 +6,9 @@ module.exports = {

moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverage: true,
coverageThreshold: {
global: {
statements: 85,
functions: 80,
}
}
}
{
"name": "@opengovsg/formsg-sdk",
"version": "0.6.1",
"version": "0.7.0",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -50,3 +50,3 @@ *Please note that this is an SDK for webhooks integration, and* ***not*** *the FormSG system.*

try {
formsg.webhooks.authenticate(req.headers['X-FormSG-Signature'], POST_URI)
formsg.webhooks.authenticate(req.get('X-FormSG-Signature'), POST_URI)
// Continue processing the POST body

@@ -53,0 +53,0 @@ return next()

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