From 37333fc1201156f22b84752cbd951e0d8648f482 Mon Sep 17 00:00:00 2001 From: Matthew Rich Date: Fri, 27 Sep 2024 08:21:32 -0700 Subject: [PATCH] add missing certificate schemas --- .../certificate-declaration.schema.json | 17 +++++ .../resource/schemas/certificate.schema.json | 70 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 internal/resource/schemas/certificate-declaration.schema.json create mode 100644 internal/resource/schemas/certificate.schema.json diff --git a/internal/resource/schemas/certificate-declaration.schema.json b/internal/resource/schemas/certificate-declaration.schema.json new file mode 100644 index 0000000..e23fa36 --- /dev/null +++ b/internal/resource/schemas/certificate-declaration.schema.json @@ -0,0 +1,17 @@ +{ + "$id": "certificate-declaration.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "certificate-declaration", + "type": "object", + "required": [ "type", "attributes" ], + "properties": { + "type": { + "type": "string", + "description": "Resource type name.", + "enum": [ "certificate" ] + }, + "attributes": { + "$ref": "certificate.schema.json" + } + } +} diff --git a/internal/resource/schemas/certificate.schema.json b/internal/resource/schemas/certificate.schema.json new file mode 100644 index 0000000..33d28a8 --- /dev/null +++ b/internal/resource/schemas/certificate.schema.json @@ -0,0 +1,70 @@ +{ + "$id": "certificate.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "certificate", + "type": "object", + "properties": { + "publickey": { + "type": "string" + }, + "privatekey": { + "type": "string" + }, + "certificate": { + "type": "string" + }, + "SerialNumber": { + "type": "integer", + "description": "Serial number", + "minLength": 1 + }, + "Issuer": { + "$ref": "pkixname.schema.json" + }, + "Subject": { + "$ref": "pkixname.schema.json" + }, + "NotBefore": { + "type": "string", + "format": "date-time", + "description": "Cert is not valid before time in YYYY-MM-DDTHH:MM:SS.sssssssssZ format." + }, + "NotAfter": { + "type": "string", + "format": "date-time", + "description": "Cert is not valid after time in YYYY-MM-DDTHH:MM:SS.sssssssssZ format." + }, + "KeyUsage": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "description": "Actions valid for a key. E.g. 1 = KeyUsageDigitalSignature" + }, + "ExtKeyUsage": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 13 + }, + "description": "Extended set of actions valid for a key" + }, + "BasicConstraintsValid": { + "type": "boolean", + "description": "BasicConstraintsValid indicates whether IsCA, MaxPathLen, and MaxPathLenZero are valid" + }, + "IsCA": { + "type": "boolean", + "description": "" + } + } +}