{ "info": { "author": "Paulo Dorado", "author_email": "support@thycotic.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Thycotic SDK Python Package\r\n\r\nA Python package to facilitate the connection to the Thycotic Secret Server\r\n\r\n## Prerequisites\r\n\r\nPython 2.7* and Python 3.*\r\n\r\n## Downloading the package\r\n\r\nYou can download the package here or through the pip command:\r\n\r\n``` python\r\npip install secret-server-sdk-client\r\n```\r\n\r\n## Initial Setup\r\n\r\nImport the SDK Client\r\n\r\n``` python\r\nfrom secret_server.sdk_client import SDK_Client\r\n```\r\n\r\nInstantiate the ```SDK_Client``` object\r\n\r\n```python\r\nclient = SDK_Client()\r\n```\r\n\r\nConfigure the connection to your Secret Server instance by using the\r\n\r\n``` python\r\nconfigure(, , , )\r\n```\r\n\r\n**required parameters:**\r\n\r\n- ```sdk_path``` - the path to the directory containing the SDK client\r\n- ```url``` - theURL to your Secret Server instance\r\n- ```rule``` - the name of an onboarding rule you have created\r\n- ```key``` - the onboarding key for that rule, if applicable\r\n\r\n```python\r\nclient.configure(os.environ.get('HOME') + '\\\\tss\\\\', 'https://myserver/SecretServer',\r\n 'OnboardingRule', 'oB0arD1ngKey')\r\n```\r\n\r\nAnother way to configure the connection to your Secret Server instance:\r\n\r\n```python\r\nclient.config.SDK_CONFIG['path'] = os.environ.get('HOME') + '\\\\tss\\\\'\r\nclient.config.SDK_CONFIG['url'] = 'https://myserver/SecretServer'\r\nclient.config.SDK_CONFIG['rule'] = 'OnboardingRule'\r\nclient.config.SDK_CONFIG['key'] = 'oB0arD1ngKey'\r\n```\r\n\r\nAlternatively, you can also pull configuration from the current environment using the\r\nos.environ object:\r\n\r\n```python\r\nclient.configure_from_env()\r\n```\r\n\r\nThe methods sets the config using the following variables\r\n\r\n```python\r\nos.environ.get('SDK_CLIENT_PATH')\r\nos.environ.get('SECRET_SERVER_URL')\r\nos.environ.get('SDK_CLIENT_RULE')\r\nos.environ.get('SDK_CLIENT_KEY')\r\n```\r\n\r\nInitialize the connection to the Secret Server:\r\n\r\n```python\r\nclient.commands.initialize()\r\n```\r\n\r\nOnce the configuration and initialization are complete, they do not need to be run again.\r\nEncrypted configuration files created in the current directory will be used to establish the\r\nconnection to Secret Server instance.\r\n\r\n## Usage\r\n\r\nFetch a secret by ID \r\n\r\n```python\r\n# retrieve the full representation of a secret\r\nsecret = client.commands.get_secret(1)\r\n\r\n# retrieve only the secret fields\r\nsecret = client.commands.get_secret(1, field = 'all')\r\n\r\n# retrieve only a single secret field value by slug\r\npassword = client.commands.get_secret(1, field = 'password')\r\n```\r\n\r\nTo remove the connection to Secret Server and delete all configuration:\r\n\r\n```python\r\nclient.commands.remove()\r\n```\r\n\r\n## Cache Settings\r\n\r\nBy default, no secret values are stored on the local machine. As such, every call to\r\n\r\n```get_secret``` will result in a round-trip to the server. If the server is unavailable,\r\nthe call will fail.\r\n\r\nTo change this behavior, set the cache strategy using the\r\n\r\n```set_cache(, )``` with the required parameters:\r\n\r\n- ```cache_strategy``` - the numeric representation of the cache strategy for the secrets\r\n- ```cache_age``` - cache age (the maximum time, in minutes, that a cached value will be usable)\r\n\r\nExamples of setting cache:\r\n\r\n```python\r\n# The default (never cache secrets). Cache age is optional for this choice\r\nclient.set_cache(0)\r\n\r\n# Check the server first; if unavailable, return the last retrieved value, if present.\r\n# Use this strategy for improved fault tolerance.\r\n# Server Then Cache for 5 minutes\r\nclient.set_cache(1, 5)\r\n\r\n# Check the cache first; if no value is present, retrieve it from the server.\r\n# Use this strategy for improved performance.\r\n# Cache Then Server for 10 minutes\r\nclient.set_cache(2, 10)\r\n\r\n# Same as the above mode, but allow an expired cached value to be used if the server \r\n# is unavailable.\r\n# Cache\u00a0Then\u00a0Server\u00a0Fallback\u00a0on\u00a0Expired\u00a0Cache for 15 minutes\r\nclient.set_cache(3, 15)\r\n\r\n# Clear all cached values immediately\r\nclient.commands.clear_cache()\r\n```\r\n\r\n## Authors\r\n\r\nPaulo Dorado\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\r\n\r\n## Acknowledgments\r\n\r\nThycotic SDK\r\n\r\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/thycotic/secret-server-python", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "secret-server-sdk-client", "package_url": "https://pypi.org/project/secret-server-sdk-client/", "platform": "", "project_url": "https://pypi.org/project/secret-server-sdk-client/", "project_urls": { "Homepage": "https://github.com/thycotic/secret-server-python" }, "release_url": "https://pypi.org/project/secret-server-sdk-client/1.0/", "requires_dist": null, "requires_python": "", "summary": "Thycotic python client that uses the Thycotic SDK to get secrets from secret server", "version": "1.0" }, "last_serial": 4228304, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "cb30df48b48b6238a4e3c3e289390a90", "sha256": "dd96786832989d96aec6930facef7be8097de7c17dcc5c10f82a4e38f1164834" }, "downloads": -1, "filename": "secret_server_sdk_client-1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "cb30df48b48b6238a4e3c3e289390a90", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5244, "upload_time": "2018-09-01T02:08:24", "url": "https://files.pythonhosted.org/packages/e5/b2/b533be0bafa507a2eb1c7f115a93288fadbcb47550b93d0efe6ec9c9a33f/secret_server_sdk_client-1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "882989adb16fc85969979568fa659fcb", "sha256": "06ea5d72c4dd517d5857f2e837c0f67a4f9abf1740611afa2c55d8b4f291aa12" }, "downloads": -1, "filename": "secret-server-sdk-client-1.0.tar.gz", "has_sig": false, "md5_digest": "882989adb16fc85969979568fa659fcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4320, "upload_time": "2018-09-01T02:08:25", "url": "https://files.pythonhosted.org/packages/18/21/263f270691561f659ec8295efe40fd38a10970b05ad67251426bdfdd6566/secret-server-sdk-client-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cb30df48b48b6238a4e3c3e289390a90", "sha256": "dd96786832989d96aec6930facef7be8097de7c17dcc5c10f82a4e38f1164834" }, "downloads": -1, "filename": "secret_server_sdk_client-1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "cb30df48b48b6238a4e3c3e289390a90", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5244, "upload_time": "2018-09-01T02:08:24", "url": "https://files.pythonhosted.org/packages/e5/b2/b533be0bafa507a2eb1c7f115a93288fadbcb47550b93d0efe6ec9c9a33f/secret_server_sdk_client-1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "882989adb16fc85969979568fa659fcb", "sha256": "06ea5d72c4dd517d5857f2e837c0f67a4f9abf1740611afa2c55d8b4f291aa12" }, "downloads": -1, "filename": "secret-server-sdk-client-1.0.tar.gz", "has_sig": false, "md5_digest": "882989adb16fc85969979568fa659fcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4320, "upload_time": "2018-09-01T02:08:25", "url": "https://files.pythonhosted.org/packages/18/21/263f270691561f659ec8295efe40fd38a10970b05ad67251426bdfdd6566/secret-server-sdk-client-1.0.tar.gz" } ] }