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

metacom

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metacom - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

7

CHANGELOG.md

@@ -5,2 +5,6 @@ # Changelog

## [1.5.1][] - 2021-02-19
- Fix restore session for Channel
## [1.5.0][] - 2021-02-19

@@ -56,3 +60,4 @@

[unreleased]: https://github.com/metarhia/metacom/compare/v1.5.0...HEAD
[unreleased]: https://github.com/metarhia/metacom/compare/v1.5.1...HEAD
[1.5.1]: https://github.com/metarhia/metacom/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/metarhia/metacom/compare/v1.4.0...v1.5.0

@@ -59,0 +64,0 @@ [1.4.0]: https://github.com/metarhia/metacom/compare/v1.3.1...v1.4.0

25

lib/channel.js

@@ -85,9 +85,10 @@ 'use strict';

let session = sessions.get(token);
if (session) return session;
const channel = channels.get(this);
const data = await channel.application.auth.restoreSession(token);
if (!data) return null;
session = new Session(token, channel, data);
if (!session) {
const data = await channel.application.auth.restoreSession(token);
if (!data) return null;
session = new Session(token, channel, data);
sessions.set(token, session);
}
channel.session = session;
sessions.set(token, session);
return session;

@@ -202,4 +203,3 @@ }

const context = session ? session.context : { client };
const publicMethod = proc.access === 'public';
if (!this.session && !publicMethod) {
if (!this.session && !proc.access === 'public') {
this.error(403, null, callId);

@@ -216,3 +216,3 @@ return;

}
this.reply(callId, result, publicMethod);
this.reply(callId, result);
const record = `${this.ip}\t${interfaceName}/${methodName}`;

@@ -222,13 +222,8 @@ application.console.log(record);

reply(callId, result, publicMethod) {
reply(callId, result) {
const { res, connection, application } = this;
if (result instanceof Error) {
if (result instanceof application.Error) {
this.error(result.code, result, callId);
return;
}
const id = result ? result.systemUserId : 0;
if (!this.session && id && publicMethod) {
this.session = application.auth.startSession(this, id);
result.token = this.token;
}
const data = JSON.stringify({ callback: callId, result });

@@ -235,0 +230,0 @@ if (connection) {

{
"name": "metacom",
"version": "1.5.0",
"version": "1.5.1",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Communication protocol for Metarhia stack with rpc, events, binary streams, memory and db access",

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