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

@nats-io/nats-core

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nats-io/nats-core - npm Package Compare versions

Comparing version 3.0.0-16 to 3.0.0-17

4

lib/core.d.ts

@@ -65,3 +65,4 @@ /**

PermissionsViolation = "PERMISSIONS_VIOLATION",
AuthenticationTimeout = "AUTHENTICATION_TIMEOUT"
AuthenticationTimeout = "AUTHENTICATION_TIMEOUT",
AccountExpired = "ACCOUNT_EXPIRED"
}

@@ -96,2 +97,3 @@ export declare function isNatsError(err: NatsError | Error): err is NatsError;

subject: string;
queue?: string;
};

@@ -98,0 +100,0 @@ chainedError?: Error;

@@ -91,2 +91,3 @@ "use strict";

ErrorCode["AuthenticationTimeout"] = "AUTHENTICATION_TIMEOUT";
ErrorCode["AccountExpired"] = "ACCOUNT_EXPIRED";
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));

@@ -145,3 +146,4 @@ function isNatsError(err) {

return this.code === ErrorCode.AuthenticationExpired ||
this.code === ErrorCode.AuthorizationViolation;
this.code === ErrorCode.AuthorizationViolation ||
this.code === ErrorCode.AccountExpired;
}

@@ -148,0 +150,0 @@ isAuthTimeout() {

@@ -266,6 +266,6 @@ "use strict";

sub = subs.find((s) => {
return s.subject === ctx.subject;
return s.subject === ctx.subject && s.queue === ctx.queue;
});
}
if (ctx.operation === "publish") {
else if (ctx.operation === "publish") {
// we have a no mux subscription

@@ -593,5 +593,15 @@ sub = subs.find((s) => {

if (m) {
const operation = m[1].toLowerCase();
const subject = m[2];
let queue = undefined;
if (operation === "subscription") {
const qm = s.match(/using queue "(\S+)"/);
if (qm) {
queue = qm[1];
}
}
err.permissionContext = {
operation: m[1].toLowerCase(),
subject: m[2],
operation,
subject,
queue,
};

@@ -607,2 +617,5 @@ }

}
else if (t.indexOf("account authentication expired") != -1) {
return new core_1.NatsError(s, core_1.ErrorCode.AccountExpired);
}
else if (t.indexOf("authentication timeout") !== -1) {

@@ -609,0 +622,0 @@ return new core_1.NatsError(s, core_1.ErrorCode.AuthenticationTimeout);

{
"name": "@nats-io/nats-core",
"version": "3.0.0-16",
"version": "3.0.0-17",
"files": [
"lib/",
"esm/"
"lib/"
],

@@ -17,3 +16,3 @@ "types": "./lib/mod.d.js",

"test": "echo \"Error: no test specified\" && exit 1",
"clean": "shx rm -Rf ./lib ./cjs ./esm && shx mkdir esm",
"clean": "shx rm -Rf ./lib ./cjs",
"pre-process": "npm run clean && deno run -A bin/cjs-fix-imports.ts -o ./cjs ./src",

@@ -30,4 +29,4 @@ "build-cjs": "npm run pre-process && tsc",

"dependencies": {
"nkeys.js": "^1.1.0",
"nuid": "^2.0.0",
"nkeys.js": "^1.2.0-4",
"nuid": "^2.0.1-2",
"shx": "^0.3.4",

@@ -34,0 +33,0 @@ "typescript": "^5.4.5"

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