-
Marco Holz authoredMarco Holz authored
- THIS SDK IS IN DEVELOPMENT AND NOT READY FOR PRODUCTION USE YET!!
- About the FIT-Connect Java SDK
- Build Dependencies
- Getting Started
- Prerequisites
- Add FIT-Connect SDK to your build
- Modules
- Setup
- Usage
- Hand in new submission
- Hand in already encrypted submission (e.g. from frontend)
- Retrieve public encryption key
- List all submissions for a destination
- Receive single submission
- Roadmap
- Contact
- License
THIS SDK IS IN DEVELOPMENT AND NOT READY FOR PRODUCTION USE YET!!
About the FIT-Connect Java SDK
The Java SDK for FIT-Connect enables to build clients for senders and subscribers without directly interacting with any REST-Endpoints. It provides a simple fluent API that guides through the creation and sending of a submission, as well as receiving submissions as a subscriber.
For further information, check out the official docs: FIT-Connect Documentation as well as the:
Build Dependencies
This section lists major frameworks/libraries used in the SDK.
- Java 11 (LTS)
- Maven 3.x
- Junit 5
Further 3rd party dependencies:
- Nimbus-Jose JWT
- Spring Web/HTTP
- Jackson FasterXMl
- JCommander
- Snakeyaml
Getting Started
How to set up the SDK project locally.
Prerequisites
- Java Runtime >= 11, check your current setup in your commandline
java --version
Add FIT-Connect SDK to your build
To add a dependency on FIT-Connect using Maven, use the following:
<dependency>
<groupId>dev.fitko.fitconnect.sdk</groupId>
<artifactId>client</artifactId>
<version>[Latest Version]</version>
</dependency>
With [Latest Version]
of the last stable build or snapshot.
Modules
See the projects' module documentation for more specific information:
Setup
The following steps show how to get the SDK running
- Create and account on the self service portal
- Get your sender/subscriber API-key credentials
- Clone the sdk repo
git clone https://git.fitko.de/fit-connect/sdk-java
- Build the project
./mvnw clean install -DskipTests
- Enter your API keys and references to your private decryption key in
config.yml
- Provide config via environment variable
FIT_CONNECT_CONFIG
or load the config withvar config = ApplicationConfigLoader.loadConfig("absolute/path/to/config.yml"); var senderClient = ClientFactory.senderClient(config);
Usage
Hand in new submission
ClientFactory.senderClient(config)
.newSubmission()
.withAttachment(Path.of("path/to/attachment.txt").toFile()) // optional
.withJsonData("{ foo: 'bar'}")
.withDestination(UUID.fromString("destinationId"))
.withServiceType("TestService", "Führerscheinbeantragung", "urn:de:fim:leika:leistung:99400048079000")
.submit();
Hand in already encrypted submission (e.g. from frontend)
ClientFactory.senderClient(config)
.newSubmissionWithEncryptedData("$encrpyt€ed d@t@")
.withEncryptedAttachment(UUID.fromString("attachmentId"), "$encrpyt€ed @tt@chment")
.withEncryptedJsonData("{$encrpyt€ed json}")
.withEncryptedMetadata("$encrpyt€ed metadata")
.withDestination(UUID.fromString("destinationId"))
.withServiceType("TestService", "Führerscheinbeantragung", "urn:de:fim:leika:leistung:99400048079000")
.submit();
Retrieve public encryption key
Optional<String> jweKey = ClientFactory.subscriberClient(config).getPublicKey(UUID.fromString("destinationId"));
List all submissions for a destination
Set<SubmissionForPickup> submissions = ClientFactory.subscriberClient(config).getAvailableSubmissions(UUID.fromString("destinationId"));
Receive single submission
Optional<ReceivedSubmission> submission = ClientFactory.subscriberClient(config).requestSubmission(UUID.fromString("submissionId"));
Roadmap
- Add Routing features
- Add Callback handling
See the open issues for a full list of proposed features (and known issues).
Contact
FIT-Connect Contact Page for further information
License
Source code is licensed under the EUPL.
Rechtlicher Hinweis: Dieses Software Development Kit (SDK) ist dazu bestimmt, die Anbindung einer Software an die FIT-Connect-Infrastruktur zu ermöglichen. Hierfür kann das SDK in die anzubindenden Software integriert werden. Erfolgt die Integration des SDK in unveränderter Form, liegt keine Bearbeitung im Sinne der EUPL bzw. des deutschen Urheberrechts vor. Die Art und Weise der Verlinkung des SDK führt insbesondere nicht zur Schaffung eines abgeleiteten Werkes. Die unveränderte Übernahme des SDK in eine anzubindende Software führt damit nicht dazu, dass die anzubindende Software unter den Bedingungen der EUPL zu lizenzieren ist. Für die Weitergabe des SDK selbst - in unveränderter oder bearbeiteter Form, als Quellcode oder ausführbares Programm - gelten die Lizenzbedingungen der EUPL in unveränderter Weise.