Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
VERSION 3 CONTAINS MAJOR CHANGES IN API INTERFACES AND NOW SUPPORTS RULEFLOWS CRUD
A simple library that allows you to easily connect to DecisionRules.io from your application.
Solver is designed for solving rules made in DecisionRules application.
Before you start solving rules you need to setup an SolverApi instance. How to do so is shown below.
import decisionrules
async def solver_test():
solver = decisionrules.SolverApi(solver_api_key)
Solver method expects 5 arguments
async def solver_test():
data = {"say": "Hello from python"}
solver = decisionrules.SolverApi(api_key)
# SolverType enum defines type of solver (Rule or Compostion)
response = await solver.solve(decisionrules.SolverType.RULE, get_rule, data, decisionrules.SolverStrategies.STANDARD)
response2 = await solver.solve(decisionrules.SolverType.RULEFLOW, compo_rule, data, decisionrules.SolverStrategies.STANDARD)
For using custom domain just add CustomDomain
instance to the init method
with url
and protocol
parameters.
async def solver_test():
data = {"say": "Hello from python"}
solver = decisionrules.SolverApi(api_key, decisionrules.CustomDomain("YOUR_URL", decisionrules.Protocols.HTTPS))
response = await solver.solve(decisionrules.SolverType.RULE, get_rule, data, decisionrules.SolverStrategies.STANDARD)
response2 = await solver.solve(decisionrules.SolverType.RULEFLOW, compo_rule, data, decisionrules.SolverStrategies.STANDARD)
Management api is accessible via ManagementApi
and required management api key that you can obtain in api key section in DecisionRules app.
Data for ruleflow import methods are represented as an array where index0 = RF, and index1...indexn are DTs
async def management_api_test():
manager = decisionrules.ManagementApi(mng_key)
#Or with custom domain
manager = decisionrules.ManagementApi(mng_key, decisionrules.CustomDomain("YOUR_URL", decisionrules.Protocols.HTTPS))
async def management_api_test():
manager = decisionrules.ManagementApi(mng_key)
await manager.get_rule(get_rule)
await manager.get_rule(get_rule, "1")
await manager.get_space(get_space)
await manager.update_rule(put_rule, "1", put_data)
await manager.create_rule(post_rule, post_data)
await manager.delete_rule(delete_rule, "1")
await manager.create_ruleflow(new_ruleflow)
await manager.get_ruleflow(id)
await manager.get_ruleflow(id, 1)
await manager.update_ruleflow(id, 1, ruleflow)
await manager.export_ruleflow(id, 1)
await manager.export_ruleflow(id)
await manager.import_ruleflow([new_ruleflow_with_dt], 1,)
await manager.import_ruleflow(id, 1, [new_ruleflow_with_dt])
await manager.import_ruleflow([new_ruleflow_with_dt])
await manager.delele_ruleflow(id)
await manager.getItems(tags)
await manager.updateTags(ruleId, data, version)
await manager.delete(ruleId, version)
FAQs
A simple library for simple connecting to DecisionRules API
We found that decisionrulespy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.