{ "info": { "author": "Freedom of the Press Foundation", "author_email": "securedrop@freedom.press", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Python SDK for SecureDrop\n\n[![CircleCI](https://circleci.com/gh/freedomofpress/securedrop-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/freedomofpress/securedrop-sdk/tree/master)\n\nThis SDK provides a convenient Python interface to the [SecureDrop Journalist Interface API](https://docs.securedrop.org/en/latest/development/journalist_api.html). The development of the SDK was primarily motivated by the creation of the [SecureDrop Workstation](https://github.com/freedomofpress/securedrop-workstation) based on Qubes OS.\n\nThe SDK is currently used by the [SecureDrop Client](https://github.com/freedomofpress/securedrop-client) that is a component of the SecureDrop Workstation. When used in Qubes OS, the SDK uses the [securedrop-proxy](https://github.com/freedomofpress/securedrop-proxy) service, as the VM which runs the client does not have network access by design.\n\n**IMPORTANT:** This project is still under active development. We do not recommend using it in any production context.\n\n# Development\n\n## Quick Start\n\n```bash\npip install -U pipenv\npipenv sync --dev\npipenv shell\nmake test\n```\n\nThis project uses [pipenv](https://docs.pipenv.org) to manage all dependencies.\nThis is a Python 3 project. When using ``pipenv`` locally, ensure you used the ``--keep-outdated``\nflag to prevent dependencies from being unnecessarily upgraded during normal development.\n\nWe cover all the API calls supported by the SecureDrop Journalist Interface API.\n\n## Testing\n\nThe tests are located in the `tests` directory. This project uses [vcrpy](http://vcrpy.readthedocs.io/en/latest/) to record and then reply the API calls so that\ndevelopers will have repeatable results so that they may work offline. `vcrpy` stores YAML\nrecordings of the API calls in the `data` directory. \n\nTo run all the test cases, use the following command.\n\n```bash\nmake test\n```\n\nTo run a single test, use this following command, replace the test case name at the end.\n\n```bash\nmake test TESTS=tests/test_api.py::TestAPI::test_error_unencrypted_reply\n```\n\nTo test against a live development server, you will need to run the SecureDrop\ndevelopent container from the main SecureDrop repository on your host. This\ncan be done via `NUM_SOURCES=5 make -C securedrop dev`.\n\nIn this repo, comment out the `@vcr` decorator of the `setUp` method in\n`test_api.py` and execute which ever tests you want to run. If you want to\nre-run all tests against the API, remove all the `.yml` files in the\n`data` directory.\n\n## Generating test data for `APIProxy`\n\nTo test or to generate new test data file for the `APIProxy` class in\n`test_apiproxy.py` file, you will have to setup\n[QubesOS](https://qubes-os.org) system.\n\nThere should be one VM (let us call it `sd-journalist`), where we can run\nlatest securedrop server code from the development branch using\n``NUM_SOURCES=5 make -C securedrop dev`` command. The same VM should also have\n`securedrop-proxy` project installed, either from the source by hand or using\nthe latest Debian package from the FPF repository.\n\nBelow is an example configuration for proxy `/etc/sd-proxy.yaml`:\n\n```\nhost: 127.0.0.1\nscheme: http\nport: 8081\ntarget_vm: sd-svs\ndev: False\n```\n\nThen we can create our second developent VM called `sd-svs`, in which we can checkout/develop\nthe `securedrop-sdk` project. The required configuration file is at `/etc/sd-sdk.conf`\n\n```\n[proxy]\nname=sd-journalist\n```\n\nWe should also add a corresponding entry in `/etc/qubes-rpc/policy/securedrop.Proxy` file\nin **dom0**.\n\n```\nsd-svs sd-journalist allow\n$anyvm $anyvm deny\n```\n\nThe above mentioned setup can also be created using `securedrop-workstation` project.\n\nNow, delete any related JSON file under `data/` directory, or remove all of\nthem, and then execute ``make test TEST=tests/test_apiproxy.py``. This is\ncommand will generate the new data files, which can be used in CI or any other\nsystem.\n\n**Note:** Remember that file download checks don't read actual file path in the `APIProxy` tests as it requires QubesOS setup. You can manually uncomment those lines to execute them on QubesOS setup.\n\n# Releasing\n\nTo make a release, you should:\n\n1. Create a branch named `release/$new_version_number`\n2. Update `CHANGELOG.md` and `setup.py`\n3. Commit the changes.\n4. Create a PR and get the PR reviewed and merged into ``master``.\n5. ``git tag $new_version_number`` and push the new tag.\n6. Checkout the new tag locally.\n7. Push the new release source tarball to the PSF's PyPI [following this documentation](https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives).\n8. If you want to publish the new SDK release to the FPF PyPI mirror, Hop over to the the `securedrop-debian-packaging` repo and follow the [build-a-package](https://github.com/freedomofpress/securedrop-debian-packaging/blob/master/README.md#build-a-package) instructions to push the package up to our PyPI mirror: https://pypi.org/simple\n\n# Contributing\n\nPlease read [CONTRIBUTING.md](https://github.com/freedomofpress/securedrop-sdk/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n# Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/freedomofpress/securedrop-sdk/tags). \n\n# License\n\nThe Python SecureDrop SDK is licensed in the GPLv3. See [`LICENSE`](./LICENSE) for more details.", "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/freedomofpress/securedrop-sdk", "keywords": "", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "securedrop-sdk", "package_url": "https://pypi.org/project/securedrop-sdk/", "platform": "", "project_url": "https://pypi.org/project/securedrop-sdk/", "project_urls": { "Homepage": "https://github.com/freedomofpress/securedrop-sdk" }, "release_url": "https://pypi.org/project/securedrop-sdk/0.0.11/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Python client API to access SecureDrop Journalist REST API", "version": "0.0.11" }, "last_serial": 5439694, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "913ed71b64a6d29315c27f87c54a0f3c", "sha256": "82373118c49a141881332575c9ac1618973390a7d5c32ed29b3d64cb1f0d91e8" }, "downloads": -1, "filename": "securedrop-sdk-0.0.1.tar.gz", "has_sig": false, "md5_digest": "913ed71b64a6d29315c27f87c54a0f3c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 17697, "upload_time": "2018-09-26T20:26:51", "url": "https://files.pythonhosted.org/packages/89/47/dc444c4e9573a59562b94ed1181f299c01d1251b9265a2345abd9032b701/securedrop-sdk-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "a710b4ef8ec2fc3206b74f1aac9db5c9", "sha256": "07b9f9d91b26e2396ff5eb63b5e990ac969de57bbfb7c075d99ac5e269198cb0" }, "downloads": -1, "filename": "securedrop-sdk-0.0.10.tar.gz", "has_sig": false, "md5_digest": "a710b4ef8ec2fc3206b74f1aac9db5c9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 21681, "upload_time": "2019-06-12T05:01:17", "url": "https://files.pythonhosted.org/packages/83/93/5acdbc0fa3a9e7e52f4ef2d6bb46e6df4c6ec1eef404563de5b9092257f3/securedrop-sdk-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "d578569eddb8363200f232bba995d25c", "sha256": "89a454a45eac15db702e06d24f5e4be64b8d033a5546aff056de762ecfc5f72a" }, "downloads": -1, "filename": "securedrop-sdk-0.0.11.tar.gz", "has_sig": false, "md5_digest": "d578569eddb8363200f232bba995d25c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 21674, "upload_time": "2019-06-24T09:07:06", "url": "https://files.pythonhosted.org/packages/24/4d/caf7a7476caeedb4a5aefecb9ec1995d9d2746fca3d35f20a80bd2f756f4/securedrop-sdk-0.0.11.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ea40723964583768a90a5584cd6dac86", "sha256": "e4f716077ceb52fe840f5b2033c3174f65beef6e94e48671c50af326a3ed16da" }, "downloads": -1, "filename": "securedrop-sdk-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ea40723964583768a90a5584cd6dac86", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18347, "upload_time": "2018-10-23T14:39:13", "url": "https://files.pythonhosted.org/packages/87/cb/b2db1945c6e6735bc6b0c31eb93738c308ccd81bee8381b9b46795872b87/securedrop-sdk-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "372ea88d005487e80de8326916ea181b", "sha256": "5e3ebfde6ef63fc9a614da5b3b9820a93b827f2f7ecb4a72178ebe6d8e2f6d2a" }, "downloads": -1, "filename": "securedrop-sdk-0.0.3.tar.gz", "has_sig": false, "md5_digest": "372ea88d005487e80de8326916ea181b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18361, "upload_time": "2018-10-26T17:01:49", "url": "https://files.pythonhosted.org/packages/ed/69/7f6db3fd599d1571045c170052eea8e8421465d161ba3cf9c2bdf2b6cf3c/securedrop-sdk-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "c5cdc794456df349aa45e3148e394dd7", "sha256": "4027d0eec8505dbb485a1855b78285e70b4424225c6713eabaf0501dfbacfe11" }, "downloads": -1, "filename": "securedrop_sdk-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "c5cdc794456df349aa45e3148e394dd7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6833, "upload_time": "2018-11-10T03:05:49", "url": "https://files.pythonhosted.org/packages/75/cd/b8ec9b455741c1503c3ba1e3aba60bdea63082fe117b63a3fd574130e4ec/securedrop_sdk-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d232a456b33c360bbfca200af8f904a", "sha256": "73b4148ea31681779c6a5aa127fce6764a80d241e791d54cec66c6834ac5ab3d" }, "downloads": -1, "filename": "securedrop-sdk-0.0.4.tar.gz", "has_sig": false, "md5_digest": "5d232a456b33c360bbfca200af8f904a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 19032, "upload_time": "2018-11-10T03:05:50", "url": "https://files.pythonhosted.org/packages/0e/5a/214cfe6006add3fdb7a1d1a4c1fb65e5c30202be9ea49c7408550aebc8f9/securedrop-sdk-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "f1b66505efae60bd9084150d767d23e3", "sha256": "55a0a210f5cb7e499f364a8f737400ae41c0ca336d4b72022fe05646005d80b4" }, "downloads": -1, "filename": "securedrop-sdk-0.0.5.tar.gz", "has_sig": false, "md5_digest": "f1b66505efae60bd9084150d767d23e3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18677, "upload_time": "2019-01-15T08:34:28", "url": "https://files.pythonhosted.org/packages/78/bb/5092574786a854005c95989fd1559ea069f0998c4451ea7b89ca3394f0cd/securedrop-sdk-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "2dad5beae9c029f95c846cd3155b687b", "sha256": "5014b5880429313fc721fff6d4b5c3231019e5f6260cd1a8d0e4216cbe2acf37" }, "downloads": -1, "filename": "securedrop-sdk-0.0.6.tar.gz", "has_sig": false, "md5_digest": "2dad5beae9c029f95c846cd3155b687b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 18706, "upload_time": "2019-01-25T15:28:29", "url": "https://files.pythonhosted.org/packages/61/7f/ae33de7aa6d82d2699b674086cef815b5a8a4ceee347c9315aa8b80fdcee/securedrop-sdk-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "55691b4f692c027373cdb08b49db05fe", "sha256": "ee1d51e33c6c4889aba78b44dee80bec6359a7ddcf75391df54090392379d58d" }, "downloads": -1, "filename": "securedrop-sdk-0.0.7.tar.gz", "has_sig": true, "md5_digest": "55691b4f692c027373cdb08b49db05fe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 19556, "upload_time": "2019-04-16T20:43:32", "url": "https://files.pythonhosted.org/packages/1d/98/d362fd1d5589881b7547489efdf711ae0c9764d9cd6a9a6c38418cc21b5b/securedrop-sdk-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "aa9adc9c99fe95436affa6011063d98d", "sha256": "eca697da2520b568a4600b11c3ab818f5855e0ce13f88495d756a894f142f2a1" }, "downloads": -1, "filename": "securedrop-sdk-0.0.8.tar.gz", "has_sig": true, "md5_digest": "aa9adc9c99fe95436affa6011063d98d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 19294, "upload_time": "2019-04-29T20:07:51", "url": "https://files.pythonhosted.org/packages/4c/dc/c4af51276ef3eac6fea1a53dab7cca32fe29d344ff258032f300cae2d58d/securedrop-sdk-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "017ad9999d47a57e6a36d8c2369eff68", "sha256": "43146f02c41858578f7c9997e733f2a07f8a4877f1bf9f8b4b11fd4ceffa47a9" }, "downloads": -1, "filename": "securedrop-sdk-0.0.9.tar.gz", "has_sig": false, "md5_digest": "017ad9999d47a57e6a36d8c2369eff68", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 24026, "upload_time": "2019-05-13T23:30:19", "url": "https://files.pythonhosted.org/packages/20/33/aa1370b351f49d717df4d10f4c538130bd55be27174c044ed8e501b140ce/securedrop-sdk-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d578569eddb8363200f232bba995d25c", "sha256": "89a454a45eac15db702e06d24f5e4be64b8d033a5546aff056de762ecfc5f72a" }, "downloads": -1, "filename": "securedrop-sdk-0.0.11.tar.gz", "has_sig": false, "md5_digest": "d578569eddb8363200f232bba995d25c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 21674, "upload_time": "2019-06-24T09:07:06", "url": "https://files.pythonhosted.org/packages/24/4d/caf7a7476caeedb4a5aefecb9ec1995d9d2746fca3d35f20a80bd2f756f4/securedrop-sdk-0.0.11.tar.gz" } ] }