Socket
Socket
Sign inDemoInstall

@dfinity/agent

Package Overview
Dependencies
Maintainers
10
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/agent - npm Package Compare versions

Comparing version 0.14.0 to 0.14.1

26

lib/cjs/certificate.js

@@ -154,17 +154,15 @@ "use strict";

});
if (this._canisterId.compareTo(principal_1.Principal.managementCanister()) !== 'eq') {
const rangeLookup = cert.lookup(['subnet', d.subnet_id, 'canister_ranges']);
if (!rangeLookup) {
throw new CertificateVerificationError(`Could not find canister ranges for subnet 0x${(0, buffer_1.toHex)(d.subnet_id)}`);
}
const ranges_arr = cbor.decode(rangeLookup);
const ranges = ranges_arr.map(v => [
principal_1.Principal.fromUint8Array(v[0]),
principal_1.Principal.fromUint8Array(v[1]),
]);
const canisterInRange = ranges.some(r => r[0].ltEq(this._canisterId) && r[1].gtEq(this._canisterId));
if (!canisterInRange) {
throw new CertificateVerificationError(`Canister ${this._canisterId} not in range of delegations for subnet 0x${(0, buffer_1.toHex)(d.subnet_id)}`);
}
const rangeLookup = cert.lookup(['subnet', d.subnet_id, 'canister_ranges']);
if (!rangeLookup) {
throw new CertificateVerificationError(`Could not find canister ranges for subnet 0x${(0, buffer_1.toHex)(d.subnet_id)}`);
}
const ranges_arr = cbor.decode(rangeLookup);
const ranges = ranges_arr.map(v => [
principal_1.Principal.fromUint8Array(v[0]),
principal_1.Principal.fromUint8Array(v[1]),
]);
const canisterInRange = ranges.some(r => r[0].ltEq(this._canisterId) && r[1].gtEq(this._canisterId));
if (!canisterInRange) {
throw new CertificateVerificationError(`Canister ${this._canisterId} not in range of delegations for subnet 0x${(0, buffer_1.toHex)(d.subnet_id)}`);
}
const publicKeyLookup = cert.lookup(['subnet', d.subnet_id, 'public_key']);

@@ -171,0 +169,0 @@ if (!publicKeyLookup) {

@@ -126,17 +126,15 @@ import * as cbor from './cbor';

});
if (this._canisterId.compareTo(Principal.managementCanister()) !== 'eq') {
const rangeLookup = cert.lookup(['subnet', d.subnet_id, 'canister_ranges']);
if (!rangeLookup) {
throw new CertificateVerificationError(`Could not find canister ranges for subnet 0x${toHex(d.subnet_id)}`);
}
const ranges_arr = cbor.decode(rangeLookup);
const ranges = ranges_arr.map(v => [
Principal.fromUint8Array(v[0]),
Principal.fromUint8Array(v[1]),
]);
const canisterInRange = ranges.some(r => r[0].ltEq(this._canisterId) && r[1].gtEq(this._canisterId));
if (!canisterInRange) {
throw new CertificateVerificationError(`Canister ${this._canisterId} not in range of delegations for subnet 0x${toHex(d.subnet_id)}`);
}
const rangeLookup = cert.lookup(['subnet', d.subnet_id, 'canister_ranges']);
if (!rangeLookup) {
throw new CertificateVerificationError(`Could not find canister ranges for subnet 0x${toHex(d.subnet_id)}`);
}
const ranges_arr = cbor.decode(rangeLookup);
const ranges = ranges_arr.map(v => [
Principal.fromUint8Array(v[0]),
Principal.fromUint8Array(v[1]),
]);
const canisterInRange = ranges.some(r => r[0].ltEq(this._canisterId) && r[1].gtEq(this._canisterId));
if (!canisterInRange) {
throw new CertificateVerificationError(`Canister ${this._canisterId} not in range of delegations for subnet 0x${toHex(d.subnet_id)}`);
}
const publicKeyLookup = cert.lookup(['subnet', d.subnet_id, 'public_key']);

@@ -143,0 +141,0 @@ if (!publicKeyLookup) {

{
"name": "@dfinity/agent",
"version": "0.14.0",
"version": "0.14.1",
"author": "DFINITY Stiftung <sdk@dfinity.org>",

@@ -37,2 +37,3 @@ "license": "Apache-2.0",

"module": "./lib/esm/index",
"unpkg": "./lib/esm/index",
"scripts": {

@@ -53,4 +54,4 @@ "build": "tsc -b && tsc -p tsconfig-cjs.json",

"peerDependencies": {
"@dfinity/candid": "^0.14.0",
"@dfinity/principal": "^0.14.0"
"@dfinity/candid": "^0.14.1",
"@dfinity/principal": "^0.14.1"
},

@@ -57,0 +58,0 @@ "dependencies": {

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