Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![PyPI](https://img.shields.io/pypi/v/pysafeguard.svg)](https://pypi.org/project/pysafeguard/)
[![GitHub](https://img.shields.io/github/license/OneIdentity/PySafeguard.svg)](https://github.com/OneIdentity/PySafeguard/blob/main/LICENSE)

# PySafeguard
One Identity Safeguard Python SDK

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[project]
name = "pysafeguard"
description = "One Identity Safeguard Python Package"
version = "8.0.1"
version = "8.0.2"
readme = { file = "README.md", content-type = "text/markdown" }
keywords = ["safeguard", "oneidentity"]
license = "Apache"
Expand Down
3 changes: 3 additions & 0 deletions samples/A2AApiKeySecretExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

from pysafeguard import A2AContext, A2AType

# The appliance host name or IP address
Expand Down
3 changes: 3 additions & 0 deletions samples/A2APasswordExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

from pysafeguard import A2AContext

# The appliance host name or IP address
Expand Down
3 changes: 3 additions & 0 deletions samples/A2APrivateKeyExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

from pysafeguard import A2AContext, SshKeyFormat

# The appliance host name or IP address
Expand Down
3 changes: 3 additions & 0 deletions samples/AnonymousExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/CertificateExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, CertificateAuth, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/CertificateExternalExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, CertificateAuth, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/NewUserExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, PasswordAuth, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/PasswordExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, PasswordAuth, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/PasswordExternalExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, PasswordAuth, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/PersistentSignalRExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

from pysafeguard import SafeguardClient, PkceAuth

# The appliance host name or IP address
Expand Down
3 changes: 3 additions & 0 deletions samples/PkceExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import json

from pysafeguard import SafeguardClient, PkceAuth, Service
Expand Down
3 changes: 3 additions & 0 deletions samples/SignalRExample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

from pysafeguard import SafeguardClient, PasswordAuth

# The appliance host name or IP address
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""PySafeguard — Python SDK for One Identity Safeguard Web API."""

from __future__ import annotations
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/a2a.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Application-to-Application (A2A) context for Safeguard credential operations.

The :class:`A2AContext` provides a reusable wrapper around the Safeguard A2A
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/async_a2a.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Async Application-to-Application (A2A) context for Safeguard.

Mirrors :class:`~pysafeguard.a2a.A2AContext` for use with ``asyncio``.
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/async_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Asynchronous Safeguard API client.

Async mirror of :class:`~pysafeguard.client.SafeguardClient` using
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/async_pkce.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Async PKCE non-interactive login for Safeguard.

Async mirror of :mod:`pysafeguard.pkce`. Programmatically drives the
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Authentication strategy objects for Safeguard.

Each auth class encapsulates credentials and knows how to authenticate
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Synchronous Safeguard API client.

The primary entry point for interacting with a One Identity Safeguard
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/data_types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import enum
import sys

Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/errors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Exception hierarchy for PySafeguard.

All exceptions inherit from :class:`SafeguardError` so callers can catch
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/event.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Safeguard event listener system using SignalR.

Provides two listener classes:
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/hidden_string.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Hidden string wrapper for sensitive values.

Provides protection against casual exposure of secrets (passwords, tokens)
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/pkce.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""PKCE non-interactive login for Safeguard.

Programmatically drives the browser-based OAuth2/PKCE flow by directly
Expand Down
3 changes: 3 additions & 0 deletions src/pysafeguard/utility.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

import sys
from collections.abc import Mapping
from urllib.parse import urlencode, urlunparse
Expand Down
2 changes: 2 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Root conftest — shared fixtures and marker registration for PySafeguard tests."""

import os
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.
3 changes: 3 additions & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration test fixtures — shared authenticated connections for live-appliance tests."""

from __future__ import annotations
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_a2a.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests for A2A (Application-to-Application) credential operations.

These tests create a full A2A environment on the appliance:
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_anonymous.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration test: anonymous (unauthenticated) access to notification endpoints."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_auth_async.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: async authentication flows against a live appliance."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_auth_lifecycle.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: auth lifecycle — refresh, logout, credential storage, context manager."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_auth_sync.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: sync authentication flows against a live appliance."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_certificate_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests for CertificateAuth login.

Creates a self-signed certificate, uploads it to TrustedCertificates,
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_client_features.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: client features — provider lookup, request(), auto-refresh, error handling."""

from __future__ import annotations
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_event_listener.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests for the event listener system against a live Safeguard appliance.

These tests verify that:
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_factories.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Verify that removed v7.x factory functions are no longer importable.

In v8.0, the module-level factory functions (connect_password, connect_certificate,
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_invoke_async.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: async invoke with various HTTP methods."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_invoke_sync.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: sync invoke with various HTTP methods and options."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_persistent_listener_factory.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: PersistentSafeguardEventListener.from_password live token factory.

Verifies the refactored from_password/from_certificate factory methods
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_pkce_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: PKCE authentication (sync + async).

PKCE is the recommended auth method for newer appliances where
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_streaming.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests for streaming download/upload against a live Safeguard appliance.

Uses the Backups endpoint (``service/appliance/v4/Backups``) which supports
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_token_async.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: async token lifetime and provider lookup."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_token_sync.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: sync token lifetime and provider lookup."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_user_crud_async.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: async user CRUD lifecycle with full cleanup."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/test_user_crud_sync.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Integration tests: sync user CRUD lifecycle with full cleanup."""

import pytest
Expand Down
3 changes: 3 additions & 0 deletions tests/test_a2a.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Tests for A2AContext and AsyncA2AContext construction and validation logic.

These are pure-logic tests that do not require a live appliance or A2A
Expand Down
3 changes: 3 additions & 0 deletions tests/test_async_client_new.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Tests for AsyncSafeguardClient request logic using mocked HTTP responses.

Tests URL construction, auth flow, and verb methods using the new v8.0
Expand Down
3 changes: 3 additions & 0 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Tests for auth strategy objects (pysafeguard.auth).

Covers construction, protocol conformance, secret wrapping, can_refresh,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_client_new.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Tests for SafeguardClient construction and properties.

Covers init defaults, repr, is_authenticated, context manager behavior,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_client_request_logic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Tests for SafeguardClient request logic using mocked HTTP responses.

Tests URL construction, header merging, body handling, verb methods,
Expand Down
3 changes: 3 additions & 0 deletions tests/test_data_types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Unit tests for pysafeguard.data_types — enum definitions and StrEnum behavior."""

from pysafeguard.data_types import A2AType, A2ATypes, HttpMethod, HttpMethods, Service, Services, SshKeyFormat, SshKeyFormats
Expand Down
3 changes: 3 additions & 0 deletions tests/test_event.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Tests for the event handler registry, listener construction, and state management.

These are pure-logic tests that do not require signalrcore or a live appliance.
Expand Down
3 changes: 3 additions & 0 deletions tests/test_hidden_string.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Unit tests for pysafeguard.hidden_string — HiddenString wrapper."""

import copy
Expand Down
3 changes: 3 additions & 0 deletions tests/test_pkce_helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) One Identity LLC. All rights reserved.
# Licensed under the Apache License, Version 2.0.

"""Unit tests for PKCE crypto helpers and authorization code extraction.

These test the pure functions in pkce.py without requiring network access.
Expand Down
Loading