Registry / auth-security / python-tss-sdk

python-tss-sdk

JSON →
library2.0.1pypypi✓ verified 85d ago

The Delinea Secret Server Python SDK (version 2.0.1) provides Python classes to interact with Delinea Secret Server and Delinea Platform via their REST APIs. It supports various authentication methods and facilitates programmatic access to secrets. The library is actively maintained with regular releases and requires Python 3.8 or higher.

pip install python-tss-sdk
INSTALL
IMPORT
SIG · PYTHON-TSS-SDK
P
python-tss-sdk
auth-securitypythonv2.0.1
Install
2.1s avg
Import
582ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.623s · 21.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.1s · import 0.541s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SecretServer
from delinea.secrets.server import SecretServer
from thycotic.secrets.server import SecretServer
The top-level namespace changed from 'thycotic' to 'delinea' in version 1.2.0 due to rebranding.
SecretServerCloud
from delinea.secrets.server import SecretServerCloud
PasswordGrantAuthorizer
from delinea.secrets.server import PasswordGrantAuthorizer
SecretServerError
from delinea.secrets.server import SecretServerError

This quickstart demonstrates how to authenticate with Delinea Secret Server Cloud using a username and password and then retrieve a secret by its ID. It relies on environment variables for sensitive credentials.

import os from delinea.secrets.server import ( SecretServerCloud, PasswordGrantAuthorizer, SecretServerError ) # Ensure these environment variables are set: # TSS_TENANT (e.g., 'mytenant') # TSS_USERNAME # TSS_PASSWORD try: tenant = os.environ.get('TSS_TENANT', '') username = os.environ.get('TSS_USERNAME', '') password = os.environ.get('TSS_PASSWORD', '') if not all([tenant, username, password]): raise ValueError("TSS_TENANT, TSS_USERNAME, and TSS_PASSWORD environment variables must be set.") # For Secret Server Cloud, 'tenant' parameter simplifies URL construction authorizer = PasswordGrantAuthorizer( base_url=f"https://{tenant}.secretservercloud.com", username=username, password=password ) secret_server_cloud = SecretServerCloud(tenant=tenant, authorizer=authorizer) # Example: Fetch a secret by ID secret_id = 123 # Replace with a valid secret ID from your Secret Server secret = secret_server_cloud.get_secret(secret_id) print(f"Successfully fetched secret with ID {secret_id}:") print(f"Secret Name: {secret.name}") # Access secret fields, e.g., secret.data['username'] or secret.data['password'] except SecretServerError as e: print(f"Secret Server Error: {e.message}") print("Please check your credentials, tenant URL, and permissions.") except ValueError as e: print(f"Configuration Error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingThe package's top-level import namespace changed from `thycotic` to `delinea` in version 1.2.0 due to the company's rebranding to Delinea. Code using `from thycotic.secrets.server import ...` will break.
fix
Update all import statements from `thycotic.secrets.server` to `delinea.secrets.server`.
affects: <=1.x
gotchaWhen using application accounts for authentication, ensure they are assigned only the minimum required roles and permissions, not the 'Administrator Role' or all role permissions, to maintain security best practices.
fix
Review and limit application account permissions within Delinea Secret Server to the principle of least privilege.
affects: All
gotchaSelf-signed SSL certificates or untrusted certificates can cause 'SSL Connectivity or Certificate Issues?'. The Python `requests` library (used by the SDK) may fail to verify the certificate.
fix
Ensure a trusted SSL certificate is used. If using self-signed certificates in development, consider configuring the `REQUESTS_CA_BUNDLE` environment variable or explicitly disabling SSL verification (not recommended for production).
affects: All
gotchaConnectivity issues or 'Login Failed' errors can occur if webservices are not enabled on your Secret Server instance, or if an incorrect base URL (e.g., including `/Login.aspx`) is used.
fix
Verify that 'Enable Webservices' is set to 'Yes' in Secret Server's Administration > Configuration. Ensure the `base_url` provided to the authorizer is the root URL of your Secret Server instance (e.g., `https://yourserver/SecretServer`, not `https://yourserver/SecretServer/Login.aspx`).
affects: All
Errors
Common errors & fixes
ImportError: No module named 'thycotic'
Attempting to import classes using the old `thycotic` namespace after upgrading the SDK to version 1.2.0 or higher.
fix
Change import statements from `from thycotic.secrets.server import ...` to `from delinea.secrets.server import ...`.
Secret Server Error: Access Denied
The authenticated user or application account lacks the necessary permissions to access the requested secret or perform the action.
fix
Verify the permissions assigned to the user or application account in Delinea Secret Server. Ensure the account has 'Read' permissions on the specific secret or folder.
requests.exceptions.SSLError: HTTPSConnectionPool(...) Max retries exceeded with url: /oauth2/token (Caused by SSLError(CertificateError("hostname 'yourserver.com' doesn't match ...")))
The Python `requests` library cannot verify the SSL certificate presented by the Secret Server instance, often due to self-signed or untrusted certificates.
fix
Either install a trusted certificate on the Secret Server or configure the client environment to trust the certificate (e.g., by setting `REQUESTS_CA_BUNDLE` to a .pem file containing the certificate chain).
Secret Server Error: The remote server returned an error: (400) Bad Request
Often caused by incorrect authentication credentials (username, password, or tenant/base URL), or webservices not being enabled on the Secret Server instance.
fix
Double-check your `TSS_USERNAME`, `TSS_PASSWORD`, `TSS_TENANT` (or `base_url`) environment variables. Confirm that 'Enable Webservices' is set to 'Yes' in your Secret Server configuration.
Upgrade
Version history
2.0.1latest on PyPI · released Nov 3, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
57 hits · last 30 days
node
48
OpenAI (training)
1
Resources
python-tss-sdk — pip install python-tss-sdk · libregistry