New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bf-lib

Package Overview
Dependencies
Maintainers
2
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bf-lib - npm Package Compare versions

Comparing version 4.2.5 to 4.2.6

22

auth/Auth.js

@@ -76,2 +76,23 @@ "use strict";

}
function hasPermissions(participants, securityLevel, ...validModules) {
let state = false;
const scopes = [];
const validModuleIds = validModules.map((m) => m.module_id);
for (const participant of participants) {
if (validModuleIds.includes(participant.module_id)) {
scopes.push(...participant.scopes);
}
}
for (const scope of scopes) {
// if disallows, return immediately
if (bf_types_1.ScopeDefinition[scope].disallows.indexOf(securityLevel) !== -1) {
return false;
}
// if allowed set state to true, but continue looking, in case a scope disallows it, Disallows trumps allows
if (bf_types_1.ScopeDefinition[scope].allows.indexOf(securityLevel) !== -1) {
state = true;
}
}
return state;
}
function logOut() {

@@ -86,4 +107,5 @@ system_1.default.nexus.disconnect();

getOrganization,
hasPermissions,
logOut,
};
exports.default = system_1.default.sealModule(Object.freeze(auth));

3

auth/Types.d.ts

@@ -1,2 +0,2 @@

import { IModuleLink, IOrganization, IUser, IUserEntity } from 'bf-types';
import { IModuleLink, IOrganization, IParticipant, IUser, IUserEntity, TSecurityTypes } from 'bf-types';
export interface Auth {

@@ -8,3 +8,4 @@ getUser(): Promise<IUserEntity>;

getOrganizationDoc(): Promise<IOrganization>;
hasPermissions(participants: IParticipant[], securityLevel: TSecurityTypes, ...validModules: IModuleLink[]): boolean;
logOut(): void;
}
{
"name": "bf-lib",
"version": "4.2.5",
"version": "4.2.6",
"private": false,

@@ -5,0 +5,0 @@ "description": "the standard client library for block-5 software",

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