Python bindings for Regorus - a fast, lightweight Rego interpreter written in Rust
Project description
regorus
Regorus is
- Rego-Rus(t) - A fast, light-weight Rego interpreter written in Rust.
- Rigorous - A rigorous enforcer of well-defined Rego semantics.
Regorus can be used in Python via regorus package. (It is not yet available in PyPI, but can be manually built.)
See Repository.
To build this binding, see building
Usage
import regorus
# Create engine
engine = regorus.Engine()
# Load policies
engine.add_policy_from_file('../../tests/aci/framework.rego')
engine.add_policy_from_file('../../tests/aci/api.rego')
engine.add_policy_from_file('../../tests/aci/policy.rego')
# Add policy data
data = {
"metadata": {
"devices": {
"/run/layers/p0-layer0": "1b80f120dbd88e4355d6241b519c3e25290215c469516b49dece9cf07175a766",
"/run/layers/p0-layer1": "e769d7487cc314d3ee748a4440805317c19262c7acd2fdbdb0d47d2e4613a15c",
"/run/layers/p0-layer2": "eb36921e1f82af46dfe248ef8f1b3afb6a5230a64181d960d10237a08cd73c79",
"/run/layers/p0-layer3": "41d64cdeb347bf236b4c13b7403b633ff11f1cf94dbc7cf881a44d6da88c5156",
"/run/layers/p0-layer4": "4dedae42847c704da891a28c25d32201a1ae440bce2aecccfa8e6f03b97a6a6c",
"/run/layers/p0-layer5": "fe84c9d5bfddd07a2624d00333cf13c1a9c941f3a261f13ead44fc6a93bc0e7a"
}
}
}
engine.add_data(data)
# Set input
input = {
"containerID": "container0",
"layerPaths": [
"/run/layers/p0-layer0",
"/run/layers/p0-layer1",
"/run/layers/p0-layer2",
"/run/layers/p0-layer3",
"/run/layers/p0-layer4",
"/run/layers/p0-layer5"
],
"target": "/run/gcs/c/container0/rootfs"
}
engine.set_input(input)
# Eval rule
value = engine.eval_rule('data.framework.mount_overlay')
# Print value
print(value)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hobofan_regorus-0.2.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 23.7 MB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42397934625ef86d3315411d5dbe169db54d8ad36c2b92550d047f26b6c1dca8
|
|
| MD5 |
daa02f188a18a722c903ffe8366c2704
|
|
| BLAKE2b-256 |
8817f341904e7627e24d3646afb9bee9adbe328de4ecb7395934677064a5c001
|
File details
Details for the file hobofan_regorus-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 23.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ce7f0292812ae5b4ca58aa3bcff5f3e75c16d151fe00df3a635ab8ee997c1f9
|
|
| MD5 |
2d7d435a8006c9523a11b5956064c751
|
|
| BLAKE2b-256 |
e249282b8b79606a5bd93785a4cad44af5d996c4cba631c30a51620e2e56b18c
|
File details
Details for the file hobofan_regorus-0.2.5-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9ad7bef17deea1ab93b262665f0d24f6faebee3b44ebce5e7b13e183a6435dd
|
|
| MD5 |
95b24040d3f60a26bb1821875deb1fca
|
|
| BLAKE2b-256 |
44cf6c2415582f4eab706a825abd67013d25aa6ba9315f1727efec48612eb814
|
File details
Details for the file hobofan_regorus-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 23.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
091c87740b821ecbb051431b2cfbb5254cffc2962dce6a4fb93300402554f0ed
|
|
| MD5 |
259c081764bdf8ac64aace4bff2aa6b3
|
|
| BLAKE2b-256 |
0100cd2484f45f45b8fb248c59923d3d88b198ef8a613d3657cf2e739382f1ff
|
File details
Details for the file hobofan_regorus-0.2.5-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dbf61801d07b2eb268d004934757fa0633a4140f0d53eb176babcdce700011a
|
|
| MD5 |
79eed2445f4ef34bf8831a8f175a0aa8
|
|
| BLAKE2b-256 |
dfa258ab224f9ec92ebfd93341df9463aa9e3ecce7378736ec4e6cb1d0e9ea89
|
File details
Details for the file hobofan_regorus-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 23.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aae538796ad6f61a05b752559e24194afd56c11e8efb4f6c065d0afbd95c9983
|
|
| MD5 |
14ce3dc0c89f81cd46c89452ebe1f60b
|
|
| BLAKE2b-256 |
aa2dee19b7bb15b860713c30aa666d5680963704b25a6b1cfb0faa5c55dc9f13
|
File details
Details for the file hobofan_regorus-0.2.5-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f23c962d3e5a68794d13a273f44a5ce637ba17af809edf91359c8263ac222e20
|
|
| MD5 |
c4191c9e4b36d826796ee46c93593995
|
|
| BLAKE2b-256 |
f130252f98c17d432e773c30d55e70c43c9507f2e040747e35a4069a54782e15
|
File details
Details for the file hobofan_regorus-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 23.7 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcbab70431ecab7d91f81e9d3554601df06907d880f955072b689705a9c0d7d2
|
|
| MD5 |
484d27d8237127b8a7892ecc1c6950bc
|
|
| BLAKE2b-256 |
1b38bc67cd1789f3e94467d252a68dd38047297705457c7f17c8392a0cc91c18
|
File details
Details for the file hobofan_regorus-0.2.5-cp39-cp39-macosx_11_0_arm64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc934be4ac3c61bc97fa645780ca7cbf4e7ac02ae5b857ef2e8bfd0810f54a03
|
|
| MD5 |
135db6ffebb6f3802d13ab76ec8ddaef
|
|
| BLAKE2b-256 |
ef70f5eed784b47d108d7baa4c78f73faac6516b0ffee33393634c4e7eb9b4df
|
File details
Details for the file hobofan_regorus-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hobofan_regorus-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 23.8 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
191c35e27c1d8e335917c0a048bbc8f6c7ea6243e018ffa08fc4543243798fb0
|
|
| MD5 |
010edb4a1544fd92a50b028caca1925a
|
|
| BLAKE2b-256 |
0d75fcab4ecd87a63a973636c31b6d58fa4bd9ae9465b3ead482ff2c3ab737bc
|