From 852d78f6aa2a0a3f975b524f55fd5e0108944e02 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 3 Jul 2023 12:12:38 +0200 Subject: [PATCH] chore: update schema form --- src/main/resources/schemas/schema-form.json | 54 ++++++++++++++++----- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/src/main/resources/schemas/schema-form.json b/src/main/resources/schemas/schema-form.json index c6e34dd5..8a9e3491 100644 --- a/src/main/resources/schemas/schema-form.json +++ b/src/main/resources/schemas/schema-form.json @@ -1,6 +1,7 @@ { - "type" : "object", - "id" : "urn:jsonschema:io:gravitee:policy:generatejwt:configuration:GenerateJwtPolicyConfiguration", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, "properties" : { "signature": { "title": "Signature", @@ -21,6 +22,14 @@ "HMAC_HS384": "HS384 - HMAC with SHA-384, requires 384+ bit secret", "HMAC_HS512": "HS512 - HMAC with SHA-512, requires 512+ bit secret" } + }, + "gioConfig": { + "enumLabelMap": { + "RSA_RS256": "RS256 - RSA signature with SHA-256", + "HMAC_HS256": "HS256 - HMAC with SHA-256, requires 256+ bit secret", + "HMAC_HS384": "HS384 - HMAC with SHA-384, requires 384+ bit secret", + "HMAC_HS512": "HS512 - HMAC with SHA-512, requires 512+ bit secret" + } } }, "keyResolver": { @@ -42,31 +51,39 @@ "JKS": "The content of the private key is provided by reading a JKS file from filesystem (only for RS algorithms)", "PKCS12": "The content of the private key is provided by reading a PKCS12 file from filesystem (only for RS algorithms)" } + }, + "gioConfig": { + "enumLabelMap": { + "INLINE": "The content of the private key / secret key is provided inline", + "PEM": "The content of the private key is provided by reading a PEM file from filesystem (only for RS algorithms)", + "JKS": "The content of the private key is provided by reading a JKS file from filesystem (only for RS algorithms)", + "PKCS12": "The content of the private key is provided by reading a PKCS12 file from filesystem (only for RS algorithms)" + } } }, "alias" : { "type" : "string", "title": "Key alias", - "description": "Alias used to access a keystore entry (only for JKS and PKCS#12)" + "description": "Alias used to access a keystore entry. (only for JKS and PKCS#12)" }, "storepass" : { "type" : "string", "title": "Store password", - "description": "Pass used to access the key store (only for JKS and PKCS#12)" + "description": "Pass used to access the key store. (only for JKS and PKCS#12)" }, "keypass" : { "type" : "string", "title": "Key password", - "description": "Pass used to access the particular key pair's private key (only for JKS)" + "description": "Pass used to access the particular key pair's private key. (only for JKS)" }, "kid" : { "type" : "string", "title": "Key ID", - "description": "Specifies the key ID (kid) to include in the JWT header" + "description": "Specifies the key ID (kid) to include in the JWT header." }, "x509CertificateChain": { "title": "Certificate chain", - "description": "Whether a certificate chain should be added as an X5C attribute (only for RS256, JKS and PKCS#12)", + "description": "Whether a certificate chain should be added as an X5C attribute. (only for RS256, JKS and PKCS#12)", "type" : "string", "default": "NONE", "enum" : [ @@ -79,6 +96,12 @@ "NONE": "Do not add a certificate chain", "X5C": "Add a certificate chain as an X5C attribute" } + }, + "gioConfig": { + "enumLabelMap": { + "NONE": "Do not add a certificate chain", + "X5C": "Add a certificate chain as an X5C attribute" + } } }, "id" : { @@ -92,7 +115,7 @@ "audiences" : { "type" : "array", "title": "Audiences", - "description": "Claim identifies the recipients that the JWT is intended for. Supports EL.", + "description": "Claim identifies the recipients that the JWT is intended for. (Supports EL)", "items" : { "type" : "string" } @@ -100,7 +123,7 @@ "issuer" : { "type" : "string", "title": "Issuer", - "description": "Claim that identifies the issuer of the JWT. Supports EL.", + "description": "Claim that identifies the issuer of the JWT. (Supports EL)", "default": "urn://gravitee-api-gw", "x-schema-form": { "expression-language": true @@ -122,7 +145,7 @@ "subject" : { "type" : "string", "title": "Subject", - "description": "Claim identifies or makes a statement about the subject of the JWT. Supports EL.", + "description": "Claim identifies or makes a statement about the subject of the JWT. (Supports EL)", "x-schema-form": { "expression-language": true } @@ -130,7 +153,7 @@ "content" : { "type" : "string", "title": "Private key / Secret key / key store path", - "description": "Specifies a PEM-encoded private key used to sign the JWT or the secret key used to sign tokens with an HMAC algorithm, or the path to your key store", + "description": "Specifies a PEM-encoded private key used to sign the JWT or the secret key used to sign tokens with an HMAC algorithm, or the path to your key store.", "x-schema-form": { "type": "codemirror", "codemirrorOptions": { @@ -139,16 +162,21 @@ "lineNumbers": true, "allowDropFileTypes": true } + }, + "format": "gio-code-editor", + "gioConfig": { + "monacoEditorConfig": { + "language": "json" + } } }, "customClaims" : { "type" : "array", "title": "Custom claims", - "description": "Specify additional claim name/value pair(s) in the payload of the JWT", + "description": "Specify additional claim name/value pair(s) in the payload of the JWT.", "items" : { "type" : "object", "title": "Claim", - "id" : "urn:jsonschema:io:gravitee:policy:generatejwt:model:Claim", "properties" : { "name" : { "type" : "string",