{ "info": { "author": "Will Carhart", "author_email": "wcarhart@sandiego.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# locksmith\n*Your liaison between repository secrets and the great beyond.*\n\n## Overview\n`locksmith` acts as an interface between secrets and the Python code using them.\n\n### Use case\nConsider the following scenario: *Your cool new app requires a slick, unique API key to run. Perhaps your framework requires you to put this API key in a `manifest.json` or `AppDelegate` file. However, your manifest file(s) need to be checked into GitHub, thus exposing your precious API key. `locksmith` provides a layer of security to prevent you from having to type out your secrets in plaintext anywhere in your repository.*\n\n### How it works\n`locksmith` uses [`GnuPG`](https://www.gnupg.org/) to encrypt your secrets. Each user in your repository can have their own secrets, either shared among many or unique to each user. Then, `locksmith` exposes a simple API to access your secrets in code, rather than typing out something like `API_KEY = \"something_that_shouldn't_be_shared\"`.\n\n## Installation\nInstall with `pip`:\n```\npip3 install locksmith\n```\nAlso, make sure you have `gpg` installed. You can use [`Homebrew`](https://brew.sh/):\n```\nbrew install gpg\n```\nIf you'd like to use `pinentry` too and you're using a Mac, install `pinentry-mac`:\n```\nbrew install pinentry-mac\n```\n\n## Setup and Background\nFirst, decide on who's going to be using your secrets. `locksmith` looks for secrets based on users, which are programmer-defined. For example, if I was the only user of my repo, the only user would be `wcarhart`. However, perhaps you're collaborating on a repo, where you'd have two users, such as `wcarhart` and `friend_user`. Or, perhaps you're collaborating on a repo but you'd only like to use one joint user for `locksmith`, such as `locksmith_user`.\n\nIf you have one user, `locksmith_user`, add the following file `locksmith_user.lcksmth` to your repository (but do NOT check it into version control!):\n```\nsecret0=secret_value0\nsecret1=secret_value1\n...\nsecretN=secret_valueN\n```\nAn example of this file with actual values could be:\n```\nAPI_KEY=3eWhJtewSr0sSshNX9STOLUV1nGtFznxQM8UfyYH\nDATABASE_USER=admin\nDATABASE_AUTH=password\n```\nIf you named this file `locksmith_user.lcksmth`, then these secrets will be available to the user `locksmith_user`, or to any user that knows `locksmith_user`'s password.\n\nNow, encrypt the file using `gpg`:\n```\ngpg -c locksmith_user.lcksmth\n```\nEnter a desired password. This will produce a file `locksmith_user.lcksmth.gpg`. You can now safely check this into your version control.\n\n## Usage and API\n### Usage\nFirst, make sure to include `locksmith` in your Python code:\n```\nfrom locksmith import Locksmith\n```\nThen, make a `Locksmith` object based on what user(s) you have defined:\n```\nl = Locksmith(\"locksmith_user\")\n```\nWhen the above line is executed, you will be prompted for `locksmith_user`'s password. This will happen only when you instatiate a new `Locksmith` object and not every time you access a secret.\n\n### API\n*`locksmith` exposes the following API for you to use:*\n#### `get_secret(parameter)`\nThe `get_secret` function allows you to get a specific secret, specified by `parameter`. Use it like this:\n```\nsecret_value = l.get_secret(\"API_KEY\")\n```\nIf you pass in an invalid `parameter`, `locksmith` will raise a `ValueError` or `LookupError`.\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/wcarhart/locksmith", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "locksmith", "package_url": "https://pypi.org/project/locksmith/", "platform": "", "project_url": "https://pypi.org/project/locksmith/", "project_urls": { "Homepage": "https://github.com/wcarhart/locksmith" }, "release_url": "https://pypi.org/project/locksmith/1.1/", "requires_dist": null, "requires_python": "", "summary": "Your liaison between repository secrets and the great beyond.", "version": "1.1" }, "last_serial": 4903138, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d129715336aefbe194301e28e4c4fd79", "sha256": "8f2f948cceafe50f675a729189e7f679d18cc28c6ef4e73281d010a337c28d3d" }, "downloads": -1, "filename": "locksmith-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d129715336aefbe194301e28e4c4fd79", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3667, "upload_time": "2019-02-26T06:25:59", "url": "https://files.pythonhosted.org/packages/79/59/1f3233a989772533b4caa38476ce892e5a08cd3a79d996b8779aa9b65480/locksmith-0.1-py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "41ebc7777608551895384dc607cc1b03", "sha256": "8400b2047288b1384063e01a0e114f5d79180b9786085c4dc147fd32ee168931" }, "downloads": -1, "filename": "locksmith-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "41ebc7777608551895384dc607cc1b03", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3668, "upload_time": "2019-02-26T06:33:20", "url": "https://files.pythonhosted.org/packages/54/17/50ddfb85625600c9eac73ce947d108098beb6016f7ffab2aca268ee42135/locksmith-0.2-py3-none-any.whl" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2f2b185c7f80ddac002a065d87435eb6", "sha256": "38db7eb7d23b205970dd83c0f6922b1492c7ff523f4d070e5eb50914dbc9f7ce" }, "downloads": -1, "filename": "locksmith-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "2f2b185c7f80ddac002a065d87435eb6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3669, "upload_time": "2019-02-26T06:35:33", "url": "https://files.pythonhosted.org/packages/16/a1/10cd81298dbe04c493cf871e1f5ec15479cef337ecf84f930ee92f1ef414/locksmith-0.3-py3-none-any.whl" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "5eb1e963991c2ff11843acdbe79525f1", "sha256": "22cbfd6eab77465ef4cc8e016f14dec9557c3fc23fe48488a1c7f4cf205c76fc" }, "downloads": -1, "filename": "locksmith-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "5eb1e963991c2ff11843acdbe79525f1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4872, "upload_time": "2019-02-26T06:43:32", "url": "https://files.pythonhosted.org/packages/d4/57/b33797a8d8a22375b2203379d251e75a4e6561481392dee72c7257df0724/locksmith-0.4-py3-none-any.whl" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "11489e4c6c79a956d21a163d53e33303", "sha256": "81f216fa5be35ff2319fac4847165cfb7a3ff88c7db2002b5131026e3a0432ab" }, "downloads": -1, "filename": "locksmith-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "11489e4c6c79a956d21a163d53e33303", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4768, "upload_time": "2019-02-26T19:56:32", "url": "https://files.pythonhosted.org/packages/f7/7b/09e333fb80597978264424ca5b7f3eb36dd1707db636510be8d38ff2d0db/locksmith-0.5-py3-none-any.whl" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "9e1bba734a1e96b34572d541a304bf3b", "sha256": "a3f4f455c3932a8c519c5a30e3b0ef8cf8fa51ef23c84a37339d2e681ce09447" }, "downloads": -1, "filename": "locksmith-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9e1bba734a1e96b34572d541a304bf3b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4380, "upload_time": "2019-03-06T01:32:39", "url": "https://files.pythonhosted.org/packages/1e/15/ea7190ecec4e88bf09dd821bfea03fc57613d4f2b3995bddcb342f1e6953/locksmith-1.0-py3-none-any.whl" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "5d68aff2d20cf36b2c651387d9be13f8", "sha256": "5c73af27c4f377fc9f25c50c3516d150c0d805612ac846c1eba8f3cdae9877aa" }, "downloads": -1, "filename": "locksmith-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5d68aff2d20cf36b2c651387d9be13f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4397, "upload_time": "2019-03-06T02:27:02", "url": "https://files.pythonhosted.org/packages/f2/31/598d20db9eddae2da2c28422165d36f3f0aa1e4190f92d79f04f361412f1/locksmith-1.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5d68aff2d20cf36b2c651387d9be13f8", "sha256": "5c73af27c4f377fc9f25c50c3516d150c0d805612ac846c1eba8f3cdae9877aa" }, "downloads": -1, "filename": "locksmith-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5d68aff2d20cf36b2c651387d9be13f8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4397, "upload_time": "2019-03-06T02:27:02", "url": "https://files.pythonhosted.org/packages/f2/31/598d20db9eddae2da2c28422165d36f3f0aa1e4190f92d79f04f361412f1/locksmith-1.1-py3-none-any.whl" } ] }