From 02d277e9eccefa0285ac80464406c5db12371404 Mon Sep 17 00:00:00 2001 From: b-long Date: Wed, 4 Feb 2026 20:54:50 -0500 Subject: [PATCH 1/4] fix formatting --- tests/config_pydantic.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/config_pydantic.py b/tests/config_pydantic.py index 10a5d3b..a464ee7 100644 --- a/tests/config_pydantic.py +++ b/tests/config_pydantic.py @@ -54,7 +54,9 @@ class ConfigureTdf(BaseSettings): ) OIDC_OP_TOKEN_ENDPOINT: str = Field( - default_factory=lambda data: f"{data['KEYCLOAK_URL']}realms/opentdf/protocol/openid-connect/token" + default_factory=lambda data: ( + f"{data['KEYCLOAK_URL']}realms/opentdf/protocol/openid-connect/token" + ) ) # NOTE: The following variableis used for OIDC, NPE encryption/decryption, as From 304e90649ba42021544efa104104136924eb21a6 Mon Sep 17 00:00:00 2001 From: b-long Date: Wed, 4 Feb 2026 20:55:49 -0500 Subject: [PATCH 2/4] replacing ternary if expressions with the or operator Fixes 9 FURB10 errors across 4 files --- src/otdf_python/kas_client.py | 2 +- src/otdf_python/nanotdf.py | 10 ++++------ src/otdf_python/tdf.py | 4 ++-- tests/support_otdfctl_args.py | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/otdf_python/kas_client.py b/src/otdf_python/kas_client.py index 61b1a45..b3ffe0d 100644 --- a/src/otdf_python/kas_client.py +++ b/src/otdf_python/kas_client.py @@ -154,7 +154,7 @@ def _handle_existing_scheme(self, parsed) -> str: # Reconstruct URL preserving the path (especially /kas prefix) try: # Create URL preserving the path component for proper endpoint routing - path = parsed.path if parsed.path else "" + path = parsed.path or "" normalized_url = f"{scheme}://{parsed.hostname}:{port}{path}" logging.debug(f"normalized url [{parsed.geturl()}] to [{normalized_url}]") return normalized_url diff --git a/src/otdf_python/nanotdf.py b/src/otdf_python/nanotdf.py index 6a23e25..8f5534e 100644 --- a/src/otdf_python/nanotdf.py +++ b/src/otdf_python/nanotdf.py @@ -70,8 +70,8 @@ def _serialize_policy_object(self, obj): if isinstance(obj, PolicyBody): # Convert data_attributes to dataAttributes and use null instead of empty array result = { - "dataAttributes": obj.data_attributes if obj.data_attributes else None, - "dissem": obj.dissem if obj.dissem else None, + "dataAttributes": obj.data_attributes or None, + "dissem": obj.dissem or None, } return result elif isinstance(obj, AttributeObject): @@ -115,14 +115,12 @@ def _prepare_policy_data(self, config: NanoTDFConfig) -> tuple[bytes, str]: tuple: (policy_body, policy_type) """ - attributes = config.attributes if config.attributes else [] + attributes = config.attributes or [] policy_object = self._create_policy_object(attributes) policy_json = json.dumps( policy_object, default=self._serialize_policy_object ).encode("utf-8") - policy_type = ( - config.policy_type if config.policy_type else "EMBEDDED_POLICY_PLAIN_TEXT" - ) + policy_type = config.policy_type or "EMBEDDED_POLICY_PLAIN_TEXT" if policy_type == "EMBEDDED_POLICY_PLAIN_TEXT": policy_body = policy_json diff --git a/src/otdf_python/tdf.py b/src/otdf_python/tdf.py index dafa246..05d10e4 100644 --- a/src/otdf_python/tdf.py +++ b/src/otdf_python/tdf.py @@ -183,8 +183,8 @@ def _serialize_policy_object(self, obj): if isinstance(obj, PolicyBody): # Convert data_attributes to dataAttributes and use null instead of empty array result = { - "dataAttributes": obj.data_attributes if obj.data_attributes else None, - "dissem": obj.dissem if obj.dissem else None, + "dataAttributes": obj.data_attributes or None, + "dissem": obj.dissem or None, } return result elif isinstance(obj, AttributeObject): diff --git a/tests/support_otdfctl_args.py b/tests/support_otdfctl_args.py index f5dd08e..52f4b6f 100644 --- a/tests/support_otdfctl_args.py +++ b/tests/support_otdfctl_args.py @@ -183,8 +183,8 @@ def _generate_target_mode_tdf( creds_file=creds_file, input_file=input_file, output_file=output_file, - mime_type=mime_type if mime_type else "text/plain", - attributes=attributes if attributes else None, + mime_type=mime_type or "text/plain", + attributes=attributes or None, tdf_type="tdf3", target_mode=target_mode, ) From bb7b78799006b817160e5cddc97c99000bde3c7d Mon Sep 17 00:00:00 2001 From: b-long Date: Wed, 4 Feb 2026 20:57:06 -0500 Subject: [PATCH 3/4] update ruff-pre-commit version to v0.15.0 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5a8d64..9d83045 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.14.8 + rev: v0.15.0 hooks: # Run the linter. - id: ruff-check From 418e3955bbdb21937c15c6f64a3c7a0a5847155a Mon Sep 17 00:00:00 2001 From: b-long Date: Wed, 4 Feb 2026 21:06:43 -0500 Subject: [PATCH 4/4] pin otdfctl and platform - pins otdfctl to v0.28.0 - pins platform to service/v0.8.2 --- .github/workflows/platform-integration-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/platform-integration-test.yaml b/.github/workflows/platform-integration-test.yaml index 6c280c5..3cb75be 100644 --- a/.github/workflows/platform-integration-test.yaml +++ b/.github/workflows/platform-integration-test.yaml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 with: repository: opentdf/platform - ref: main + ref: service/v0.8.2 path: platform - name: Set up go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 @@ -132,7 +132,7 @@ jobs: grpcurl -plaintext localhost:8080 kas.AccessService/PublicKey - name: Install otdfctl - run: go install github.com/opentdf/otdfctl@latest + run: go install github.com/opentdf/otdfctl@v0.28.0 shell: bash - name: Create creds.json for otdfctl