diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index b28a93c370b..9fbcfd99596 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -4296,7 +4296,13 @@ { "name": "hum", "description": "Hum project process manifest", - "fileMatch": ["hum.yaml"], + "fileMatch": [ + "hum.yaml", + "hum.*.yaml", + "*.hum.yaml", + "hum.yml", + "*.hum.yml" + ], "url": "https://raw.githubusercontent.com/brettinternet/hum/main/hum.schema.json" }, { @@ -8854,6 +8860,11 @@ ], "url": "https://mise.jdx.dev/schema/mise.json" }, + { + "name": "mise task", + "description": "mise config for `task_config.includes` tasks", + "url": "https://mise.jdx.dev/schema/mise-task.json" + }, { "name": "mta.yaml", "description": "A MTA projects v3.3", @@ -8880,7 +8891,7 @@ }, { "name": "xs-app.json", - "description": "the SAP Application Router v8.2.2", + "description": "SAP Application Router configuration file", "fileMatch": ["xs-app.json"], "url": "https://www.schemastore.org/xs-app.json" }, diff --git a/src/schema-validation.jsonc b/src/schema-validation.jsonc index d636879ebec..c27a965b2fd 100644 --- a/src/schema-validation.jsonc +++ b/src/schema-validation.jsonc @@ -140,7 +140,6 @@ "project-1.0.0-rc2.json", "project.json", "prometheus.json", - "proxies.json", "putout.json", "pyrseas-0.8.json", "pylock.json", @@ -1560,7 +1559,9 @@ "destinations-rules", "services-rules", "logout-rules", - "local-file" + "local-file", + "headers-rules", + "validateWhitelist" ] }, "vespertide-migration.json": { diff --git a/src/schemas/json/hugo.json b/src/schemas/json/hugo.json index b18531d2242..65d90696580 100644 --- a/src/schemas/json/hugo.json +++ b/src/schemas/json/hugo.json @@ -1316,7 +1316,14 @@ }, "additionalProperties": false }, + "locale": { + "$comment": "For a multilingual project, specify this value independently for each language key.", + "description": "The language tag as described in RFC 5646.\nhttps://gohugo.io/configuration/all/#locale", + "type": "string", + "default": "" + }, "languageCode": { + "$comment": "DEPRECATED. Use 'locale' instead.", "description": "The language tag as defined by RFC 5646\nhttps://gohugo.io/getting-started/configuration/#languagecode", "type": "string", "default": "" diff --git a/src/schemas/json/metricshub-connector.json b/src/schemas/json/metricshub-connector.json index 678761a4834..3d0f87008f6 100644 --- a/src/schemas/json/metricshub-connector.json +++ b/src/schemas/json/metricshub-connector.json @@ -7372,6 +7372,317 @@ } } } + }, + "healthChecks": { + "type": "array", + "description": "Optional lightweight health-check criteria evaluated during periodic re-validation.", + "items": { + "type": "object", + "oneOf": [ + { + "properties": { + "type": { + "const": "deviceType", + "description": "Criteria Type" + }, + "forceSerialization": { + "type": "boolean" + }, + "keep": { + "type": "array", + "description": "Valid Device Types", + "items": { + "$ref": "#/definitions/deviceKind" + } + }, + "exclude": { + "type": "array", + "description": "Invalid Device Types", + "items": { + "$ref": "#/definitions/deviceKind" + } + } + } + }, + { + "properties": { + "type": { + "const": "http" + }, + "forceSerialization": { + "type": "boolean" + }, + "method": { + "$ref": "#/definitions/httpMethod", + "description": "HTTP Method" + }, + "url": { + "type": "string", + "description": "HTTP Url" + }, + "path": { + "type": "string", + "description": "Http Path" + }, + "header": { + "type": "string", + "description": "HTTP Header" + }, + "body": { + "type": "string", + "description": "HTTP Body" + }, + "expectedResult": { + "type": "string", + "description": "Valid Result" + }, + "errorMessage": { + "type": "string", + "description": "Custom Error Message" + }, + "resultContent": { + "$ref": "#/definitions/resultContent" + }, + "authenticationToken": { + "type": "string", + "description": "HTTP Authentication Token" + } + } + }, + { + "properties": { + "type": { + "const": "ipmi" + }, + "forceSerialization": { + "type": "boolean" + } + } + }, + { + "properties": { + "type": { + "const": "commandLine" + }, + "forceSerialization": { + "type": "boolean" + }, + "commandLine": { + "type": "string", + "description": "OS Command" + }, + "errorMessage": { + "type": "string", + "description": "Custom Error Message" + }, + "expectedResult": { + "type": "string", + "description": "Valid Result" + }, + "executeLocally": { + "type": "boolean", + "description": "Command Executed On Local Agent" + }, + "timeout": { + "type": "integer", + "description": "OS Command Timeout" + } + } + }, + { + "properties": { + "type": { + "const": "process" + }, + "forceSerialization": { + "type": "boolean" + }, + "commandLine": { + "type": "string", + "description": "Regular Expression Matching Command Line Of Process" + } + } + }, + { + "properties": { + "type": { + "const": "productRequirements" + }, + "forceSerialization": { + "type": "boolean" + }, + "engineVersion": { + "type": "string", + "description": "MetricsHubs Minimum Version" + }, + "kmVersion": { + "type": "string", + "description": "BMC Sentry Hardware KM Minimum Version" + } + } + }, + { + "properties": { + "type": { + "const": "service" + }, + "forceSerialization": { + "type": "boolean" + }, + "name": { + "type": "string", + "description": "Service Name" + } + } + }, + { + "properties": { + "type": { + "const": "snmpGet" + }, + "forceSerialization": { + "type": "boolean" + }, + "oid": { + "type": "string", + "description": "SNMP Get OID" + }, + "expectedResult": { + "type": "string", + "description": "Valid Result" + } + } + }, + { + "properties": { + "type": { + "const": "snmpGetNext" + }, + "forceSerialization": { + "type": "boolean" + }, + "oid": { + "type": "string", + "description": "SNMP GetNext OID" + }, + "expectedResult": { + "type": "string", + "description": "Valid Result" + } + } + }, + { + "properties": { + "type": { + "const": "wbem" + }, + "forceSerialization": { + "type": "boolean" + }, + "query": { + "type": "string", + "description": "WBEM Query" + }, + "namespace": { + "type": "string", + "description": "WBEM Namespace" + }, + "expectedResult": { + "type": "string", + "description": "Valid Result" + }, + "errorMessage": { + "type": "string", + "description": "Custom Error Message" + } + } + }, + { + "properties": { + "type": { + "const": "wmi" + }, + "forceSerialization": { + "type": "boolean" + }, + "query": { + "type": "string", + "description": "WMI Query" + }, + "namespace": { + "type": "string", + "description": "WMI Namespace" + }, + "expectedResult": { + "type": "string", + "description": "Valid Result" + }, + "errorMessage": { + "type": "string", + "description": "Custom Error Message" + } + } + }, + { + "properties": { + "type": { + "const": "sql", + "description": "Criteria Type" + }, + "forceSerialization": { + "type": "boolean" + }, + "database": { + "type": "string", + "description": "Optional database name to connect to" + }, + "query": { + "type": "string", + "description": "SQL query", + "minLength": 1 + }, + "expectedResult": { + "type": "string", + "description": "Valid Result (regexp or literal, engine-defined)" + }, + "errorMessage": { + "type": "string", + "description": "Custom Error Message" + } + } + }, + { + "properties": { + "type": { + "const": "jmx", + "description": "Criteria Type" + }, + "forceSerialization": { + "type": "boolean" + }, + "objectName": { + "type": "string", + "description": "JMX ObjectName pattern", + "minLength": 1 + }, + "attributes": { + "type": "array", + "description": "Attributes to fetch from the MBean", + "items": { "type": "string" }, + "minItems": 1 + }, + "expectedResult": { + "type": "string", + "description": "Valid Result (regexp over fetched attribute values)" + }, + "errorMessage": { + "type": "string", + "description": "Custom Error Message" + } + } + } + ] + } } } }, diff --git a/src/schemas/json/proxies.json b/src/schemas/json/proxies.json index e4355e89ae9..22d65f44c6f 100644 --- a/src/schemas/json/proxies.json +++ b/src/schemas/json/proxies.json @@ -1,5 +1,6 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/proxies.json", "additionalProperties": false, "definitions": { "proxy-schema": { @@ -87,11 +88,11 @@ } }, "patternProperties": { - "^backend\\.request\\.querystring\\..+$": { + "^backend\\.request\\.querystring\\.(?!).+$": { "$ref": "#/definitions/request-overrides-value-expression-schema", "description": "A query string parameter which can be set for the call to the backend. Values can reference application settings and parameters from the original client request. If the empty string is provided, the parameter will not be included on the backend request" }, - "^backend\\.request\\.headers\\..+$": { + "^backend\\.request\\.headers\\.(?!).+$": { "$ref": "#/definitions/request-overrides-value-expression-schema", "description": "A header which can be set for the call to the backend. Values can reference application settings, parameters from the original client request, and parameters from the backend response. If the empty string is provided, the header will not be included on the backend request." } @@ -133,7 +134,7 @@ } }, "patternProperties": { - "^response\\.headers\\..+$": { + "^response\\.headers\\.(?!).+$": { "$ref": "#/definitions/response-overrides-value-expression-schema", "description": "A header which can be set for the response to the client. Values can reference application settings, parameters from the original client request, and parameters from the backend response. If the empty string is provided, the header will not be included on the response." } @@ -224,7 +225,6 @@ ] } }, - "id": "https://json.schemastore.org/proxies.json", "properties": { "$schema": { "type": "string" diff --git a/src/schemas/json/xs-app.json b/src/schemas/json/xs-app.json index f774aa3cf61..10da9908095 100644 --- a/src/schemas/json/xs-app.json +++ b/src/schemas/json/xs-app.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://json.schemastore.org/xs-app.json", - "$comment": "Based on https://github.wdf.sap.corp/xs2/approuter.js/blob/master/lib/configuration/schemas/xs-app-schema.json", + "$comment": "Based on xs-app-schema.json from @sap/approuter v23. Source: /lib/configuration/schemas/xs-app-schema.json within @sap/approuter", "definitions": { "sourceSchema": { "type": ["string", "object"], @@ -71,6 +71,88 @@ "type": "string", "minLength": 1 } + }, + "hostPatternSchema": { + "type": ["string", "object"], + "minLength": 1, + "additionalProperties": true + }, + "allowedOriginItem": { + "type": "object", + "additionalProperties": false, + "properties": { + "host": { + "type": "string", + "minLength": 1 + }, + "protocol": { + "type": "string", + "minLength": 1 + }, + "port": { + "type": "integer" + } + }, + "required": ["host"] + }, + "corsConfigItem": { + "type": "object", + "additionalProperties": false, + "properties": { + "uriPattern": { + "$ref": "#/definitions/sourceSchema" + }, + "hostPattern": { + "$ref": "#/definitions/hostPatternSchema" + }, + "allowedOrigin": { + "type": "array", + "items": { + "$ref": "#/definitions/allowedOriginItem" + } + }, + "allowedMethods": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "enum": [ + "DELETE", + "GET", + "HEAD", + "OPTIONS", + "POST", + "PUT", + "TRACE", + "PATCH" + ] + } + }, + "allowedHeaders": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "minLength": 1 + } + }, + "allowedCredentials": { + "type": "boolean" + }, + "exposeHeaders": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "minLength": 1 + } + }, + "maxAge": { + "type": "integer", + "minimum": 1 + } + }, + "required": ["allowedOrigin", "uriPattern"] } }, "description": "Application Router Configuration Schema", @@ -83,6 +165,9 @@ "type": "string", "enum": ["none", "route"] }, + "stateProtection": { + "type": "boolean" + }, "sessionTimeout": { "type": "integer", "minimum": 1 @@ -128,6 +213,14 @@ "type": "string", "minLength": 1 }, + "destinationAuth": { + "type": "string", + "enum": ["ias", "xsuaa"], + "default": "xsuaa" + }, + "setBackendSessionCookies": { + "type": "boolean" + }, "localDir": { "type": "string", "minLength": 1 @@ -135,6 +228,9 @@ "csrfProtection": { "type": "boolean" }, + "preferLocal": { + "type": "boolean" + }, "service": { "type": "string" }, @@ -143,12 +239,15 @@ }, "authenticationType": { "type": "string", - "enum": ["xsuaa", "basic", "ias", "none"] + "enum": ["xsuaa", "ias", "basic", "none"] }, "identityProvider": { "type": "string", "minLength": 1 }, + "dynamicIdentityProvider": { + "type": "boolean" + }, "scope": { "$ref": "#/definitions/scopesSchema" }, @@ -186,6 +285,26 @@ "required": ["source"] } }, + "responseHeaders": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "minLength": 1, + "format": "headers-rules" + }, + "value": { + "type": "string", + "minLength": 1, + "format": "valid-header-value" + } + }, + "required": ["name", "value"] + } + }, "destinations": { "type": "object", "format": "destinations-rules", @@ -233,6 +352,11 @@ "additionalProperties": false, "format": "logout-rules", "properties": { + "backChannelLogoutEndpoint": { + "type": "string", + "minLength": 1, + "format": "relative-uri" + }, "logoutEndpoint": { "type": "string", "minLength": 1, @@ -242,6 +366,13 @@ "type": "string", "minLength": 1, "format": "uri" + }, + "logoutMethod": { + "type": "string", + "enum": ["POST", "GET"] + }, + "csrfProtection": { + "type": "boolean" } } }, @@ -279,6 +410,9 @@ "minSize": { "type": "integer", "minimum": 1 + }, + "compressResponseMixedTypeContent": { + "type": "boolean" } } }, @@ -294,10 +428,10 @@ }, "errorPage": { "type": "array", - "additionalProperties": false, "items": { "type": "object", - "required": ["status", "file"], + "required": ["status"], + "oneOf": [{ "required": ["file"] }, { "required": ["path"] }], "properties": { "status": { "type": ["integer", "array"], @@ -313,11 +447,23 @@ "type": "string", "minLength": 1, "format": "local-file" + }, + "path": { + "type": "string", + "minLength": 1, + "format": "relative-uri" } } } + }, + "cors": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/corsConfigItem" + } } }, - "title": "com.sap.xsapp.schema_8.2", + "title": "SAP Application Router Configuration", "type": "object" } diff --git a/src/test/metricshub-connector/metricshub-connector.yaml b/src/test/metricshub-connector/metricshub-connector.yaml index 3f58d797d24..14bee70a076 100644 --- a/src/test/metricshub-connector/metricshub-connector.yaml +++ b/src/test/metricshub-connector/metricshub-connector.yaml @@ -68,6 +68,10 @@ connector: appliesTo: - hp tags: [system, linux] + healthChecks: + - type: http + path: /health + expectedResult: '200' displayName: name information: information platforms: platform diff --git a/src/test/xs-app/xs-app.json b/src/test/xs-app/xs-app.json index 351c0843a23..aa14eb1a015 100644 --- a/src/test/xs-app/xs-app.json +++ b/src/test/xs-app/xs-app.json @@ -1,31 +1,82 @@ { "authenticationMethod": "route", + "compression": { + "compressResponseMixedTypeContent": true, + "enabled": true, + "minSize": 1024 + }, + "cors": [ + { + "allowedCredentials": true, + "allowedHeaders": ["Authorization", "Content-Type"], + "allowedMethods": ["GET", "POST", "PUT", "DELETE"], + "allowedOrigin": [ + { + "host": "example.com", + "port": 443, + "protocol": "https" + } + ], + "exposeHeaders": ["X-Custom-Header"], + "maxAge": 3600, + "uriPattern": "^/api/(.*)$" + } + ], + "errorPage": [ + { + "file": "errors/notfound.html", + "status": [404, 403] + }, + { + "path": "/error/500", + "status": 500 + } + ], "logout": { - "logoutEndpoint": "/do/logout" + "backChannelLogoutEndpoint": "/do/backchannel/logout", + "csrfProtection": true, + "logoutEndpoint": "/do/logout", + "logoutMethod": "POST" }, + "responseHeaders": [ + { + "name": "X-Frame-Options", + "value": "SAMEORIGIN" + }, + { + "name": "Strict-Transport-Security", + "value": "max-age=31536000; includeSubDomains; preload" + } + ], "routes": [ { "authenticationType": "xsuaa", "csrfProtection": true, "destination": "SAP4KidsService", + "destinationAuth": "xsuaa", + "setBackendSessionCookies": false, "source": "^/odata/(.*)$", "target": "$1" }, { "authenticationType": "none", "destination": "SAP4KidsService", + "preferLocal": true, "source": "^/public/(.*)$", "target": "$1" }, { - "authenticationType": "xsuaa", + "authenticationType": "ias", "csrfProtection": true, "destination": "SAP4KidsService", + "dynamicIdentityProvider": true, + "identityProvider": "my-idp", "scope": ["$XSAPPNAME.admin"], "source": "^/dataadmin/(.*)$", "target": "$1" } ], "sessionTimeout": 150, + "stateProtection": true, "welcomeFile": "comsap4kidsresourcelocator/" }