{ "info": { "author": "Ilya Baldin", "author_email": "ibaldin@renci.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "## `ns_jwt`: JSON Web Tokens for Notary Service\n\nWe will use RS256 (public/private key) variant of JWT signing. (Source: [https://pyjwt.readthedocs.io/en/latest/usage.html#encoding-decoding-tokens-with-rs256-rsa](https://pyjwt.readthedocs.io/en/latest/usage.html#encoding-decoding-tokens-with-rs256-rsa)). For signing, , NS is assumed to be in possession of a public-private keypair. Presidio can access the public key through static configuration or, possibly, by querying an endpoint on NS, that is specified in the token.\n\nNS tokens carry the following claims:\n\n| name | description | type |\n| --- | --- | --- |\n|data-set | SAFE Token that points to the dataset. Presidio is able to synthesize a token with linked assertions based on data-set, project-id and user id | String, Private |\n| project-id | CoManage/NS name of the project, universally unique and distinct. | String, Private |\n| ns-token | SAFE Token of the NS generated from its public key | String, Private |\n| ns-name | Human-readable NS name | String, Private |\n| iss | NS FQDN | String, Registered |\n| sub | OSF DCE rendering of DN attributes from user\u2019s X.509 cert | String, Public |\n| exp | Expiration date | Date, Registered |\n| iat | Issued at date | Date, Registered |\n| name | Full name of subject | String, Public |\n\nFor dates, a JSON numeric value representing the number of seconds from `1970-01-01T00:00:00Z UTC` until the specified UTC date/time, ignoring leap seconds. This is equivalent to the IEEE Std 1003.1, 2013 Edition definition \"Seconds Since the Epoch\", in which each day is accounted for by exactly 86400 seconds, other than that non-integer values can be represented. See RFC 3339 for details regarding date/times in general and UTC in particular.\n\n### Setup and configuration\n\nNo external configuration except for dependencies (PyJWT, cryptography, python-dateutil).\n\nAs above, use a virtual environment\n\n```\nvirtualenv -p $(which python3) venv\nsource venv/bin/activate\npip install --editable ns_jwt\npip install pytest\n```\n\n### Testing\n\nSimply execute the command below. The test relies on having `public.pem` and `private.pem` (public and private portions of an RSA key) to be present in the `tests/` directory. You can generate new pairs using `tests/gen-keypair.sh` (relies on openssl installation).\n\n```\npytest -v ns_jwt\n```\n\n### Teardown and Cleanup\n\nNone needed.\n\n### Troubleshooting\n\nCI Logon or other JWTs may not decode outright using PyJWT due to `binascii.Error: Incorrect padding` and `jwt.exceptions.DecodeError: Invalid crypto padding`. This is due to lack of base64 padding at the end of the token. Read it in as a string, then add the padding prior to decoding:\n\n```\nimport jwt\n\nwith open('token_file.jwt') as f:\n token_string = f.read()\n\njwt.decode(token_string + \"==\", verify=False)\n```\nAny number of `=` can be added (at least 2) to fix the padding. If token is read in as a byte string, convert to `utf-8` first: `jwt_str = str(jwt_bin, 'utf-8')`, then add padding (Source: https://gist.github.com/perrygeo/ee7c65bb1541ff6ac770)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/RENCI-NRIG/notary-service", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ns-jwt", "package_url": "https://pypi.org/project/ns-jwt/", "platform": "", "project_url": "https://pypi.org/project/ns-jwt/", "project_urls": { "Homepage": "https://github.com/RENCI-NRIG/notary-service" }, "release_url": "https://pypi.org/project/ns-jwt/0.1.2/", "requires_dist": [ "PyJWT", "cryptography", "python-dateutil" ], "requires_python": "", "summary": "Notary Service support for JWT", "version": "0.1.2" }, "last_serial": 5421012, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8fac9969ecd51c0c5007db5bbbfff676", "sha256": "db4caf22c22bb79a653f30ee321cccdba6631863d58d73d32e8767010faed1c8" }, "downloads": -1, "filename": "ns_jwt-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8fac9969ecd51c0c5007db5bbbfff676", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5366, "upload_time": "2019-03-04T21:50:43", "url": "https://files.pythonhosted.org/packages/d4/4f/ec71e37fa2141b406375b4213e72b477073dec347056f1765abd761d4a6d/ns_jwt-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19ecc6dac5f454a4438450baa8509cef", "sha256": "337e18f8a70dbcbaa285ba9c8a4500b6defc29ca5a3ace4143f87867ccd163cf" }, "downloads": -1, "filename": "ns_jwt-0.1.0.tar.gz", "has_sig": false, "md5_digest": "19ecc6dac5f454a4438450baa8509cef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4342, "upload_time": "2019-03-04T21:50:45", "url": "https://files.pythonhosted.org/packages/f1/9e/59c7c8dc1188af3bdabcf5e5401a7a4c3eda92536478f2f32fd60144fd62/ns_jwt-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d330d6bc2762079b8e7197c2e4a4b32e", "sha256": "bd76a4f45cb08c1d9979d534696de3ecffc3ef95a7bfa1b68a16ae83324e9ba9" }, "downloads": -1, "filename": "ns_jwt-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d330d6bc2762079b8e7197c2e4a4b32e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5360, "upload_time": "2019-06-19T15:28:42", "url": "https://files.pythonhosted.org/packages/46/29/b3d5f1e2dd3aebebdd8a2cb217fd15fceb923bc88414ea7ea3c62bfc28a9/ns_jwt-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eb44f1821681b06a8c589a6ae0d51340", "sha256": "c462f0a763781608b766aaf7b81643e341397b76c8519366ea30607619190a14" }, "downloads": -1, "filename": "ns_jwt-0.1.1.tar.gz", "has_sig": false, "md5_digest": "eb44f1821681b06a8c589a6ae0d51340", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4310, "upload_time": "2019-06-19T15:28:43", "url": "https://files.pythonhosted.org/packages/f1/de/88897643e9140427b3f88b9285719a569f67c0c36ae5d664405ef7fcf906/ns_jwt-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2f97480c09d23301c902fab4e19bbff1", "sha256": "906fd69ad3127bcd4ebe00bc5a5ca729b175ce9c36733cd0160a780d2332db70" }, "downloads": -1, "filename": "ns_jwt-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2f97480c09d23301c902fab4e19bbff1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5364, "upload_time": "2019-06-19T15:45:08", "url": "https://files.pythonhosted.org/packages/73/ca/74e0cbea389f4ae7f1337fb84337ecd4b2b618d107140e5096aec0bd50a9/ns_jwt-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "52e966ea5b372f1797d9a008ad0940bd", "sha256": "567a5115eebf8e219945ba0b590902174a0e700aa214f68c9e897e0b63bc2edd" }, "downloads": -1, "filename": "ns_jwt-0.1.2.tar.gz", "has_sig": false, "md5_digest": "52e966ea5b372f1797d9a008ad0940bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4332, "upload_time": "2019-06-19T15:45:10", "url": "https://files.pythonhosted.org/packages/57/29/eb442b1a43bd69b847112cdd8b6ff4936cd79e7b3693d20e9fc698edffd0/ns_jwt-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2f97480c09d23301c902fab4e19bbff1", "sha256": "906fd69ad3127bcd4ebe00bc5a5ca729b175ce9c36733cd0160a780d2332db70" }, "downloads": -1, "filename": "ns_jwt-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2f97480c09d23301c902fab4e19bbff1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5364, "upload_time": "2019-06-19T15:45:08", "url": "https://files.pythonhosted.org/packages/73/ca/74e0cbea389f4ae7f1337fb84337ecd4b2b618d107140e5096aec0bd50a9/ns_jwt-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "52e966ea5b372f1797d9a008ad0940bd", "sha256": "567a5115eebf8e219945ba0b590902174a0e700aa214f68c9e897e0b63bc2edd" }, "downloads": -1, "filename": "ns_jwt-0.1.2.tar.gz", "has_sig": false, "md5_digest": "52e966ea5b372f1797d9a008ad0940bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4332, "upload_time": "2019-06-19T15:45:10", "url": "https://files.pythonhosted.org/packages/57/29/eb442b1a43bd69b847112cdd8b6ff4936cd79e7b3693d20e9fc698edffd0/ns_jwt-0.1.2.tar.gz" } ] }