hobofan-regorus


Namehobofan-regorus JSON
Version 0.2.5 PyPI version JSON
download
home_pageNone
SummaryPython bindings for Regorus - a fast, lightweight Rego interpreter written in Rust
upload_time2024-11-19 07:40:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords interpreter opa policy-as-code rego
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # regorus

**Regorus** is

  - *Rego*-*Rus(t)*  - A fast, light-weight [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/)
   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](https://github.com/microsoft/regorus).

To build this binding, see [building](https://github.com/microsoft/regorus/blob/main/bindings/python/building.md)

## Usage
```Python
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)

```



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hobofan-regorus",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "interpreter, opa, policy-as-code, rego",
    "author": null,
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# regorus\n\n**Regorus** is\n\n  - *Rego*-*Rus(t)*  - A fast, light-weight [Rego](https://www.openpolicyagent.org/docs/latest/policy-language/)\n   interpreter written in Rust.\n  - *Rigorous* - A rigorous enforcer of well-defined Rego semantics.\n\nRegorus can be used in Python via `regorus` package. (It is not yet available in PyPI, but can be manually built.)\n\nSee [Repository](https://github.com/microsoft/regorus).\n\nTo build this binding, see [building](https://github.com/microsoft/regorus/blob/main/bindings/python/building.md)\n\n## Usage\n```Python\nimport regorus\n\n# Create engine\nengine = regorus.Engine()\n\n# Load policies\nengine.add_policy_from_file('../../tests/aci/framework.rego')\nengine.add_policy_from_file('../../tests/aci/api.rego')\nengine.add_policy_from_file('../../tests/aci/policy.rego')\n\n# Add policy data\ndata = {\n  \"metadata\": {\n    \"devices\": {\n      \"/run/layers/p0-layer0\": \"1b80f120dbd88e4355d6241b519c3e25290215c469516b49dece9cf07175a766\",\n      \"/run/layers/p0-layer1\": \"e769d7487cc314d3ee748a4440805317c19262c7acd2fdbdb0d47d2e4613a15c\",\n      \"/run/layers/p0-layer2\": \"eb36921e1f82af46dfe248ef8f1b3afb6a5230a64181d960d10237a08cd73c79\",\n      \"/run/layers/p0-layer3\": \"41d64cdeb347bf236b4c13b7403b633ff11f1cf94dbc7cf881a44d6da88c5156\",\n      \"/run/layers/p0-layer4\": \"4dedae42847c704da891a28c25d32201a1ae440bce2aecccfa8e6f03b97a6a6c\",\n      \"/run/layers/p0-layer5\": \"fe84c9d5bfddd07a2624d00333cf13c1a9c941f3a261f13ead44fc6a93bc0e7a\"\n    }\n  }\n}\nengine.add_data(data)\n\n# Set input\ninput = {\n  \"containerID\": \"container0\",\n  \"layerPaths\": [\n    \"/run/layers/p0-layer0\",\n    \"/run/layers/p0-layer1\",\n    \"/run/layers/p0-layer2\",\n    \"/run/layers/p0-layer3\",\n    \"/run/layers/p0-layer4\",\n    \"/run/layers/p0-layer5\"\n  ],\n  \"target\": \"/run/gcs/c/container0/rootfs\"\n}\nengine.set_input(input)\n\n# Eval rule\nvalue = engine.eval_rule('data.framework.mount_overlay')\n\n# Print value\nprint(value)\n\n```\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python bindings for Regorus - a fast, lightweight Rego interpreter written in Rust",
    "version": "0.2.5",
    "project_urls": {
        "Source Code": "https://github.com/microsoft/regorus/bindings/python"
    },
    "split_keywords": [
        "interpreter",
        " opa",
        " policy-as-code",
        " rego"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f130252f98c17d432e773c30d55e70c43c9507f2e040747e35a4069a54782e15",
                "md5": "c4191c9e4b36d826796ee46c93593995",
                "sha256": "f23c962d3e5a68794d13a273f44a5ce637ba17af809edf91359c8263ac222e20"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp310-cp310-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "c4191c9e4b36d826796ee46c93593995",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 2864750,
            "upload_time": "2024-11-19T07:40:41",
            "upload_time_iso_8601": "2024-11-19T07:40:41.957510Z",
            "url": "https://files.pythonhosted.org/packages/f1/30/252f98c17d432e773c30d55e70c43c9507f2e040747e35a4069a54782e15/hobofan_regorus-0.2.5-cp310-cp310-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa2dee19b7bb15b860713c30aa666d5680963704b25a6b1cfb0faa5c55dc9f13",
                "md5": "14ce3dc0c89f81cd46c89452ebe1f60b",
                "sha256": "aae538796ad6f61a05b752559e24194afd56c11e8efb4f6c065d0afbd95c9983"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "14ce3dc0c89f81cd46c89452ebe1f60b",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 23742744,
            "upload_time": "2024-11-19T07:41:00",
            "upload_time_iso_8601": "2024-11-19T07:41:00.166234Z",
            "url": "https://files.pythonhosted.org/packages/aa/2d/ee19b7bb15b860713c30aa666d5680963704b25a6b1cfb0faa5c55dc9f13/hobofan_regorus-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfa258ab224f9ec92ebfd93341df9463aa9e3ecce7378736ec4e6cb1d0e9ea89",
                "md5": "79eed2445f4ef34bf8831a8f175a0aa8",
                "sha256": "6dbf61801d07b2eb268d004934757fa0633a4140f0d53eb176babcdce700011a"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp311-cp311-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "79eed2445f4ef34bf8831a8f175a0aa8",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 2864507,
            "upload_time": "2024-11-19T07:41:07",
            "upload_time_iso_8601": "2024-11-19T07:41:07.065769Z",
            "url": "https://files.pythonhosted.org/packages/df/a2/58ab224f9ec92ebfd93341df9463aa9e3ecce7378736ec4e6cb1d0e9ea89/hobofan_regorus-0.2.5-cp311-cp311-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0100cd2484f45f45b8fb248c59923d3d88b198ef8a613d3657cf2e739382f1ff",
                "md5": "259c081764bdf8ac64aace4bff2aa6b3",
                "sha256": "091c87740b821ecbb051431b2cfbb5254cffc2962dce6a4fb93300402554f0ed"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "259c081764bdf8ac64aace4bff2aa6b3",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 23745397,
            "upload_time": "2024-11-19T07:41:31",
            "upload_time_iso_8601": "2024-11-19T07:41:31.090080Z",
            "url": "https://files.pythonhosted.org/packages/01/00/cd2484f45f45b8fb248c59923d3d88b198ef8a613d3657cf2e739382f1ff/hobofan_regorus-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44cf6c2415582f4eab706a825abd67013d25aa6ba9315f1727efec48612eb814",
                "md5": "95b24040d3f60a26bb1821875deb1fca",
                "sha256": "b9ad7bef17deea1ab93b262665f0d24f6faebee3b44ebce5e7b13e183a6435dd"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp312-cp312-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "95b24040d3f60a26bb1821875deb1fca",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.8",
            "size": 2860759,
            "upload_time": "2024-11-19T07:41:36",
            "upload_time_iso_8601": "2024-11-19T07:41:36.529058Z",
            "url": "https://files.pythonhosted.org/packages/44/cf/6c2415582f4eab706a825abd67013d25aa6ba9315f1727efec48612eb814/hobofan_regorus-0.2.5-cp312-cp312-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e249282b8b79606a5bd93785a4cad44af5d996c4cba631c30a51620e2e56b18c",
                "md5": "2d7d435a8006c9523a11b5956064c751",
                "sha256": "4ce7f0292812ae5b4ca58aa3bcff5f3e75c16d151fe00df3a635ab8ee997c1f9"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "2d7d435a8006c9523a11b5956064c751",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.8",
            "size": 23728588,
            "upload_time": "2024-11-19T07:42:02",
            "upload_time_iso_8601": "2024-11-19T07:42:02.196212Z",
            "url": "https://files.pythonhosted.org/packages/e2/49/282b8b79606a5bd93785a4cad44af5d996c4cba631c30a51620e2e56b18c/hobofan_regorus-0.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d75fcab4ecd87a63a973636c31b6d58fa4bd9ae9465b3ead482ff2c3ab737bc",
                "md5": "010edb4a1544fd92a50b028caca1925a",
                "sha256": "191c35e27c1d8e335917c0a048bbc8f6c7ea6243e018ffa08fc4543243798fb0"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "010edb4a1544fd92a50b028caca1925a",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 23750597,
            "upload_time": "2024-11-19T07:42:28",
            "upload_time_iso_8601": "2024-11-19T07:42:28.989281Z",
            "url": "https://files.pythonhosted.org/packages/0d/75/fcab4ecd87a63a973636c31b6d58fa4bd9ae9465b3ead482ff2c3ab737bc/hobofan_regorus-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef70f5eed784b47d108d7baa4c78f73faac6516b0ffee33393634c4e7eb9b4df",
                "md5": "135db6ffebb6f3802d13ab76ec8ddaef",
                "sha256": "bc934be4ac3c61bc97fa645780ca7cbf4e7ac02ae5b857ef2e8bfd0810f54a03"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp39-cp39-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "135db6ffebb6f3802d13ab76ec8ddaef",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 2866829,
            "upload_time": "2024-11-19T07:42:33",
            "upload_time_iso_8601": "2024-11-19T07:42:33.715227Z",
            "url": "https://files.pythonhosted.org/packages/ef/70/f5eed784b47d108d7baa4c78f73faac6516b0ffee33393634c4e7eb9b4df/hobofan_regorus-0.2.5-cp39-cp39-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b38bc67cd1789f3e94467d252a68dd38047297705457c7f17c8392a0cc91c18",
                "md5": "484d27d8237127b8a7892ecc1c6950bc",
                "sha256": "bcbab70431ecab7d91f81e9d3554601df06907d880f955072b689705a9c0d7d2"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "484d27d8237127b8a7892ecc1c6950bc",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 23745648,
            "upload_time": "2024-11-19T07:43:00",
            "upload_time_iso_8601": "2024-11-19T07:43:00.237919Z",
            "url": "https://files.pythonhosted.org/packages/1b/38/bc67cd1789f3e94467d252a68dd38047297705457c7f17c8392a0cc91c18/hobofan_regorus-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8817f341904e7627e24d3646afb9bee9adbe328de4ecb7395934677064a5c001",
                "md5": "daa02f188a18a722c903ffe8366c2704",
                "sha256": "42397934625ef86d3315411d5dbe169db54d8ad36c2b92550d047f26b6c1dca8"
            },
            "downloads": -1,
            "filename": "hobofan_regorus-0.2.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "daa02f188a18a722c903ffe8366c2704",
            "packagetype": "bdist_wheel",
            "python_version": "pp310",
            "requires_python": ">=3.8",
            "size": 23742010,
            "upload_time": "2024-11-19T07:43:14",
            "upload_time_iso_8601": "2024-11-19T07:43:14.344155Z",
            "url": "https://files.pythonhosted.org/packages/88/17/f341904e7627e24d3646afb9bee9adbe328de4ecb7395934677064a5c001/hobofan_regorus-0.2.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-19 07:40:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "microsoft",
    "github_project": "regorus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hobofan-regorus"
}
        
Elapsed time: 0.75538s