Skip to content

fix(sdk): deserialize object statement values correctly #219

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 10 commits into from
Jan 28, 2025

Conversation

mkleene
Copy link
Contributor

@mkleene mkleene commented Jan 23, 2025

Some SDKs don't set assertion values as objects instead of strings so we set them to string values when we deserialize

Also:

  • encapsulate the gson instance that we use for Manifest deserialization so that we don't have to
    keep setting the options in different places
  • remove the ManifestDeserializer since its purpose is to make the assertions list non-null but since
    we have encapsulated the deserialization we can set it there
  • add a setting to ignore assertions in the cmdline app so that we can do so in xtests

@mkleene mkleene changed the title deserialize null statement values correctly fix(sdk): deserialize null statement values correctly Jan 23, 2025
@mkleene mkleene changed the title fix(sdk): deserialize null statement values correctly fix(sdk): deserialize object statement values correctly Jan 27, 2025
@mkleene mkleene marked this pull request as ready for review January 27, 2025 15:33
@mkleene mkleene requested review from a team as code owners January 27, 2025 15:33
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@mkleene mkleene merged commit c513e8c into main Jan 28, 2025
7 of 8 checks passed
@mkleene mkleene deleted the deserialize-object-statement-values branch January 28, 2025 18:28
mkleene added a commit to opentdf/tests that referenced this pull request Jan 29, 2025
…245)

Filewatcher sets assertion values as JSON objects like
```
"statement": {
  "format": "string",
  "value": {
    "context": {
      "@base": "urn:nato:stanag:5636:A:1:elements:json"
    },
    "ocl": {
      "catl": [
        {
          "name": "Releasable To",
          "type": "P",
          "vals": [
            "usa"
          ]
        }
      ],
      "pol": "2ccf11cb-6c9a-4e49-9746-a7f0a295945d",
      "cls": "SECRET",
      "dcr": "2024-12-17T13:00:52Z"
    }
  }
```
this adds a test that makes sure that all SDKs can properly deserialize such manifests when they
have assertion verification disabled.

In order to make this work we needed to pass through an option that disables assertion verification.

Requires opentdf/platform#1833 and opentdf/java-sdk#219 to be
merged before it will pass

successful run against SDK branches: https://github.com/opentdf/tests/actions/runs/12992325319/job/36231902231
mkleene pushed a commit that referenced this pull request Feb 6, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>0.7.6</summary>

## [0.7.6](v0.7.5...v0.7.6)
(2025-02-06)


### Features

* Add assertion verification
([#216](#216))
([e0f8caf](e0f8caf))
* **cmdline:** assertions cli support
([#204](#204))
([3325114](3325114))
* **sdk:** Add and expose tamper error types
([#187](#187))
([b4f95e6](b4f95e6))
* **sdk:** adds Collections API
([#212](#212))
([1ee1367](1ee1367))


### Bug Fixes

* Correct null assertions when deserializing
([#211](#211))
([b075194](b075194))
* incorrect isStreamable serialized name
([#210](#210))
([32825b0](32825b0))
* NanoTDF secure key from debug logging and iv conflict risk
([#208](#208))
([6301d32](6301d32))
* **sdk:** deserialize object statement values correctly
([#219](#219))
([c513e8c](c513e8c))
* **sdk:** Fuzz testing and protocol fixes
([#214](#214))
([cf6f932](cf6f932))
* **sdk:** group splits with empty/missing split IDs together
([#217](#217))
([0f47702](0f47702))
* **sdk:** remove hex encoding
([#213](#213))
([e076d11](e076d11))
* **sdk:** uses offset for ByteBuffer array offset
([#209](#209))
([0d6e761](0d6e761))
* Use reusable start-additional-kas workflow
([#215](#215))
([cb6f757](cb6f757))
</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.

2 participants