Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opentdf/java-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1fc73e5688987136d7fba37acd4ce76bb940f256
Choose a base ref
..
head repository: opentdf/java-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 178e3cd9ad0b1e0a019cd9aedb40fab5fd8b80f8
Choose a head ref
Showing with 57 additions and 34 deletions.
  1. +13 −18 README.md
  2. +40 −12 pom.xml
  3. +4 −4 sdk/pom.xml
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# java-sdk
# OpenTDF Java SDK

This repository provides the OpenTDF Java SDK.
It will be available from maven central as:
A Java implementation of the OpenTDF protocol, and access library for the services provided by the OpenTDF platform.
This SDK is available from Maven central as:

```xml
<dependency>
<groupId>io.opentdf/platform</groupId>
<artifactId>sdk</artifactId>
</dependency>
```
### Additional Maven Modules
- cmdline: Command line utility



## SDK Usage

### TDF File Creation and Reading
## Quick Start Example

```java
import io.opentdf.platform.sdk.Config;
@@ -48,7 +46,8 @@ public class Example {

### Cryptography Library

The SDK uses the [Bouncy Castle Security library](https://www.bouncycastle.org/). SDK users may need to register the Bouncy Castle Provider; e.g.:
This SDK uses the [Bouncy Castle Security library](https://www.bouncycastle.org/) library.
Note: When using this SDK, it may be necessary to register the Bouncy Castle Provider as follows:

```java
static{
@@ -58,23 +57,19 @@ The SDK uses the [Bouncy Castle Security library](https://www.bouncycastle.org/)

### Logging

We use [slf4j](https://www.slf4j.org/), without providing a backend. We use log4j2 in our tests.
The Java SDK makes use of the [slf4j](https://www.slf4j.org/) library, without providing a backend. log4j2 in leveraged within the included automated tests.

### SSL - Untrusted Certificates

Use the SDKBuilder.withSSL... methods to build an SDKBuilder with:
Leverage the SDKBuilder.withSSL methods to create an SDKBuilder as follows:

- An SSLFactory: ```sdkBuilder.sslFactory(mySSLFactory)```
- Directory containing trusted certificates: ```sdkBuilder.sslFactoryFromDirectory(myDirectoryWithCerts)```
- Java Keystore: ```sdkBuilder.sslFactoryFromKeyStore(keystorepath, keystorePassword)```

### Maven Modules
- cmdline: Command line utility
- sdk: The OpenTDF Java SDK

### Buf

Create an account, link with GitHub, under User setting, Create a `token`
Create an account, link that account with GitHub and then under User settings create a `token`

```shell
[INFO] --- antrun:3.1.0:run (generateSources) @ sdk ---
@@ -96,5 +91,5 @@ mvn versions:set -DnewVersion=1.2.3-SNAPSHOT

### RELEASE

Releases are from tags created by GitHub Release process.
Release Please trigger the release process.
Releases are from tags created by the GitHub release process.
Enter 'Release Please' to trigger the release process.
52 changes: 40 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<log4j.version>2.20.0</log4j.version>
<grpc.version>1.63.0</grpc.version>
<grpc.version>1.68.0</grpc.version>
<protobuf.version>3.25.3</protobuf.version>
<sslcontext.version>8.3.5</sslcontext.version>
</properties>
@@ -110,6 +110,36 @@
<version>${grpc.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<version>2.28.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-android</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.25.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.9.23</version>
</dependency>
</dependencies>
</dependencyManagement>

@@ -156,18 +186,16 @@
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<failFast>false</failFast>
<rules>
<dependencyConvergence/>
<requireUpperBoundDeps/>
<requireSameVersions/>
<banDuplicatePomDependencyVersions/>
</rules>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</pluginManagement>
@@ -195,7 +223,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<inherited>false</inherited>
<inherited>true</inherited>
<configuration>
<failFast>false</failFast>
<rules>
8 changes: 4 additions & 4 deletions sdk/pom.xml
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
@@ -123,7 +123,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -239,14 +239,14 @@
<configuration>
<target>
<!-- Generate OpenTDF Platform Protobuf -->
<exec executable="buf" dir=".">
<exec executable="buf" dir="." failOnError="true">
<arg value="generate"/>
<arg value="https://github.com/opentdf/platform.git#branch=main,subdir=service"/>
<arg value="-o"/>
<arg value="target/generated-sources"/>
</exec>
<!-- Generate gRPC Protobuf -->
<exec executable="buf" dir=".">
<exec executable="buf" dir="." failOnError="true">
<arg value="generate"/>
<arg value="buf.build/grpc-ecosystem/grpc-gateway"/>
<arg value="-o"/>