Skip to content

jeffshurtliff/pydplus

Repository files navigation

PyDPlus Logo

PyDPlus

A Python toolset for the RSA ID Plus cloud authentication platform.

Latest Stable Release PyPI
Latest Beta/RC Release PyPI
Build Status GitHub Workflow Status
Supported Versions PyPI - Python Versions Supported
Code Coverage Codecov - Code Coverage
Documentation Documentation Status
Security Audits Bandit
License License (GitHub)
Issues GitHub Open Issues
GitHub Closed Issues
Pull Requests GitHub Open Pull Requests
GitHub Closed Pull Requests

Installation

Install from PyPI:

python -m pip install --upgrade pydplus

Install from source:

git clone https://github.com/jeffshurtliff/pydplus.git
cd pydplus
poetry install

Change Log

The change log can be found in the documentation.

Usage

PyDPlus is designed for Python-based administration workflows in RSA ID Plus tenants, including:

  • user lifecycle automation (lookup, disable, mark for deletion)
  • admin reporting and audit integrations
  • helpdesk and identity-operations scripting

1) Import the package

from pydplus import PyDPlus, constants as const

2) Instantiate the client (OAuth example)

pydplus.PyDPlus supports both OAuth and Legacy credentials. OAuth (Private Key JWT) is recommended for new usage.

from pydplus import PyDPlus, constants as const

OAUTH_SCOPE = [
    const.OAUTH_SCOPES.USER_READ,
    const.OAUTH_SCOPES.USER_MANAGE,
]

pydp = PyDPlus(
    connection_type="oauth",
    base_admin_url="https://example-company.access.securid.com",
    oauth_client_id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    oauth_private_key="/path/to/oauth-private-key.jwk",
    oauth_scope=OAUTH_SCOPE,
)

Legacy API authentication is also supported. See the Authentication guide for both patterns.

3) Define OAuth scopes (three practical options)

  1. Configure default scope permissions in the OAuth client settings in the RSA Cloud Administration Console.
  2. Define scopes explicitly in your code/helper/env configuration (manual string values or constants like const.OAUTH_SCOPES.USER_READ grouped in an OAUTH_SCOPE variable).
  3. Use scope presets to apply scope bundles (for example user_read_only or group_read_only) via oauth_scope_preset (argument), connection.oauth.scope_preset (helper setting), or PYDPLUS_OAUTH_SCOPE_PRESET (environment variable).

In PyDPlus, keep oauth_scope explicitly defined (directly, helper file, or environment variable) so token requests remain deterministic and validated.

Presets are additive and merged with explicit scopes:

pydp = PyDPlus(
    connection_type="oauth",
    base_admin_url="https://example-company.access.securid.com",
    oauth_client_id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    oauth_private_key="/path/to/oauth-private-key.jwk",
    oauth_scope=const.OAUTH_SCOPES.USER_MANAGE,
    oauth_scope_preset=("user_read_only", "group_read_only"),
)

4) Run an API operation

user_id = pydp.users.get_user_id(email="john.doe@example.com")
response = pydp.users.disable_user(user_id=user_id)

For deeper coverage, see:

Documentation

The documentation is located here: https://pydplus.readthedocs.io/en/stable/

License

MIT License

Reporting Issues

Issues can be reported within the GitHub repository.

Contributing

Contributions are welcome and appreciated, including bug fixes, documentation improvements, tests, and feature work. For full contribution requirements and workflows, please see CONTRIBUTING.md.

Development Quality Checks

This repository uses Ruff for linting, import sorting, and formatting. The standard maximum line length for this package is 130 characters.

Line-length exceptions should be rare and limited to comments or special cases where wrapping harms readability. When an exception is required, use a targeted per-line # noqa: E501 comment.

poetry run ruff check .
poetry run ruff check . --fix
poetry run ruff format .
poetry run ruff format . --check

These checks are enforced in CI via .github/workflows/ci.yml.

Donations

If you would like to donate to this project then you can do so using this PayPal link.

Disclaimer

This package is considered unofficial and is in no way endorsed or supported by RSA Security LLC.

Packages

 
 
 

Contributors

Languages