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
6 changes: 5 additions & 1 deletion .release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
"extra-files": [
"pyproject.toml",
"src/otdf_python/cli.py",
"otdf-python-proto/pyproject.toml",
{
"path": "uv.lock",
"type": "toml",
"jsonpath": "$.package[?(@.name.value=='otdf-python')].version"
},
{
"path": "otdf-python-proto/pyproject.toml",
"type": "toml",
"jsonpath": "$.project[?(@.name.value=='otdf-python-proto')].version"
},
{
"path": "otdf-python-proto/uv.lock",
"type": "toml",
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.2"
".": "0.3.1"
}
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Unofficial OpenTDF SDK for Python
- **Flexible Configuration**: Support for various authentication methods and platform endpoints
- **Comprehensive Testing**: Full test suite with unit and integration tests

## Legacy Version

A legacy version (0.2.x) of this project is available for users who need the previous implementation. For more information, see [LEGACY_VERSION.md](docs/LEGACY_VERSION.md) or visit the [legacy branch on GitHub](https://github.com/b-long/opentdf-python-sdk/tree/0.2.x).

## Prerequisites

This project uses [uv](https://docs.astral.sh/uv/) for dependency management and task running.
Expand Down Expand Up @@ -172,30 +176,6 @@ with open("decrypted.txt", "wb") as f:
sdk.close()
```

### NanoTDF Support

```python
from io import BytesIO
from otdf_python.config import NanoTDFConfig

# Create NanoTDF configuration
config = NanoTDFConfig(
attributes=["https://example.com/attr/classification/value/public"],
ecc_mode="ecdsa" # or "gmac"
)

# Encrypt to NanoTDF format
input_data = b"Hello, World!"
output_stream = BytesIO()
size = sdk.create_nano_tdf(BytesIO(input_data), output_stream, config)
encrypted_data = output_stream.getvalue()

# Decrypt NanoTDF
decrypted_stream = BytesIO()
sdk.read_nano_tdf(BytesIO(encrypted_data), decrypted_stream, config)
decrypted_data = decrypted_stream.getvalue()
```

## Project Structure

```
Expand Down
2 changes: 1 addition & 1 deletion docs/LEGACY_VERSION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Legacy Version

The legacy version of this project is available for now using the Github branch: `0.2.x`.
The legacy version of this project is available using the Github branch: `0.2.x`.

You can access it directly via the following link:
https://github.com/b-long/opentdf-python-sdk/tree/0.2.x
Expand Down
2 changes: 1 addition & 1 deletion otdf-python-proto/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "otdf-python-proto"
version = "0.3.2"
version = "0.3.1"
description = "Generated protobuf files for OpenTDF Python SDK"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion otdf-python-proto/src/otdf_python_proto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
and other OpenTDF services.
"""

__version__ = "0.3.2"
__version__ = "0.3.1"

# Import submodules to make them available
from . import authorization
Expand Down
2 changes: 1 addition & 1 deletion otdf-python-proto/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "otdf-python"
version = "0.3.2"
version = "0.3.1"
description = "Unofficial OpenTDF SDK for Python"
readme = "README.md"
authors = [
Expand Down
17 changes: 2 additions & 15 deletions src/otdf_python/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from otdf_python.tdf import TDFReaderConfig

# Version - get from project metadata
__version__ = "0.3.2"
__version__ = "0.3.1"


# Set up logging
Expand Down Expand Up @@ -355,21 +355,8 @@ def cmd_inspect(args):
# Validate input file
input_path = validate_file_exists(args.file)

# For inspection, try to create authenticated SDK, but allow unauthenticated inspection too
try:
try:
sdk = build_sdk(args)
except CLIError as auth_error:
# If authentication fails, create minimal SDK for basic inspection
logger.warning(f"Authentication failed, using minimal SDK: {auth_error}")
builder = SDKBuilder()
if args.platform_url:
builder.set_platform_endpoint(args.platform_url)
if hasattr(args, "plaintext") and args.plaintext:
builder.use_insecure_plaintext_connection(True)
if args.insecure:
builder.use_insecure_skip_verify(True)
sdk = builder.build()
Comment on lines 358 to -372
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change removes the logic for creating a 'minimal' SDK for unauthenticated inspection, which appears to be a functional regression. Previously, it was possible to inspect a TDF's manifest without providing authentication credentials, as the code would fall back to a minimal SDK capable of parsing the TDF structure. With this change, any authentication failure during SDK building results in a very basic inspection that only reports file type and size, losing the valuable ability to view the manifest without full credentials. If retaining unauthenticated manifest inspection is desired, the previous logic should be restored, possibly in a more robust implementation.

sdk = build_sdk(args)

try:
# Read encrypted file
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading