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 3.0.0 to 3.1.0

21

dist/index.js

@@ -6,4 +6,8 @@ 'use strict';

});
exports.privilegesSync = exports.privilegesLenient = exports.privileges = exports.enforceAny = exports.enforceSync = exports.enforceLenient = exports.enforce = exports.reduceSync = exports.reduce = exports.merge = exports.validate = undefined;
exports.policyRequiresAttribute = exports.privilegesSync = exports.privilegesLenient = exports.privileges = exports.enforceAny = exports.enforceSync = exports.enforceLenient = exports.enforce = exports.reduceSync = exports.reduce = exports.merge = exports.validate = undefined;
var _values = require('babel-runtime/core-js/object/values');
var _values2 = _interopRequireDefault(_values);
var _keys = require('babel-runtime/core-js/object/keys');

@@ -339,2 +343,16 @@

/**
* Synchronously determines if a given attribute path is in the list of rules
* for a given policy. This may be useful for determining if additional metadata
* should be fetched before enforcing a policy.
*
* @param {object} policy - the policy to check
* @param {string} attribute - the attribute path, e.g. 'user.patients'
* @returns {Boolean} True if the attribute is in the rules list
*/
const policyRequiresAttribute = (policy, attribute) => {
const rules = (0, _values2.default)(policy.rules).filter(rule => Array.isArray(rule)).reduce((left, right) => left.concat(right), []);
return rules.some(rule => rule.hasOwnProperty(attribute));
};
exports.validate = validate;

@@ -351,2 +369,3 @@ exports.merge = merge;

exports.privilegesSync = privilegesSync;
exports.policyRequiresAttribute = policyRequiresAttribute;
//# sourceMappingURL=index.js.map
'use strict';
import _Object$values from 'babel-runtime/core-js/object/values';
import _Object$keys from 'babel-runtime/core-js/object/keys';

@@ -463,6 +464,26 @@ import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';

/**
* Synchronously determines if a given attribute path is in the list of rules
* for a given policy. This may be useful for determining if additional metadata
* should be fetched before enforcing a policy.
*
* @param {object} policy - the policy to check
* @param {string} attribute - the attribute path, e.g. 'user.patients'
* @returns {Boolean} True if the attribute is in the rules list
*/
var policyRequiresAttribute = function policyRequiresAttribute(policy, attribute) {
var rules = _Object$values(policy.rules).filter(function (rule) {
return Array.isArray(rule);
}).reduce(function (left, right) {
return left.concat(right);
}, []);
return rules.some(function (rule) {
return rule.hasOwnProperty(attribute);
});
};
export { validate, merge, reduce, reduceSync /* deprecated */
, enforce, enforceLenient, enforceSync /* deprecated */
, enforceAny, privileges, privilegesLenient, privilegesSync /* deprecated */
};
, policyRequiresAttribute };
//# sourceMappingURL=index.js.map
'use strict';
import _Object$values from 'babel-runtime/core-js/object/values';
import _Object$keys from 'babel-runtime/core-js/object/keys';

@@ -317,6 +318,20 @@ import _Object$entries from 'babel-runtime/core-js/object/entries';

/**
* Synchronously determines if a given attribute path is in the list of rules
* for a given policy. This may be useful for determining if additional metadata
* should be fetched before enforcing a policy.
*
* @param {object} policy - the policy to check
* @param {string} attribute - the attribute path, e.g. 'user.patients'
* @returns {Boolean} True if the attribute is in the rules list
*/
const policyRequiresAttribute = (policy, attribute) => {
const rules = _Object$values(policy.rules).filter(rule => Array.isArray(rule)).reduce((left, right) => left.concat(right), []);
return rules.some(rule => rule.hasOwnProperty(attribute));
};
export { validate, merge, reduce, reduceSync /* deprecated */
, enforce, enforceLenient, enforceSync /* deprecated */
, enforceAny, privileges, privilegesLenient, privilegesSync /* deprecated */
};
, policyRequiresAttribute };
//# sourceMappingURL=index.js.map

2

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

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

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