Fit-Connect .NET SDK
!! IN DEVELOPMENT NOT FOR PRODUCTION USE !!
Fit-Connect .NET SDK is a .NET library for the Fit-Connect API.
For information how to use the SDK and FitConnect visit:
Structure
classDiagram
class FitConnectClient{
FitConnectApiService
}
class FitConnectApiService{
CasesService
DestinationService
InfoService
OAuthService
RouteService
}
FitConnectClient ..> SubmissionSender : public
FitConnectClient ..> SubmissionSubscriber : public
SubmissionSender --|> FunctionalBaseClass
SubmissionSubscriber --|> FunctionalBaseClass
FunctionalBaseClass ..> FitConnectApiService : protected
FitConnectApiService ..> RouteService : public
FitConnectApiService ..> CasesService : public
FitConnectApiService ..> DestinationService : public
FitConnectApiService ..> InfoService : public
FitConnectApiService ..> OAuthService : public
RouteService --|> RestCallService : Inheritance
CasesService --|> RestCallService : Inheritance
DestinationService --|> RestCallService : Inheritance
InfoService --|> RestCallService : Inheritance
OAuthService --|> RestCallService : Inheritance
With that structure the user of the SDK is intended to see the following: (For easier reading all methods are shown sync)
classDiagram
class FitConnectClient {
<< Draft >>
- Sender
- Subscriber
+ SendSumission(submission)
+ GetSubmissions(offset, limit)
+ GetSubmission(id)
}
class Sender {
<< Draft >>
+ bool CheckPublicKey(string publicKey)
+ bool CheckPublicKey(byte[] publicKey)
+ string EncryptData(string? data)
+ string EncryptAttachment(byte[] attachment)
+ string CreateMetadata(string data, byte[] attachment) ???
* Pruefung von oeffentlichen Schluesseln und Zertifikatsketten + OCSP-Check
* Verschluesselung von Fachdaten [JSON, XML] mittels JWE
* Verschluesselung von Anhängen [Binaerdaten] mittels JWE
* Korrekte Erzeugung eines Metadatensatzes inkl. Hashwerte
}
class Subscriber {
<< Draft >>
+ byte[] DecryptAttachment(string attachment)
+ SecurityEventToken CreateSecurityEventToken(string data, string attachment, string privateKey)
+ bool CheckMetadata(string metaData)
+ string DecryptData(string data)
+ bool CheckHash(string metaData, string hash)
* Entschluesselung von Fachdaten [JSON oder XML] mittels JWE
* Entschluesselung von Anhaengen [Binaerdaten] mittels JWE
* Pruefung der empfangenen Metadaten gegen das zugehörige JSON-Schema
* Pruefung der Hashwerte aus dem Metadatensatz.
* SET-Erstellung inkl. Signaturerzeugung
}
class FunctionalBaseClass{
+ GetOAuthTokenAsync(string clientId, string clientSecret, string? scope)
+ SecurityEventToken GetSetData()
* SET-Empfang inkl. Signaturpruefung
* Unterstuezung / Abstraktion der API-Nutzung
* Abruf des OAuth-Tokens
}
FitConnectClient <--> Sender
FitConnectClient <--> Subscriber
Sender --|> FunctionalBaseClass
Subscriber --|> FunctionalBaseClass
Annotation
The structure ensures a abstraction of the API calls for the user and a 'simple' way to change the API calls if a new version of the API is released. Currently the API call is not versioned and hard coded.
Abstractions for API calls
- The use of a dependency injection can be added to inject the API calls into the SDK. But is not yet implemented.
- Another approach would be using a generic class for the API calls.
Ignored Files
The files listed below are ignored and necessary just for development. In production the information is provided by the user of the SDK.
You need a secret file for e2e test like:
{
"sender": {
"id": "00000000-0000-0000-0000-000000000000",
"secret": "0000000000000000000000000000000000000000000",
"scope": "send:region:DE"
}
}
API Abstraction
Warning: Displaying this diagram might cause performance issues on this page.
sequenceDiagram
Client->>FitConnectServer: SendSubmission
FitConnectServer->>Client: Success
The sender process
Warning: Displaying this diagram might cause performance issues on this page.
sequenceDiagram
Sender->>FitConnectServer: GetSubmissions
FitConnectServer->>Sender: Success