Skip to content

Commit 8f27043

Browse files
committed
Merge branch 'lts-workflows8' of github.com:opentdf/java-sdk into lts-workflows8
2 parents fb91590 + 5c234e3 commit 8f27043

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+416
-372
lines changed

.github/workflows/checks.yaml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -62,47 +62,24 @@ jobs:
6262
- uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
6363
with:
6464
github_token: ${{ secrets.GITHUB_TOKEN }}
65-
- name: Set up JDK
66-
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
67-
with:
68-
java-version: "11"
69-
distribution: "adopt"
70-
server-id: github
71-
- name: Maven Verify
72-
run: mvn --batch-mode verify
73-
env:
74-
BUF_INPUT_HTTPS_USERNAME: opentdf-bot
75-
BUF_INPUT_HTTPS_PASSWORD: ${{ secrets.PERSONAL_ACCESS_TOKEN_OPENTDF }}
76-
77-
sonarcloud:
78-
name: SonarCloud Scan
79-
runs-on: ubuntu-22.04
80-
steps:
81-
- name: Check out repository
82-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83-
with:
84-
fetch-depth: 0
85-
- uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
65+
- name: Cache Maven packages
66+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
8667
with:
87-
github_token: ${{ secrets.GITHUB_TOKEN }}
68+
path: ~/.m2
69+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
70+
restore-keys: ${{ runner.os }}-m2
8871
- name: Set up JDK
8972
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
9073
with:
9174
java-version: "17"
92-
distribution: "temurin"
75+
distribution: "adopt"
9376
server-id: github
9477
- name: Cache SonarCloud packages
9578
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
9679
with:
9780
path: ~/.sonar/cache
9881
key: ${{ runner.os }}-sonar
9982
restore-keys: ${{ runner.os }}-sonar
100-
- name: Cache Maven packages
101-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
102-
with:
103-
path: ~/.m2
104-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
105-
restore-keys: ${{ runner.os }}-m2
10683
- name: Maven Test Coverage
10784
env:
10885
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -122,7 +99,7 @@ jobs:
12299
- name: Set up JDK
123100
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
124101
with:
125-
java-version: "11"
102+
java-version: "17"
126103
distribution: "adopt"
127104
server-id: github
128105
- name: Build java SDK
@@ -345,7 +322,6 @@ jobs:
345322
- platform-integration
346323
- platform-xtest
347324
- mavenverify
348-
- sonarcloud
349325
- pr
350326
runs-on: ubuntu-latest
351327
if: always()

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.7.9"
2+
".": "0.8.1"
33
}

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## [0.8.1](https://github.com/opentdf/java-sdk/compare/v0.8.0...v0.8.1) (2025-05-29)
4+
5+
6+
### Bug Fixes
7+
8+
* **ci:** use `dokka-maven-plugin` instead of `javadoc-maven-plugin` ([#262](https://github.com/opentdf/java-sdk/issues/262)) ([ab1e7b1](https://github.com/opentdf/java-sdk/commit/ab1e7b1505d1875768bf99f1217ff2dcca1bacea))
9+
10+
## [0.8.0](https://github.com/opentdf/java-sdk/compare/v0.7.9...v0.8.0) (2025-05-27)
11+
12+
13+
### ⚠ BREAKING CHANGES
14+
15+
* **sdk:** better control which classes we expose ([#254](https://github.com/opentdf/java-sdk/issues/254))
16+
* **sdk:** expose method to build an http client ([#256](https://github.com/opentdf/java-sdk/issues/256))
17+
* **sdk:** switch to `connect-rpc` for GRPC ([#244](https://github.com/opentdf/java-sdk/issues/244))
18+
* **sdk:** DSPX-1037 update sdk api ([#249](https://github.com/opentdf/java-sdk/issues/249))
19+
20+
### Features
21+
22+
* Add initial Dependency Review configuration ([#252](https://github.com/opentdf/java-sdk/issues/252)) ([ba11d49](https://github.com/opentdf/java-sdk/commit/ba11d4924d50ef33539a879818a1e9f53ced47a4))
23+
* **sdk:** add nanotdf plaintext policy ([#259](https://github.com/opentdf/java-sdk/issues/259)) ([be9cd94](https://github.com/opentdf/java-sdk/commit/be9cd94ba544f91289d64cfc2c7a1014bdfa1cb2))
24+
* **sdk:** better control which classes we expose ([#254](https://github.com/opentdf/java-sdk/issues/254)) ([e00eeaf](https://github.com/opentdf/java-sdk/commit/e00eeaf9768caaa793717b0ea3045cfa3c73debe))
25+
* **sdk:** DSPX-1037 update sdk api ([#249](https://github.com/opentdf/java-sdk/issues/249)) ([f2e1307](https://github.com/opentdf/java-sdk/commit/f2e1307ec7ed23289f32ddf620ab39692256c2c0))
26+
* **sdk:** expose method to build an http client ([#256](https://github.com/opentdf/java-sdk/issues/256)) ([2cac97c](https://github.com/opentdf/java-sdk/commit/2cac97cfdfdbcded64e0e205f968fca523dda4e8))
27+
* **sdk:** switch to `connect-rpc` for GRPC ([#244](https://github.com/opentdf/java-sdk/issues/244)) ([ff36a1d](https://github.com/opentdf/java-sdk/commit/ff36a1d90f7f2fdf876b892001c8c8d32425db09))
28+
29+
30+
### Bug Fixes
31+
32+
* **sdk:** add coverage ([#258](https://github.com/opentdf/java-sdk/issues/258)) ([e6ad1bc](https://github.com/opentdf/java-sdk/commit/e6ad1bcf750b7daed8d81c2e82bbca984f07009a))
33+
334
## [0.7.9](https://github.com/opentdf/java-sdk/compare/v0.7.8...v0.7.9) (2025-04-28)
435

536

README.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,41 @@ This SDK is available from Maven central as:
1515
## Quick Start Example
1616

1717
```java
18+
package io.opentdf.platform;
19+
1820
import io.opentdf.platform.sdk.Config;
21+
import io.opentdf.platform.sdk.Reader;
1922
import io.opentdf.platform.sdk.SDK;
2023
import io.opentdf.platform.sdk.SDKBuilder;
21-
import io.opentdf.platform.sdk.abac.Policy;
24+
25+
import java.io.IOException;
2226
import java.io.InputStream;
2327
import java.io.FileInputStream;
28+
import java.nio.channels.FileChannel;
29+
import java.nio.channels.SeekableByteChannel;
30+
import java.nio.file.Path;
31+
import java.nio.file.StandardOpenOption;
2432

2533
public class Example {
26-
public static void main(String[] args) {
27-
SDK sdk =
28-
new SDKBuilder
29-
.clientSecret("myClient", "token")
30-
.platformEndpoint("https://your.cluster/")
31-
.build();
32-
// Encrypt a file
33-
try (InputStream in = new FileInputStream("input.plaintext")) {
34-
Config c = Config.newTDFConfig(Config.withDataAttributes("attr1", "attr2"));
35-
new TDF().createTDF(in, System.out, tdfConfig, sdk.getServices().kas());
36-
}
37-
38-
// Decrypt a file
39-
try (SeekableByteChannel in =
40-
FileChannel.open("input.ciphertext", StandardOpenOption.READ)) {
41-
TDF.Reader reader = new TDF().loadTDF(in, sdk.getServices().kas(), sdk.getServices().kasRegistry(), sdk.getPlatformUrl());
42-
reader.readPayload(System.out);
34+
public static void main(String[] args) throws IOException {
35+
SDK sdk = new SDKBuilder()
36+
.clientSecret("myClient", "token")
37+
.platformEndpoint("https://your.cluster/")
38+
.build();
39+
40+
// Encrypt a file
41+
try (InputStream in = new FileInputStream("input.plaintext")) {
42+
Config.TDFConfig c = Config.newTDFConfig(Config.withDataAttributes("attr1", "attr2"));
43+
sdk.createTDF(in, System.out, c);
44+
}
45+
46+
// Decrypt a file
47+
try (SeekableByteChannel in = FileChannel.open(Path.of("input.ciphertext"), StandardOpenOption.READ)) {
48+
Reader reader = sdk.loadTDF(in, Config.newTDFReaderConfig());
49+
reader.readPayload(System.out);
50+
}
4351
}
44-
}}
52+
}
4553
```
4654

4755
### Cryptography Library
@@ -50,7 +58,7 @@ This SDK uses the [Bouncy Castle Security library](https://www.bouncycastle.org/
5058
Note: When using this SDK, it may be necessary to register the Bouncy Castle Provider as follows:
5159

5260
```java
53-
static{
61+
static {
5462
Security.addProvider(new BouncyCastleProvider());
5563
}
5664
```

cmdline/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>io.opentdf.platform</groupId>
66
<artifactId>sdk-pom</artifactId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.8.2-SNAPSHOT</version>
88
</parent>
99
<artifactId>cmdline</artifactId>
1010
<properties>

cmdline/src/main/java/io/opentdf/platform/Command.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.opentdf.platform.sdk.Config.AssertionVerificationKeys;
1111
import io.opentdf.platform.sdk.SDK;
1212
import io.opentdf.platform.sdk.SDKBuilder;
13-
import io.opentdf.platform.sdk.TDF;
1413
import nl.altindag.ssl.SSLFactory;
1514
import org.apache.commons.codec.DecoderException;
1615
import picocli.CommandLine;
@@ -23,7 +22,6 @@
2322
import java.io.FileInputStream;
2423
import java.io.IOException;
2524
import java.io.PrintWriter;
26-
import java.net.URISyntaxException;
2725
import java.nio.ByteBuffer;
2826
import java.nio.channels.FileChannel;
2927
import java.nio.charset.StandardCharsets;
@@ -36,7 +34,6 @@
3634
import java.security.spec.InvalidKeySpecException;
3735
import java.security.spec.PKCS8EncodedKeySpec;
3836
import java.security.spec.X509EncodedKeySpec;
39-
import java.text.ParseException;
4037
import java.util.ArrayList;
4138
import java.util.Base64;
4239
import java.util.List;
@@ -51,7 +48,7 @@
5148
*/
5249
class Versions {
5350
// Version of the SDK, managed by release-please.
54-
public static final String SDK = "0.7.10-SNAPSHOT"; // x-release-please-version
51+
public static final String SDK = "0.8.2-SNAPSHOT"; // x-release-please-version
5552

5653
// This sdk aims to support this version of the TDF spec; currently 4.3.0.
5754
public static final String TDF_SPEC = "4.3.0";
@@ -165,7 +162,7 @@ void encrypt(
165162
@Option(names = { "--with-assertions" }, defaultValue = Option.NULL_VALUE) Optional<String> assertion,
166163
@Option(names = { "--with-target-mode" }, defaultValue = Option.NULL_VALUE) Optional<String> targetMode)
167164

168-
throws IOException, JOSEException, AutoConfigureException, InterruptedException, ExecutionException, DecoderException {
165+
throws IOException, AutoConfigureException {
169166

170167
var sdk = buildSDK();
171168
var kasInfos = kas.stream().map(k -> {
@@ -300,8 +297,7 @@ void decrypt(@Option(names = { "-f", "--file" }, required = true) Path tdfPath,
300297
@CommandLine.Command(name = "metadata")
301298
void readMetadata(@Option(names = { "-f", "--file" }, required = true) Path tdfPath,
302299
@Option(names = { "--kas-allowlist" }, defaultValue = Option.NULL_VALUE) Optional<String> kasAllowlistStr,
303-
@Option(names = { "--ignore-kas-allowlist" }, defaultValue = Option.NULL_VALUE) Optional<Boolean> ignoreAllowlist) throws IOException,
304-
TDF.FailedToCreateGMAC, JOSEException, NoSuchAlgorithmException, ParseException, DecoderException, InterruptedException, ExecutionException, URISyntaxException {
300+
@Option(names = { "--ignore-kas-allowlist" }, defaultValue = Option.NULL_VALUE) Optional<Boolean> ignoreAllowlist) throws IOException {
305301
var sdk = buildSDK();
306302
var opts = new ArrayList<Consumer<Config.TDFReaderConfig>>();
307303
try (var in = FileChannel.open(tdfPath, StandardOpenOption.READ)) {

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>sdk-pom</artifactId>
66
<groupId>io.opentdf.platform</groupId>
7-
<version>0.7.10-SNAPSHOT</version>
7+
<version>0.8.2-SNAPSHOT</version>
88
</parent>
99

1010
<groupId>io.opentdf.platform</groupId>

examples/src/main/java/io/opentdf/platform/App.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/src/main/java/io/opentdf/platform/CreateAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.util.Arrays;
1313

1414
public class CreateAttribute {
15-
public static void main(String[] args) throws ExecutionException, InterruptedException{
15+
public static void main(String[] args) {
1616

1717
String clientId = "opentdf";
1818
String clientSecret = "secret";

examples/src/main/java/io/opentdf/platform/CreateNamespace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.concurrent.ExecutionException;
99

1010
public class CreateNamespace {
11-
public static void main(String[] args) throws ExecutionException, InterruptedException{
11+
public static void main(String[] args) {
1212

1313
String clientId = "opentdf";
1414
String clientSecret = "secret";

0 commit comments

Comments
 (0)