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
4 changes: 2 additions & 2 deletions .github/workflows/platform-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/otdf_python/kas_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions src/otdf_python/nanotdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/otdf_python/tdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion tests/config_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/support_otdfctl_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
Loading