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

@lifeomic/abac

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lifeomic/abac - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

27

dist/index.js

@@ -331,2 +331,26 @@ 'use strict';

/**
* Performs a synchronous check for whether the given partially
* evaluated policy allows the operation. It's intended use is for
* client applications that need a simple check to disable UI elements.
* @param {string} operation - the requested operation
* @param {object} policy - the policy to use to check access
* @returns {boolean} true iff access is allowed, and false otherwise
* @throws {Error} Error if the policy is invalid
*/
const enforceSync = (operation, policy) => {
if (!ajv.validate('OperationNames', operation)) {
return false;
}
// Before using the policy, make sure it's valid
validate(policy);
// TODO: Add support for supplying attributes for rule evaluation
// It is safe to ignore the injection attach here because the operation name has been validated
// against the allowed operation names
// eslint-disable-next-line security/detect-object-injection
return policy.rules && policy.rules[operation] === true;
};
module.exports = {

@@ -336,3 +360,4 @@ validate,

reduce,
enforce
enforce,
enforceSync
};

4

package.json
{
"name": "@lifeomic/abac",
"version": "1.1.2",
"version": "1.2.0",
"description": "Lifeomic Attribute Based Access Control Support Module",

@@ -15,3 +15,3 @@ "main": "dist/index.js",

"build": "babel src --out-dir dist --copy-files",
"publish": "lifeomic-publish-npm-package --publish-tagged-commits-only"
"lifeomic-publish-npm-package": "lifeomic-publish-npm-package --publish-tagged-commits-only"
},

@@ -18,0 +18,0 @@ "devDependencies": {

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