Skip to content
Snippets Groups Projects
Commit dce6c6e5 authored by Martin Vogel's avatar Martin Vogel
Browse files

chore(#664): update readme

parent f4d9edf3
No related branches found
No related tags found
1 merge request!211#664 Test JWK Generator
...@@ -5,24 +5,21 @@ The sdk provides a commandline-client as a runnable .jar, to be able to use the ...@@ -5,24 +5,21 @@ The sdk provides a commandline-client as a runnable .jar, to be able to use the
#### Setup & Build #### Setup & Build
1. Build project root wih ``./mvnw clean package`` 1. Build project root wih ``./mvnw clean package``
2. Go to client/target and find a runnable jar ``fit-connect-client.jar`` 2. Go to client/target and find a runnable jar ``fit-connect-cli.jar``
3. Provide [config yaml](../config.yml): 3. Provide [config yaml](../config.yml):
1. set environment variable ``FIT_CONNECT_CONFIG``: * a) set environment variable **FIT_CONNECT_CONFIG** or
1. Linux/MacOS: ``export FIT_CONNECT_CONFIG=path/to/config.yml`` * b) put ``config.yml`` in same path as the .jar-file
2. Windows: ``set FIT_CONNECT_CONFIG=C:\Path\To\config.yml`` 4. run client with ``java -jarfit-connect-cli.jar [COMMAND] [OPTIONS]``
2. Initialize client via ApplicationConfigLoader:
````java > **Setting Env-Variables:** <br>
var config = ApplicationConfigLoader.loadConfig("absolute/path/to/config.yml"); Linux/MacOS: ``export FIT_CONNECT_CONFIG=path/to/config.yml`` <br>
var senderClient = ClientFactory.senderClient(config); Windows: ``set FIT_CONNECT_CONFIG=C:\Path\To\config.yml``
````
3. put ``config.yml`` in same path as the .jar-file
5. run client with ``java -jarfit-connect-client.jar [COMMAND] [OPTIONS]``
#### SEND Single Submission Example #### SEND Single Submission Example
The send command submits a new submission to a destination. Apart from optional attachments, all options are mandatory. The send command submits a new submission to a destination. Apart from optional attachments, all options are mandatory.
````sh ````sh
java -jar fit-connect-client.jar send java -jar fit-connect-cli.jar send
--destinationId=1b7d1a24-a6c8-4050-bb71-ae3749ec432f --destinationId=1b7d1a24-a6c8-4050-bb71-ae3749ec432f
--serviceName=Test --serviceName=Test
--leikaKey=urn:de:fim:leika:leistung:99400048079000 --leikaKey=urn:de:fim:leika:leistung:99400048079000
...@@ -35,7 +32,7 @@ java -jar fit-connect-client.jar send ...@@ -35,7 +32,7 @@ java -jar fit-connect-client.jar send
#### LIST Submissions Example #### LIST Submissions Example
The list command lists all submissionIds for a given destinationID. The list command lists all submissionIds for a given destinationID.
````sh ````sh
java -jar fit-connect-client.jar list --destinationID=1b7d1a24-a6c8-4050-bb71-ae3749ec432f java -jar fit-connect-cli.jar list --destinationID=1b7d1a24-a6c8-4050-bb71-ae3749ec432f
```` ````
#### GET Single Submission Example #### GET Single Submission Example
The get command loads a submission by `submissionId` and stores data and attachments in the given target location. If no target is The get command loads a submission by `submissionId` and stores data and attachments in the given target location. If no target is
...@@ -43,13 +40,13 @@ set, the cmd-client saves the data into in a folder named by the `submissionId` ...@@ -43,13 +40,13 @@ set, the cmd-client saves the data into in a folder named by the `submissionId`
jar. jar.
````sh ````sh
java -jar fit-connect-client.jar get --submissionID=cc9b9b3c-d4b1-4ac7-a70b-e7ca76e88608 --target=Users/submissions/data java -jar fit-connect-cli.jar get --submissionID=cc9b9b3c-d4b1-4ac7-a70b-e7ca76e88608 --target=Users/submissions/data
```` ````
#### Batch Mode #### Batch Mode
To send multiple submission with a single command, the client can be used in batch mode: To send multiple submission with a single command, the client can be used in batch mode:
````sh ````sh
java -jar fit-connect-client.jar batch --data=batch_data.csv java -jar fit-connect-cli.jar batch --data=batch_data.csv
```` ````
Currently, the import of CSV is supported. Follow the schema below, setting up your data: Currently, the import of CSV is supported. Follow the schema below, setting up your data:
...@@ -60,11 +57,26 @@ destinationId, serviceName, leikaKey, data, dataType, attachments ...@@ -60,11 +57,26 @@ destinationId, serviceName, leikaKey, data, dataType, attachments
1b7d1a24-a6c8-4050-bb71-ae3749ec432d, Test2, "urn:de:fim:leika:leistung:99400048079000", /path/to/data/data2.xml, "XML", "path/to/attachment/report.pdf" 1b7d1a24-a6c8-4050-bb71-ae3749ec432d, Test2, "urn:de:fim:leika:leistung:99400048079000", /path/to/data/data2.xml, "XML", "path/to/attachment/report.pdf"
```` ````
> Windows paths: escape windows paths with `\\`, e.g. `C:\\path\\to\\file\\file.txt` ! > Windows paths: escape windows paths with `\\`, e.g. `C:\\path\\to\\file\\file.txt` !
>
#### Generate JWK Test Keys
The CLI can generate public and private keys for testing purposes for both encryption and signing.
If no ``outDir`` ist specified, the cli will create a temporary folder that is logged in the console output.
````sh
java -jar fit-connect-cli.jar keygen --outDir=C:\temp
````
```
[main] INFO d.f.fitconnect.cli.CommandExecutor Generating JWKs ...
[main] INFO d.f.fitconnect.cli.keygen.KeyWriter Writing keys to directory C:\temp
[main] INFO d.f.fitconnect.cli.keygen.KeyWriter Wrote Encryption Public Key (key_use=wrapKey) as publicKey_encryption.json
[main] INFO d.f.fitconnect.cli.keygen.KeyWriter Wrote Decryption Private Key (key_use=unwrapKey) as privateKey_decryption.json
[main] INFO d.f.fitconnect.cli.keygen.KeyWriter Wrote Signature Verification Public Key (key_use=verify) as publicKey_signature_verification.json
[main] INFO d.f.fitconnect.cli.keygen.KeyWriter Wrote Signing Private Key (key_use=sign) as privateKey_signing.json
```
#### Usage And Commands #### Usage And Commands
````shell ````shell
Usage: <main class> [command] [command options]
Commands: Commands:
send Send a submission send Send a submission
Usage: send [options] Usage: send [options]
...@@ -81,6 +93,8 @@ Usage: <main class> [command] [command options] ...@@ -81,6 +93,8 @@ Usage: <main class> [command] [command options]
Unique destination identifier in UUID format Unique destination identifier in UUID format
* --leikaKey * --leikaKey
The LeikaKey of the service type The LeikaKey of the service type
* --schemaUri
Schema URI to validate submission data
* --serviceName * --serviceName
Name of the service type Name of the service type
...@@ -111,4 +125,15 @@ Usage: <main class> [command] [command options] ...@@ -111,4 +125,15 @@ Usage: <main class> [command] [command options]
Options: Options:
* --data * --data
Path to submission data as csv Path to submission data as csv
keygen Generates JWK test keys for encryption, decryption, signing
and signature validation
Usage: keygen [options]
Options:
--outDir
Output directory folder where the generated test keys are written
to
--withConfig
Generates config.yaml with paths of the generated keys
Default: false
```` ````
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment