{ "info": { "author": "Daniel Hardman", "author_email": "daniel.hardman@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![CircleCI](https://circleci.com/gh/evernym/sgl.svg?style=svg)](\nhttps://circleci.com/gh/evernym/sgl)\n\n# SGL (Simple Grant Language)\n\nSGL is a simple but flexible [DSL](\nhttps://en.wikipedia.org/wiki/Domain-specific_language) for matching people against criteria (typically, authorization). It is like [XACML](\nhttps://en.wikipedia.org/wiki/XACML) but simpler and JSON-oriented. You\ncan use it to write rules about who should be able to do what, and then\nto compare circumstances to the rules to enforce custom logic. This lets\nyou create your own [Role-Based Access Control](\nhttps://en.wikipedia.org/wiki/Role-based_access_control)\nmechanisms, as well as authorizations based on other criteria.\n\nFor example, here's an SGL rule that says only members of the press\nshould be allowed backstage at a concert:\n\n```JSON\n{\"grant\": [\"backstage\"], \"when\": { \"roles\": \"press\" }}\n```\n\nAnd here's how you might use that rule in python code. (Compare the [JavaScript/Node.js equivalent](https://github.com/evernym/simple-grant-lang/blob/master/README.md)):\n\n```python\nfrom sgl.api import satisfies\n\nmy_rule = {\"grant\": [\"backstage\"], \"when\": { \"roles\": \"press\" }}\n\npeople = [\n {\"id\": \"Alex\", \"roles\": [\"ticket-holder\"]},\n {\"id\": \"Sofia\", \"roles\": [\"ticket-holder\", \"press\"]}\n]\n\nfor person in people:\n name = person['id']\n if satisfies(person, my_rule):\n print(f\"Welcome backstage, {name}.\")\n else:\n print(f\"Sorry, this area is restricted, {name}.\")\n```\n\nIf you ran this code, you'd see:\n\n```bash\n$ python sample_code.py\nSorry, this area is restricted, Alex.\nWelcome backstage, Sofia.\n```\n\nSGL supports arbitrarily complex rules with boolean operators, as well\nas rules that require multiple people to jointly exercise a privilege.\nHowever, it's simple enough that you should be able to learn it in just\na few minutes. See the [tutorial](\nhttps://evernym.github.io/sgl/docs/tutorial.html).\n\n>Note: SGL can be [rendered in various styles](\nhttps://evernym.github.io/sgl/docs/renderings.html). The example above\nuses the recommended JSON rendering, since JSON is familiar, broadly\nsupported, and easy to read. Other possibilities include ProtoBuf,\nMsgPack, CBOR, XML, and human-friendly text.\n\nSGL is not integrated with any particular enforcement mechanism, because\nit's designed for problems where you have to do your own enforcement.\nHooking it up to enforcement mechanisms is trivial, though.\n\n## See also\n* [Tutorial](https://evernym.github.io/sgl/docs/tutorial.html)\n* [Reference](https://evernym.github.io/sgl/docs/reference.html)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/evernym/sgl/archive/v0.9.17.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/evernym/sgl", "keywords": "sgl json dsl xacml authorization authz verifiable credentials did", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "sgl", "package_url": "https://pypi.org/project/sgl/", "platform": "", "project_url": "https://pypi.org/project/sgl/", "project_urls": { "Download": "https://github.com/evernym/sgl/archive/v0.9.17.tar.gz", "Homepage": "https://github.com/evernym/sgl" }, "release_url": "https://pypi.org/project/sgl/0.9.17/", "requires_dist": null, "requires_python": "", "summary": "Simple Grant Language", "version": "0.9.17" }, "last_serial": 5923193, "releases": { "0.9.10": [ { "comment_text": "", "digests": { "md5": "25f626a3e4b468da59994da839c87c59", "sha256": "023cc1af077b09795d5bdfbd15d270cb7accc3cfd81ee7cd20eccbf9c5b5a515" }, "downloads": -1, "filename": "sgl-0.9.10.tar.gz", "has_sig": false, "md5_digest": "25f626a3e4b468da59994da839c87c59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9766, "upload_time": "2019-06-22T02:56:15", "url": "https://files.pythonhosted.org/packages/8c/80/b70d181bf03f8c3ecab9087ee53e1bc4467c3a5d7bf8a3045f0d7d5035a3/sgl-0.9.10.tar.gz" } ], "0.9.11": [ { "comment_text": "", "digests": { "md5": "13699e0698f6f5d26ec8e73a92aa5a8e", "sha256": "a371eac049237842e2e367e4066227d4e3880d1b5396207ef8bae50673a40b77" }, "downloads": -1, "filename": "sgl-0.9.11.tar.gz", "has_sig": false, "md5_digest": "13699e0698f6f5d26ec8e73a92aa5a8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9777, "upload_time": "2019-06-22T23:20:43", "url": "https://files.pythonhosted.org/packages/d1/a6/7612ff8fabd8b382247b29a37eb6352c06a6072cda5843fba160d131c431/sgl-0.9.11.tar.gz" } ], "0.9.12": [ { "comment_text": "", "digests": { "md5": "e5b94ab53a791748228c55a1ab0e8748", "sha256": "043f45389f77541b5982dd875b2840db74ae7a97917b72c0a26f00688769ed6b" }, "downloads": -1, "filename": "sgl-0.9.12.tar.gz", "has_sig": false, "md5_digest": "e5b94ab53a791748228c55a1ab0e8748", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8086, "upload_time": "2019-06-23T05:27:28", "url": "https://files.pythonhosted.org/packages/e0/45/108a9320ccbe04866b515591f699ae431737a31b147fe8175ced371353e0/sgl-0.9.12.tar.gz" } ], "0.9.13": [ { "comment_text": "", "digests": { "md5": "772ac20f5a13ab23f4404628286215f3", "sha256": "c5d8b610fc8e40380330c6e7a586292efa7d702f89b93e812a9905158865c9f0" }, "downloads": -1, "filename": "sgl-0.9.13.tar.gz", "has_sig": false, "md5_digest": "772ac20f5a13ab23f4404628286215f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8091, "upload_time": "2019-06-23T05:58:22", "url": "https://files.pythonhosted.org/packages/f0/ec/32d36251824a0c2043960b951569a28cdd3597501ef7856d58caaa831aae/sgl-0.9.13.tar.gz" } ], "0.9.14": [ { "comment_text": "", "digests": { "md5": "cc4e3baac3dac556b88be891735cd540", "sha256": "2c2ca326f8459456a45ad6a24fdf0efe369d9bcec4109573f9a0ba2e75819156" }, "downloads": -1, "filename": "sgl-0.9.14.tar.gz", "has_sig": false, "md5_digest": "cc4e3baac3dac556b88be891735cd540", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8119, "upload_time": "2019-06-23T09:29:05", "url": "https://files.pythonhosted.org/packages/bb/f3/0c4dd471f6624cae149811b6e7277aba0cc83af0bf152230b9baadd17ce3/sgl-0.9.14.tar.gz" } ], "0.9.15": [ { "comment_text": "", "digests": { "md5": "f7f47729a19c1dcb1d891925fdbf7e0b", "sha256": "7b4f8e0c54f95e8b4d28c1e40771413bc2f2ed6188f5ddab82a7846680676de6" }, "downloads": -1, "filename": "sgl-0.9.15.tar.gz", "has_sig": false, "md5_digest": "f7f47729a19c1dcb1d891925fdbf7e0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8177, "upload_time": "2019-06-26T21:11:31", "url": "https://files.pythonhosted.org/packages/87/6c/905eddc87323bf2160fec470e2971778eeae13f0c7741ad79ed96cdc136b/sgl-0.9.15.tar.gz" } ], "0.9.16": [ { "comment_text": "", "digests": { "md5": "76a5697df463b3a3dcf99ca7e1b92bd9", "sha256": "3403c0743c980aeeaf96aa29713a925b5f93f9eb7784cd567bf46f0dcdb84fca" }, "downloads": -1, "filename": "sgl-0.9.16.tar.gz", "has_sig": false, "md5_digest": "76a5697df463b3a3dcf99ca7e1b92bd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8241, "upload_time": "2019-08-09T21:55:37", "url": "https://files.pythonhosted.org/packages/e8/f5/194e7f71950c4f9ece4fcddbc5a4cf861e0f8291ebc571b8dbf06e51779b/sgl-0.9.16.tar.gz" } ], "0.9.17": [ { "comment_text": "", "digests": { "md5": "fac6a453fd9289a1ec722d63b185fc28", "sha256": "026ea93f3bc7690b10d93119257616679f260d7710ea7abe0bd713b598f33e38" }, "downloads": -1, "filename": "sgl-0.9.17.tar.gz", "has_sig": false, "md5_digest": "fac6a453fd9289a1ec722d63b185fc28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8260, "upload_time": "2019-10-03T12:33:59", "url": "https://files.pythonhosted.org/packages/35/60/9a7cfb4f4e1241d713eb749e1511cd955f32d6bb5411d542ea862d199357/sgl-0.9.17.tar.gz" } ], "0.9.7": [ { "comment_text": "", "digests": { "md5": "a8fd898141a7068b195c43b19a3abddc", "sha256": "dbc3e460ab2286937d4cd0ceb38523b19a0cc407fcb22f036386d2c086d152cb" }, "downloads": -1, "filename": "sgl-0.9.7.tar.gz", "has_sig": false, "md5_digest": "a8fd898141a7068b195c43b19a3abddc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 135840, "upload_time": "2019-06-22T01:01:32", "url": "https://files.pythonhosted.org/packages/51/0d/7e42a775f9d7c0d439ec398fa6de1cd39b7c5128a2f4cd4853e8e47427ae/sgl-0.9.7.tar.gz" } ], "0.9.8": [ { "comment_text": "", "digests": { "md5": "bb62de5da6a833f3d98ea761c900abfa", "sha256": "b4cd55e1d6435e80457c17461e51feccd7eba021d955f3d51a48fd52df2c627b" }, "downloads": -1, "filename": "sgl-0.9.8.tar.gz", "has_sig": false, "md5_digest": "bb62de5da6a833f3d98ea761c900abfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9706, "upload_time": "2019-06-22T02:38:49", "url": "https://files.pythonhosted.org/packages/65/77/61ffefeed448d10f4a8e59f2621b8f5f8901edb9550236508031cebdfca6/sgl-0.9.8.tar.gz" } ], "0.9.9": [ { "comment_text": "", "digests": { "md5": "701c64a3686a5ef9f8e3f32ca1ef2fc2", "sha256": "0d46895e4125a4414ec313b75bbc825913c2341d23221c743f3bdbdb2deeabb6" }, "downloads": -1, "filename": "sgl-0.9.9.tar.gz", "has_sig": false, "md5_digest": "701c64a3686a5ef9f8e3f32ca1ef2fc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9784, "upload_time": "2019-06-22T02:50:16", "url": "https://files.pythonhosted.org/packages/5b/8f/8912a865c7a11abe0a39aa172f4b79bb1142327ff14f8bd4f85c8d39ca5f/sgl-0.9.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fac6a453fd9289a1ec722d63b185fc28", "sha256": "026ea93f3bc7690b10d93119257616679f260d7710ea7abe0bd713b598f33e38" }, "downloads": -1, "filename": "sgl-0.9.17.tar.gz", "has_sig": false, "md5_digest": "fac6a453fd9289a1ec722d63b185fc28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8260, "upload_time": "2019-10-03T12:33:59", "url": "https://files.pythonhosted.org/packages/35/60/9a7cfb4f4e1241d713eb749e1511cd955f32d6bb5411d542ea862d199357/sgl-0.9.17.tar.gz" } ] }