Skip to main content

Using functions which use Securden APIs, developers can retrieve credentials programmatically from Securden server.

Project description

Securden Software Development Kit - Python

This guide will take you through the process of installing and integrating Securden Python SDK for secure programmatic access to credentials.

Summary of Steps

  1. Installation
  2. Fetch credential using pre-defined commands

1. Installation

pip install securden_sdk

3. Fetch credential via CLI commands

Required

from securden_sdk import ApiClient
from securden_sdk import Configuration
from securden_sdk.api import DefaultApi 

config = Configuration(
    host="<your_securden_server_url>",
)
api = ApiClient(configuration=config)
api.authtoken = "<your_api_key>"
securden_instance = DefaultApi(api)

try:
    password = securden_instance.get_password(account_id=<your_account_id>)
    print("Response:", password)

    account_details = securden_instance.get_account_details(account_id=<your_account_id>)
    print("Account details:", account_details)

    generated_password = securden_instance.generate_password(policy_id=<your_policy_id>)
    print("Generated password:", generated_password)

    policy_details = securden_instance.get_policy_details(policy_id=<your_policy_id>)
    print("Policy details:", policy_details)
except Exception as e:
    print(e)

CRUD Examples

from securden_sdk import ApiClient, Configuration
from securden_sdk.api import DefaultApi

config = Configuration(
    host="https://ArryamanF0JJSL3:8000",
    verify_ssl=False,
)

api_client = ApiClient(configuration=config)
api_client.authtoken = "a8deffe7-5301-4034-ade8-1ba73f72e262"

api = DefaultApi(api_client)

add_account_payload = {
    "account_title": "test_title",
    "account_name": "test_name",
    "account_type": "Web Account",
    "ipaddress": "www.google.com",
    "notes": "test_notes",
    "tags": "test_tag",
    "folder_id": 1000000027879,
    "password": "Test",
}

add_folder_payload = {
    "folder_name": "Testfolder",
    "description": "sample",
    "notes": "sample_notes",
    "parent_folder_id": 1000000009229,
    "inherit_parentshare": False,
}

edit_account_payload = {
    "account_id": 1000000027879,
    "account_title": "test_title",
    "account_name": "test_name",
    "account_type": "Web Account",
    "ipaddress": "www.google.com",
    "notes": "test_notes",
    "tags": "test_tag",
    "folder_id": 1000000027879,
    "overwrite_additional_fields": False,
}

edit_folder_payload = {
    "folder_id": 1000000009229,
    "folder_name": "Testfolder",
    "description": "sample",
    "notes": "sample_notes",
    "parent_folder_id": 1000000009229,
    "inherit_parentshare": False,
}

print(api.add_account(add_account_payload))
print(api.add_folder(add_folder_payload))
print(api.edit_account(edit_account_payload))
print(api.edit_folder(edit_folder_payload))
print(api.delete_accounts(
    account_ids=[1000000027879],
    reason="Test",
    delete_permanently=False,
))

Secrets Management Wrapper Operations

DefaultApi includes the /secretsmanagement/* wrapper endpoints:

  • get_account_details(account_id=...)
  • add_account(payload=...)
  • edit_account(payload=...)
  • delete_accounts(account_ids=[...], reason=..., delete_permanently=...)
  • get_folders(...)
  • add_folder(payload=...)
  • edit_folder(payload=...)
  • delete_folders(folder_ids=[...], reason=...)
  • generate_password(policy_id=... | policy_name=...)
  • get_policy_details(policy_id=...)

For file-based account types such as File Store, SSH Key, License Key, and Personal SSH Key, payload["accounts_file"] can be provided in either of these forms:

  • {"file_name": "...", "file_content": ...} for the existing JSON-style payload
  • a direct file input for add_account, such as a file path, a (file_name, bytes) tuple, or a binary file-like object

-> If you have general questions or issues in using Securden SDK, you may raise a support request to devops-support@securden.com. Our support team will get back to you at the earliest and provide a timeline if there are issue fixes involved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

securden_sdk-1.0.2.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

securden_sdk-1.0.2-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file securden_sdk-1.0.2.tar.gz.

File metadata

  • Download URL: securden_sdk-1.0.2.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for securden_sdk-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ab0b35383d2456cd37a21ecd20ecbb0e59d053bf5d91bc94b65359d8b7a45288
MD5 c3d7e109bb83140c3aecb70f341a8ad9
BLAKE2b-256 c895e7f8836a6e56d90993931c10895dd3f876ff1192ebf8223bafd20f47a72d

See more details on using hashes here.

File details

Details for the file securden_sdk-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: securden_sdk-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for securden_sdk-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b793d8362bc195332a6fc58675d4fac4ff9d4ee16cc8882e61917d8c7b114f30
MD5 3082d05ef71eeac29c75ae4786e052de
BLAKE2b-256 ec108fefd1d47cbdf935578941218151b32ce6d339306646e77f66a9fbc249df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page