Socket
Socket
Sign inDemoInstall

@grpc/grpc-js

Package Overview
Dependencies
Maintainers
3
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grpc/grpc-js - npm Package Compare versions

Comparing version 1.2.7 to 1.2.8

9

build/src/call-credentials-filter.js

@@ -50,5 +50,12 @@ "use strict";

const resultMetadata = await metadata;
resultMetadata.merge(await credsMetadata);
try {
resultMetadata.merge(await credsMetadata);
}
catch (error) {
this.stream.cancelWithStatus(constants_1.Status.UNAUTHENTICATED, `Failed to retrieve auth metadata with error: ${error.message}`);
return Promise.reject('Failed to retrieve auth metadata');
}
if (resultMetadata.get('authorization').length > 1) {
this.stream.cancelWithStatus(constants_1.Status.INTERNAL, '"authorization" metadata cannot have multiple values');
return Promise.reject('"authorization" metadata cannot have multiple values');
}

@@ -55,0 +62,0 @@ return resultMetadata;

2

build/src/channel.js

@@ -230,3 +230,3 @@ "use strict";

// We assume the error code isn't 0 (Status.OK)
callStream.cancelWithStatus(error.code || constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`);
callStream.cancelWithStatus((typeof error.code === 'number') ? error.code : constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`);
});

@@ -233,0 +233,0 @@ }

{
"name": "@grpc/grpc-js",
"version": "1.2.7",
"version": "1.2.8",
"description": "gRPC Library for Node - pure JS implementation",

@@ -5,0 +5,0 @@ "homepage": "https://grpc.io/",

@@ -24,2 +24,3 @@ /*

import { splitHostPort } from './uri-parser';
import { ServiceError } from './call';

@@ -55,3 +56,11 @@ export class CallCredentialsFilter extends BaseFilter implements Filter {

const resultMetadata = await metadata;
resultMetadata.merge(await credsMetadata);
try {
resultMetadata.merge(await credsMetadata);
} catch (error) {
this.stream.cancelWithStatus(
Status.UNAUTHENTICATED,
`Failed to retrieve auth metadata with error: ${error.message}`
);
return Promise.reject<Metadata>('Failed to retrieve auth metadata');
}
if (resultMetadata.get('authorization').length > 1) {

@@ -62,2 +71,3 @@ this.stream.cancelWithStatus(

);
return Promise.reject<Metadata>('"authorization" metadata cannot have multiple values');
}

@@ -64,0 +74,0 @@ return resultMetadata;

@@ -387,3 +387,3 @@ /*

callStream.cancelWithStatus(
error.code || Status.UNKNOWN,
(typeof error.code === 'number') ? error.code : Status.UNKNOWN,
`Getting metadata from plugin failed with error: ${error.message}`

@@ -390,0 +390,0 @@ );

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