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

discord-verify

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discord-verify - npm Package Compare versions

Comparing version 0.0.2-beta.7 to 0.0.2-beta.8

1

dist/lib/verify.d.ts

@@ -15,2 +15,3 @@ import type { Request, SubtleCrypto, SubtleCryptoImportKeyAlgorithm } from "../types";

namedCurve: string;
public: boolean;
};

@@ -17,0 +18,0 @@ Vercel: {

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

// @ts-expect-error We don't have this defined globally due to conflicts
const encoder = new TextEncoder();

@@ -28,2 +29,3 @@ /**

namedCurve: "NODE-ED25519",
public: true,
},

@@ -30,0 +32,0 @@ Vercel: {

7

dist/types/index.d.ts

@@ -15,7 +15,4 @@ /**

export type { Request } from "./request";
declare global {
export class TextEncoder {
constructor();
encode(input?: string): Uint8Array;
}
export interface TextEncoderInstance {
encode(input?: string): Uint8Array;
}

@@ -11,4 +11,6 @@ import { isValidRequest as verifyRequest } from "./lib/verify";

export async function isValidRequest(request, publicKey, algorithm = "Ed25519") {
return verifyRequest(request, publicKey, crypto.subtle, algorithm);
// @ts-expect-error We don't have this defined globally due to conflicts
const subtleCrypto = crypto.subtle;
return verifyRequest(request, publicKey, subtleCrypto, algorithm);
}
//# sourceMappingURL=web.js.map
{
"name": "discord-verify",
"version": "0.0.2-beta.7",
"version": "0.0.2-beta.8",
"author": "Ian Mitchell",

@@ -5,0 +5,0 @@ "description": "A library for verifying the authenticity of requests coming from the Discord Interactions API",

@@ -5,5 +5,7 @@ import type {

SubtleCryptoImportKeyAlgorithm,
TextEncoderInstance,
} from "../types";
const encoder = new TextEncoder();
// @ts-expect-error We don't have this defined globally due to conflicts
const encoder: TextEncoderInstance = new TextEncoder();

@@ -51,2 +53,3 @@ /**

namedCurve: "NODE-ED25519",
public: true,
},

@@ -53,0 +56,0 @@ Vercel: {

@@ -17,7 +17,4 @@ /**

declare global {
export class TextEncoder {
constructor();
encode(input?: string): Uint8Array;
}
export interface TextEncoderInstance {
encode(input?: string): Uint8Array;
}

@@ -9,6 +9,2 @@ import { isValidRequest as verifyRequest } from "./lib/verify";

declare const crypto: {
subtle: SubtleCrypto;
};
/**

@@ -26,3 +22,5 @@ * Validates a request from Discord

) {
return verifyRequest(request, publicKey, crypto.subtle, algorithm);
// @ts-expect-error We don't have this defined globally due to conflicts
const subtleCrypto = crypto.subtle as SubtleCrypto;
return verifyRequest(request, publicKey, subtleCrypto, algorithm);
}

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc