diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 8667391a..756f879f 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v4 # Release-please for develop branch (creates alpha prereleases) - - uses: googleapis/release-please-action@v4 + - uses: googleapis/release-please-action@v5 if: github.ref == 'refs/heads/develop' id: release-develop with: @@ -37,7 +37,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} # Release-please for main branch (creates stable releases) - - uses: googleapis/release-please-action@v4 + - uses: googleapis/release-please-action@v5 if: github.ref == 'refs/heads/main' id: release-main with: diff --git a/.release-please-config.json b/.release-please-config.json index 9f542739..9177f787 100644 --- a/.release-please-config.json +++ b/.release-please-config.json @@ -6,6 +6,7 @@ "packages/otdf-python": { "release-type": "python", "package-name": "otdf-python", + "changelog-path": "CHANGELOG.md", "extra-files": [ "packages/otdf-python/pyproject.toml", { diff --git a/CHANGELOG.md b/CHANGELOG.md index 95373a90..58288a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [0.7.2](https://github.com/b-long/opentdf-python-sdk/compare/otdf-python-v0.7.1...otdf-python-v0.7.2) (TBD) + + +### Bug Fixes + +* fix D205 docstring formatting across otdf-python source files ([#149](https://github.com/b-long/opentdf-python-sdk/issues/149)) ([c0910cb](https://github.com/b-long/opentdf-python-sdk/commit/c0910cbb599af4f05e1bb5ca5d130e85d39eb4fa)) +* fix/increase testing, fix misconfiguration ([#148](https://github.com/b-long/opentdf-python-sdk/issues/148)) ([1dc8c45](https://github.com/b-long/opentdf-python-sdk/commit/1dc8c4557bdcbcbf74b2f663c4e190664047cb7f)) +* **main:** fix release issue, required arguments from workspace root ([#147](https://github.com/b-long/opentdf-python-sdk/issues/147)) ([668f00a](https://github.com/b-long/opentdf-python-sdk/commit/668f00a083990b5cea686e5885216e0359ceaf55)) +* use --package flag with uv version for workspace layout ([#144](https://github.com/b-long/opentdf-python-sdk/issues/144)) ([12acfbb](https://github.com/b-long/opentdf-python-sdk/commit/12acfbb4f8d99c8c745f35cbd7bddfc41e63b8b4)) + +## [0.7.1](https://github.com/b-long/opentdf-python-sdk/compare/otdf-python-v0.7.0...otdf-python-v0.7.1) (2026-06-04) + + +### Documentation + +* fix project structure path in README ([#145](https://github.com/b-long/opentdf-python-sdk/issues/145)) ([c10f98b](https://github.com/b-long/opentdf-python-sdk/commit/c10f98bb67e823a8bd061c8100d8493d2083699f)) + +## [0.7.0](https://github.com/b-long/opentdf-python-sdk/compare/otdf-python-v0.6.0...otdf-python-v0.7.0) (2026-06-04) + + +### Features + +* **main:** update dependencies & switch to uv workspace layout ([#142](https://github.com/b-long/opentdf-python-sdk/issues/142)) ([649f63c](https://github.com/b-long/opentdf-python-sdk/commit/649f63ce4eee4b564b92afd3dbda2b3e3d55803e)) + ## [0.6.0](https://github.com/b-long/opentdf-python-sdk/compare/otdf-python-v0.5.0...otdf-python-v0.6.0) (2026-05-21) diff --git a/packages/otdf-python/CHANGELOG.md b/packages/otdf-python/CHANGELOG.md deleted file mode 100644 index 84ec14f3..00000000 --- a/packages/otdf-python/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Changelog - -## [0.7.1](https://github.com/b-long/opentdf-python-sdk/compare/otdf-python-v0.7.0...otdf-python-v0.7.1) (2026-06-04) - - -### Documentation - -* fix project structure path in README ([#145](https://github.com/b-long/opentdf-python-sdk/issues/145)) ([c10f98b](https://github.com/b-long/opentdf-python-sdk/commit/c10f98bb67e823a8bd061c8100d8493d2083699f)) - -## [0.7.0](https://github.com/b-long/opentdf-python-sdk/compare/otdf-python-v0.6.0...otdf-python-v0.7.0) (2026-06-04) - - -### Features - -* **main:** update dependencies & switch to uv workspace layout ([#142](https://github.com/b-long/opentdf-python-sdk/issues/142)) ([649f63c](https://github.com/b-long/opentdf-python-sdk/commit/649f63ce4eee4b564b92afd3dbda2b3e3d55803e)) diff --git a/packages/otdf-python/src/otdf_python/auth_headers.py b/packages/otdf-python/src/otdf_python/auth_headers.py index afb2077e..7943e003 100644 --- a/packages/otdf-python/src/otdf_python/auth_headers.py +++ b/packages/otdf-python/src/otdf_python/auth_headers.py @@ -6,6 +6,7 @@ @dataclass class AuthHeaders: """Represents authentication headers used in token-based authorization. + This class holds authorization and DPoP (Demonstrating Proof of Possession) headers that are used in token-based API requests. """ diff --git a/packages/otdf-python/src/otdf_python/kas_client.py b/packages/otdf-python/src/otdf_python/kas_client.py index 82e90d34..c460e810 100644 --- a/packages/otdf-python/src/otdf_python/kas_client.py +++ b/packages/otdf-python/src/otdf_python/kas_client.py @@ -362,6 +362,7 @@ def _create_signed_request_jwt( self, policy_json, client_public_key, key_access, session_key_type=None ): """Create a signed JWT for the rewrap request. + The JWT is signed with the DPoP private key. Args: @@ -400,6 +401,7 @@ def _create_signed_request_jwt( def _create_connect_rpc_signed_token(self, key_access, policy_json): """Create a signed token specifically for Connect RPC requests. + For now, this delegates to the existing JWT creation method. """ return self._create_signed_request_jwt( @@ -469,6 +471,7 @@ def _create_dpop_proof(self, method, url, access_token=None): def get_public_key(self, kas_info): """Get KAS public key using Connect RPC. + Checks cache first if available. """ try: @@ -569,6 +572,7 @@ def _prepare_ec_keypair(self, session_key_type): def _prepare_rsa_keypair(self): """Prepare RSA key pair for unwrapping, reusing if possible. + Uses separate ephemeral keys for encryption (not DPoP keys). Returns: diff --git a/packages/otdf-python/src/otdf_python/kas_connect_rpc_client.py b/packages/otdf-python/src/otdf_python/kas_connect_rpc_client.py index 8ee8176e..937b87de 100644 --- a/packages/otdf-python/src/otdf_python/kas_connect_rpc_client.py +++ b/packages/otdf-python/src/otdf_python/kas_connect_rpc_client.py @@ -1,4 +1,5 @@ """KASConnectRPCClient: Handles Connect RPC communication with the Key Access Service (KAS). + This class encapsulates all interactions with otdf_python_proto. """ diff --git a/packages/otdf-python/src/otdf_python/kas_info.py b/packages/otdf-python/src/otdf_python/kas_info.py index 336359a5..20743d08 100644 --- a/packages/otdf-python/src/otdf_python/kas_info.py +++ b/packages/otdf-python/src/otdf_python/kas_info.py @@ -6,6 +6,7 @@ @dataclass class KASInfo: """Configuration for Key Access Server (KAS) information. + This class stores details about a Key Access Server including its URL, public key, key ID, default status, and cryptographic algorithm. """ diff --git a/packages/otdf-python/src/otdf_python/key_type_constants.py b/packages/otdf-python/src/otdf_python/key_type_constants.py index 185cabb8..394e44af 100644 --- a/packages/otdf-python/src/otdf_python/key_type_constants.py +++ b/packages/otdf-python/src/otdf_python/key_type_constants.py @@ -1,4 +1,5 @@ """Constants for session key types used in the KAS client. + This matches the Java SDK's KeyType enum pattern. """ diff --git a/packages/otdf-python/src/otdf_python/nanotdf_ecdsa_struct.py b/packages/otdf-python/src/otdf_python/nanotdf_ecdsa_struct.py index 5abb4f58..cfebae8d 100644 --- a/packages/otdf-python/src/otdf_python/nanotdf_ecdsa_struct.py +++ b/packages/otdf-python/src/otdf_python/nanotdf_ecdsa_struct.py @@ -68,6 +68,7 @@ def from_bytes( def as_bytes(self) -> bytes: """Convert the signature structure to bytes. + Raises ValueError if r_value or s_value is None. """ if self.r_value is None or self.s_value is None: diff --git a/packages/otdf-python/src/otdf_python/policy_binding_serializer.py b/packages/otdf-python/src/otdf_python/policy_binding_serializer.py index 2b1c05ed..e7e6a962 100644 --- a/packages/otdf-python/src/otdf_python/policy_binding_serializer.py +++ b/packages/otdf-python/src/otdf_python/policy_binding_serializer.py @@ -18,6 +18,7 @@ def __init__(self, **kwargs): class PolicyBindingSerializer: """Handles serialization and deserialization of policy bindings. + This class provides static methods to convert between JSON representations and PolicyBinding objects. """ diff --git a/packages/otdf-python/src/otdf_python/sdk.py b/packages/otdf-python/src/otdf_python/sdk.py index d3476c62..9945f3ab 100644 --- a/packages/otdf-python/src/otdf_python/sdk.py +++ b/packages/otdf-python/src/otdf_python/sdk.py @@ -15,6 +15,7 @@ class KAS(AbstractContextManager): def get_public_key(self, kas_info: Any) -> Any: """Retrieve the public key from KAS for RSA operations. + If the public key is cached, returns the cached value. Otherwise, makes a request to the KAS. @@ -217,6 +218,7 @@ class Services(AbstractContextManager): def kas(self) -> KAS: """Return the KAS client for key access operations. + This should be implemented to return an instance of KAS. """ raise NotImplementedError diff --git a/packages/otdf-python/src/otdf_python/tdf_reader.py b/packages/otdf-python/src/otdf_python/tdf_reader.py index db884fd4..7c85ffb3 100644 --- a/packages/otdf-python/src/otdf_python/tdf_reader.py +++ b/packages/otdf-python/src/otdf_python/tdf_reader.py @@ -12,6 +12,7 @@ class TDFReader: """TDFReader is responsible for reading and processing Trusted Data Format (TDF) files. + The class initializes with a TDF file channel, extracts the manifest and payload entries, and provides methods to retrieve the manifest content, read payload bytes, and read policy objects. """ diff --git a/pyproject.toml b/pyproject.toml index f02b78b2..ab8fe132 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,8 +48,7 @@ extend-exclude = ["packages/otdf-python-proto/src/"] "tests/**" = ["D100", "D101", "D102", "D103", "D107", "D400", "D401", "D415"] "packages/otdf-python-proto/**" = ["D"] # Ignore all D (docstring) rules for generated proto files -# TODO: Remaining work - 4 buckets to fix (140 errors remaining): +# TODO: Remaining work # Bucket #1: D102 (missing method docstrings) - 98 errors # Bucket #2: D105 (missing magic method docstrings) - 23 errors -# Bucket #3: D205 (blank line formatting), D103, D417, D104 - 19 errors -"packages/otdf-python/src/**" = ["D102", "D105", "D205"] +"packages/otdf-python/src/**" = ["D102", "D105"]