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

@subreader/netflix-msl

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@subreader/netflix-msl - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

6

lib/MSLClient.d.ts
/// <reference types="node" />
import { RequestInfo, RequestInit, Response } from "node-fetch";
import { Message } from "./Message";

@@ -14,8 +15,10 @@ import { EncryptionEnvelope } from "./EncryptionEnvelope";

esn: string;
fetchOptions?: RequestInit;
static generateMessageID(): number;
static generateESN(): string;
constructor({ esn, keyPair, store, }: {
constructor({ esn, keyPair, store, fetchOptions, }: {
esn: string;
keyPair: KeyPair;
store: IMSLClientStore;
fetchOptions?: RequestInit;
});

@@ -50,2 +53,3 @@ createHandshakeRequestMessage(): Message;

sendMessage(message: Message): Promise<Message>;
fetch(info: RequestInfo, init: RequestInit): Promise<Response>;
encrypt: (buffer: string) => Promise<EncryptionEnvelope>;

@@ -52,0 +56,0 @@ decrypt: (encryptionEnvelope: EncryptionEnvelope) => Promise<string>;

14

lib/MSLClient.js
"use strict";
/* globals fetch */
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -16,3 +15,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

class MSLClient {
constructor({ esn = MSLClient.generateESN(), keyPair, store, }) {
constructor({ esn = MSLClient.generateESN(), keyPair, store, fetchOptions, }) {
this.encrypt = async (buffer) => {

@@ -48,2 +47,3 @@ const masterToken = await this.store.getMasterToken();

this.store = store;
this.fetchOptions = fetchOptions;
}

@@ -241,8 +241,8 @@ static generateMessageID() {

async sendHandshake(handshakeRequestMessage) {
const res = await isomorphic_fetch_1.default(MSLClient.ENDPOINT, {
const res = await this.fetch(MSLClient.ENDPOINT, {
method: "POST",
body: handshakeRequestMessage.serialize(),
headers: {
"Content-Type": "application/json",
},
body: handshakeRequestMessage.serialize(),
});

@@ -371,3 +371,3 @@ const text = await res.text();

const data = await message.encrypt(this.encrypt, this.sign);
const res = await isomorphic_fetch_1.default(MSLClient.ENDPOINT, {
const res = await this.fetch(MSLClient.ENDPOINT, {
method: "POST",

@@ -387,2 +387,6 @@ headers: {

}
fetch(info, init) {
// @ts-ignore
return isomorphic_fetch_1.default(info, Object.assign(Object.assign({}, this.fetchOptions), init));
}
}

@@ -389,0 +393,0 @@ exports.MSLClient = MSLClient;

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

"description": "Netflix MSL Client",
"version": "1.0.4",
"version": "1.0.5",
"license": "ISC",

@@ -24,3 +24,3 @@ "main": "lib/MSLClient.js",

"@types/node": "^12.12.29",
"@types/node-fetch": "^2.5.4",
"@types/node-fetch": "^2.5.7",
"@typescript-eslint/eslint-plugin": "^2.17.0",

@@ -27,0 +27,0 @@ "@typescript-eslint/parser": "^2.17.0",

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