Skip to content

feat(sdk): add nanotdf plaintext policy #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 27, 2025

Conversation

sujankota
Copy link
Contributor

  • Updated NanoTDF and Config to support EMBEDDED_POLICY_PLAIN_TEXT and EMBEDDED_POLICY_ENCRYPTED policy types
  • Enabled encryption and decryption workflows for both policy configurations
  • Ensured compatibility and configurability via Config.withPolicyType

@sujankota sujankota requested review from a team as code owners May 21, 2025 20:13
@strantalis
Copy link
Member

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively introduces support for EMBEDDED_POLICY_PLAIN_TEXT and EMBEDDED_POLICY_ENCRYPTED policy types in NanoTDF, enhancing its flexibility. The changes are well-structured, and the inclusion of new tests for these policy types is commendable.

I've identified a couple of areas for improvement primarily related to code clarity, minor efficiency, and error reporting, which are detailed in the comments below. Addressing these would further strengthen the codebase.

Summary of Findings

  • Code Optimization in Policy Handling: In NanoTDF.java (lines 120-132), the policyObjectAsStr.getBytes() call is duplicated, and AesGcm is initialized unconditionally even when not needed for plaintext policies. Refactoring this can improve efficiency and readability.
  • Error Message Clarity: The error message for unsupported policy types in NanoTDF.java (line 172) is generic. Making it more specific by including the problematic policy type would improve debuggability.

Merge Readiness

The pull request is well on its way to being mergeable. The core functionality is implemented and tested. However, I recommend addressing the medium severity comments regarding code optimization and error message clarity to enhance the overall quality and maintainability of the code. Once these suggestions are considered, the PR should be in excellent shape. As an AI assistant, I am not authorized to approve pull requests; please ensure further review and approval by authorized team members before merging.

Copy link

@mkleene mkleene merged commit be9cd94 into main May 27, 2025
10 checks passed
@mkleene mkleene deleted the feat/nanotdf-plaint-text-policy-support branch May 27, 2025 16:57
mkleene pushed a commit that referenced this pull request May 27, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>0.8.0</summary>

## [0.8.0](v0.7.9...v0.8.0)
(2025-05-27)


### ⚠ BREAKING CHANGES

* **sdk:** better control which classes we expose
([#254](#254))
* **sdk:** expose method to build an http client
([#256](#256))
* **sdk:** switch to `connect-rpc` for GRPC
([#244](#244))
* **sdk:** DSPX-1037 update sdk api
([#249](#249))

### Features

* Add initial Dependency Review configuration
([#252](#252))
([ba11d49](ba11d49))
* **sdk:** add nanotdf plaintext policy
([#259](#259))
([be9cd94](be9cd94))
* **sdk:** better control which classes we expose
([#254](#254))
([e00eeaf](e00eeaf))
* **sdk:** DSPX-1037 update sdk api
([#249](#249))
([f2e1307](f2e1307))
* **sdk:** expose method to build an http client
([#256](#256))
([2cac97c](2cac97c))
* **sdk:** switch to `connect-rpc` for GRPC
([#244](#244))
([ff36a1d](ff36a1d))


### Bug Fixes

* **sdk:** add coverage
([#258](#258))
([e6ad1bc](e6ad1bc))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants