115 lines
2.1 KiB
Markdown
115 lines
2.1 KiB
Markdown
# LicServer API Spezifikation (v1)
|
|
|
|
Dokumentation der REST-Schnittstellen des CASPOS Lizenzservers (`http://192.168.178.174:9981`).
|
|
|
|
## 1. Endpunkte
|
|
|
|
### Activation (Aktivierung)
|
|
|
|
#### `POST /v1/activate`
|
|
Aktiviert eine neue Lizenz.
|
|
|
|
**Request Body (`application/json`):**
|
|
```json
|
|
{
|
|
"productId": "string",
|
|
"productVersion": "string",
|
|
"activationCode": "string",
|
|
"hardwareBindingType": "string",
|
|
"hardwareBindingId": "string"
|
|
}
|
|
```
|
|
|
|
**Response `200 OK` (`application/json`):**
|
|
```json
|
|
{
|
|
"licenseData": {
|
|
"id": "string",
|
|
"serialNumber": "string",
|
|
"productId": "string",
|
|
"filename": "string",
|
|
"content": "string" // Base64 Byte-Inhalt
|
|
},
|
|
"apiKey": "string",
|
|
"secret": "string"
|
|
}
|
|
```
|
|
|
|
**Response Headers:**
|
|
- `ETag` (string): Der ETag-Wert der Lizenz.
|
|
|
|
---
|
|
|
|
#### `POST /v1/activate-existing`
|
|
Aktiviert eine bereits vorhandene Lizenz erneut.
|
|
|
|
**Request Body (`application/json`):**
|
|
```json
|
|
{
|
|
"productId": "string",
|
|
"productVersion": "string",
|
|
"serialNumber": "string",
|
|
"proofOfPossessionHash": "string",
|
|
"salt": "string",
|
|
"hardwareBindingType": "string",
|
|
"hardwareBindingId": "string"
|
|
}
|
|
```
|
|
|
|
**Response `200 OK` (`application/json`):**
|
|
*Gleiche Struktur wie bei `/v1/activate`.*
|
|
|
|
---
|
|
|
|
### Licenses (Lizenzen)
|
|
|
|
#### `GET /v1/licenses/{id}`
|
|
Holt die Lizenz-Details zu einer bestimmten Lizenz-ID.
|
|
|
|
**Request Parameters:**
|
|
- `id` (path, string, required): Die UUID der Lizenz.
|
|
- `If-None-Match` (header, string, optional): ETag zur Cache-Validierung.
|
|
|
|
**Response `200 OK` (`application/json`):**
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"serialNumber": "string",
|
|
"productId": "string",
|
|
"filename": "string",
|
|
"content": "string" // Base64 Byte-Inhalt
|
|
}
|
|
```
|
|
|
|
**Response `304 Not Modified`:**
|
|
Falls die Lizenz nicht verändert wurde.
|
|
|
|
**Response `404 Not Found` / `403 Forbidden`:**
|
|
Standard Fehlerobjekt `ProblemDetails`.
|
|
|
|
---
|
|
|
|
## 2. Typen & Schemas
|
|
|
|
### `LicenseData`
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"serialNumber": "string",
|
|
"productId": "string",
|
|
"filename": "string",
|
|
"content": "string" // Base64 Byte-Inhalt
|
|
}
|
|
```
|
|
|
|
### `ProblemDetails`
|
|
```json
|
|
{
|
|
"type": "string",
|
|
"title": "string",
|
|
"status": 0,
|
|
"detail": "string",
|
|
"instance": "string"
|
|
}
|
|
```
|