Skip to content

Commit 506a936

Browse files
xBlaz3kxCopilot
andauthored
feat: ocpp 1.6 security extension support (#10)
* feat: add security extension schemas for ocpp 1.6 * fix: generic error for reading schemas from file Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent e3d745c commit 506a936

23 files changed

+662
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:CertificateSigned.req",
4+
"type": "object",
5+
"properties": {
6+
"certificateChain": {
7+
"type": "string",
8+
"maxLength": 10000
9+
}
10+
},
11+
"additionalProperties": false,
12+
"required": [
13+
"certificateChain"
14+
]
15+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:CertificateSigned.conf",
4+
"definitions": {
5+
"CertificateSignedStatusEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"Accepted",
10+
"Rejected"
11+
]
12+
}
13+
},
14+
"type": "object",
15+
"additionalProperties": false,
16+
"properties": {
17+
"status": {
18+
"$ref": "#/definitions/CertificateSignedStatusEnumType"
19+
}
20+
},
21+
"required": [
22+
"status"
23+
]
24+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:DeleteCertificate.req",
4+
"definitions": {
5+
"HashAlgorithmEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"SHA256",
10+
"SHA384",
11+
"SHA512"
12+
]
13+
},
14+
"CertificateHashDataType": {
15+
"type": "object",
16+
"additionalProperties": false,
17+
"properties": {
18+
"hashAlgorithm": {
19+
"$ref": "#/definitions/HashAlgorithmEnumType"
20+
},
21+
"issuerNameHash": {
22+
"type": "string",
23+
"maxLength": 128
24+
},
25+
"issuerKeyHash": {
26+
"type": "string",
27+
"maxLength": 128
28+
},
29+
"serialNumber": {
30+
"type": "string",
31+
"maxLength": 40
32+
}
33+
},
34+
"required": [
35+
"hashAlgorithm",
36+
"issuerNameHash",
37+
"issuerKeyHash",
38+
"serialNumber"
39+
]
40+
}
41+
},
42+
"type": "object",
43+
"additionalProperties": false,
44+
"properties": {
45+
"certificateHashData": {
46+
"$ref": "#/definitions/CertificateHashDataType"
47+
}
48+
},
49+
"required": [
50+
"certificateHashData"
51+
]
52+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:DeleteCertificate.conf",
4+
"definitions": {
5+
"DeleteCertificateStatusEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"Accepted",
10+
"Failed",
11+
"NotFound"
12+
]
13+
}
14+
},
15+
"type": "object",
16+
"additionalProperties": false,
17+
"properties": {
18+
"status": {
19+
"$ref": "#/definitions/DeleteCertificateStatusEnumType"
20+
}
21+
},
22+
"required": [
23+
"status"
24+
]
25+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:ExtendedTriggerMessage.req",
4+
"definitions": {
5+
"MessageTriggerEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"BootNotification",
10+
"LogStatusNotification",
11+
"FirmwareStatusNotification",
12+
"Heartbeat",
13+
"MeterValues",
14+
"SignChargePointCertificate",
15+
"StatusNotification"
16+
]
17+
}
18+
},
19+
"type": "object",
20+
"additionalProperties": false,
21+
"properties": {
22+
"requestedMessage": {
23+
"$ref": "#/definitions/MessageTriggerEnumType"
24+
},
25+
"connectorId": {
26+
"type": "integer"
27+
}
28+
},
29+
"required": [
30+
"requestedMessage"
31+
]
32+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:ExtendedTriggerMessage.conf",
4+
"definitions": {
5+
"TriggerMessageStatusEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"Accepted",
10+
"Rejected",
11+
"NotImplemented"
12+
]
13+
}
14+
},
15+
"type": "object",
16+
"additionalProperties": false,
17+
"properties": {
18+
"status": {
19+
"$ref": "#/definitions/TriggerMessageStatusEnumType"
20+
}
21+
},
22+
"required": [
23+
"status"
24+
]
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:GetInstalledCertificateIds.req",
4+
"definitions": {
5+
"CertificateUseEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"CentralSystemRootCertificate",
10+
"ManufacturerRootCertificate"
11+
]
12+
}
13+
},
14+
"type": "object",
15+
"additionalProperties": false,
16+
"properties": {
17+
"certificateType": {
18+
"$ref": "#/definitions/CertificateUseEnumType"
19+
}
20+
},
21+
"required": [
22+
"certificateType"
23+
]
24+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:GetInstalledCertificateIds.conf",
4+
"definitions": {
5+
"GetInstalledCertificateStatusEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"Accepted",
10+
"NotFound"
11+
]
12+
},
13+
"HashAlgorithmEnumType": {
14+
"type": "string",
15+
"additionalProperties": false,
16+
"enum": [
17+
"SHA256",
18+
"SHA384",
19+
"SHA512"
20+
]
21+
},
22+
"CertificateHashDataType": {
23+
"javaType": "CertificateHashData",
24+
"type": "object",
25+
"additionalProperties": false,
26+
"properties": {
27+
"hashAlgorithm": {
28+
"$ref": "#/definitions/HashAlgorithmEnumType"
29+
},
30+
"issuerNameHash": {
31+
"type": "string",
32+
"maxLength": 128
33+
},
34+
"issuerKeyHash": {
35+
"type": "string",
36+
"maxLength": 128
37+
},
38+
"serialNumber": {
39+
"type": "string",
40+
"maxLength": 40
41+
}
42+
},
43+
"required": [
44+
"hashAlgorithm",
45+
"issuerNameHash",
46+
"issuerKeyHash",
47+
"serialNumber"
48+
]
49+
}
50+
},
51+
"type": "object",
52+
"additionalProperties": false,
53+
"properties": {
54+
"certificateHashData": {
55+
"type": "array",
56+
"additionalItems": false,
57+
"items": {
58+
"$ref": "#/definitions/CertificateHashDataType"
59+
},
60+
"minItems": 1
61+
},
62+
"status": {
63+
"$ref": "#/definitions/GetInstalledCertificateStatusEnumType"
64+
}
65+
},
66+
"required": [
67+
"status"
68+
]
69+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:GetLog.req",
4+
"definitions": {
5+
"LogEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"DiagnosticsLog",
10+
"SecurityLog"
11+
]
12+
},
13+
"LogParametersType": {
14+
"type": "object",
15+
"additionalProperties": false,
16+
"properties": {
17+
"remoteLocation": {
18+
"type": "string",
19+
"maxLength": 512
20+
},
21+
"oldestTimestamp": {
22+
"type": "string",
23+
"format": "date-time"
24+
},
25+
"latestTimestamp": {
26+
"type": "string",
27+
"format": "date-time"
28+
}
29+
},
30+
"required": [
31+
"remoteLocation"
32+
]
33+
}
34+
},
35+
"type": "object",
36+
"additionalProperties": false,
37+
"properties": {
38+
"log": {
39+
"$ref": "#/definitions/LogParametersType"
40+
},
41+
"logType": {
42+
"$ref": "#/definitions/LogEnumType"
43+
},
44+
"requestId": {
45+
"type": "integer"
46+
},
47+
"retries": {
48+
"type": "integer"
49+
},
50+
"retryInterval": {
51+
"type": "integer"
52+
}
53+
},
54+
"required": [
55+
"logType",
56+
"requestId",
57+
"log"
58+
]
59+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-06/schema#",
3+
"$id": "urn:OCPP:Cp:1.6:2020:3:GetLog.conf",
4+
"definitions": {
5+
"LogStatusEnumType": {
6+
"type": "string",
7+
"additionalProperties": false,
8+
"enum": [
9+
"Accepted",
10+
"Rejected",
11+
"AcceptedCanceled"
12+
]
13+
}
14+
},
15+
"type": "object",
16+
"additionalProperties": false,
17+
"properties": {
18+
"status": {
19+
"$ref": "#/definitions/LogStatusEnumType"
20+
},
21+
"filename": {
22+
"type": "string",
23+
"maxLength": 255
24+
}
25+
},
26+
"required": [
27+
"status"
28+
]
29+
}

0 commit comments

Comments
 (0)