UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

1,006 lines (1,005 loc) 39.1 kB
export default { "rules": { "invalid-kind-value-combined": { "description": "Kind must be one of 'API' | 'Scope' | 'Project' | 'StagedPolicySequence' | 'InvokeAWSLambda' | 'ValidateAPISpecification' | 'CORS' | 'Quota' | 'Plan' | 'Product' | 'URISchemes' | 'properties' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'SetAuthorization' | 'Invoke' | 'GlobalPolicy' | 'InboundBulkHead' | 'SetMediaType' | 'InboundMessaging' | 'IAM' | 'AuthorizeUser' | 'SetContextVariable' | 'WebMethodsISService' | 'Log' | 'MonitorTraffic' | 'CacheServiceResult' | 'OutboundAlias' | 'OutboundAnonymous' | 'HTTPInvoke' | 'InvokeMessagingExtension' | 'DataMasking' | 'TransformRequest' | 'TransformResponse' | 'Route' | 'MessageConfig' | 'HTTPEndpoint' | 'MockEndpoint' | 'MockResponse' | 'ErrorProcessing' | 'Set' | 'RateLimitDef' | 'RateLimit' | 'Redact' | 'Remove' | 'Transform' | 'DataPowerAssembly' | 'Switch' | 'If' | 'OperationSwitch' | 'Try' | 'IBMCloudLogin' | 'WatsonXAIInvoke' | 'OpenAIInvoke' | 'FreeFlowPolicySequence' | 'Block' | 'TokenMediation' | 'EnforceCircuitBreaker' | 'JavaScript' | 'LuaScript' | 'Cache' | 'Antivirus' | 'SQLInjectionFilter' | 'CountLimit' | 'CountLimitDef' | 'Return' | 'Retry' | 'Throw' | 'HandlebarsTemplate' | 'ExtractIdentity' | 'Authorize' | 'Authenticate' | 'Parse'", "severity": "error", "given": "$", "then": { "field": "kind", "function": "schema", "functionOptions": { "schema": { "type": "string", "enum": [ "API", "Scope", "Project", "StagedPolicySequence", "InvokeAWSLambda", "ValidateAPISpecification", "CORS", "Quota", "Plan", "Product", "URISchemes", "properties", "Telemetry", "Properties", "LoadBalancer", "SetAuthorization", "Invoke", "GlobalPolicy", "InboundBulkHead", "SetMediaType", "InboundMessaging", "IAM", "AuthorizeUser", "SetContextVariable", "WebMethodsISService", "Log", "MonitorTraffic", "CacheServiceResult", "OutboundAlias", "OutboundAnonymous", "HTTPInvoke", "InvokeMessagingExtension", "DataMasking", "TransformRequest", "TransformResponse", "Route", "MessageConfig", "HTTPEndpoint", "MockEndpoint", "MockResponse", "ErrorProcessing", "Set", "RateLimitDef", "RateLimit", "Redact", "Remove", "Transform", "DataPowerAssembly", "Switch", "If", "OperationSwitch", "Try", "IBMCloudLogin", "WatsonXAIInvoke", "OpenAIInvoke", "FreeFlowPolicySequence", "Block", "TokenMediation", "EnforceCircuitBreaker", "JavaScript", "LuaScript", "Cache", "Antivirus", "SQLInjectionFilter", "CountLimit", "CountLimitDef", "Return", "Retry", "Throw", "HandlebarsTemplate", "ExtractIdentity", "Authorize", "Authenticate", "Parse" ] } } } }, "kind-not-exist": { "description": "Kind does not exist.", "severity": "error", "given": "$", "resolved": false, "then": { "field": "kind", "function": "truthy" } }, "invalid-kind-value": { "description": "Kind must be 'IAM'", "severity": "error", "given": "$", "then": { "field": "kind", "function": "schema", "functionOptions": { "schema": { "type": "string", "enum": [ "IAM" ] } } } }, "invalid-kind-spl-character": { "description": "kind should not be having empty or special characters", "severity": "error", "given": "$", "resolved": false, "then": { "field": "kind", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "invalid-api-version": { "description": "apiVersion must be one of the valid values 'api.ibm.com/v1'", "severity": "error", "given": "$", "resolved": false, "then": { "field": "apiVersion", "function": "schema", "functionOptions": { "schema": { "type": "string", "enum": [ "api.ibm.com/v1" ] } } } }, "api-version-not-exist": { "description": "apiVersion does not exist.", "severity": "error", "given": "$", "resolved": false, "then": { "field": "apiVersion", "function": "truthy" } }, "metadata-not-exist": { "description": "Metadata does not exist.", "severity": "error", "given": "$", "resolved": false, "then": { "field": "metadata", "function": "truthy" } }, "metadata-whitelist-check": { "description": "Metadata should not be having empty or special characters", "severity": "error", "given": "$", "resolved": false, "then": { "field": "metadata", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "metadata-name-not-exist": { "description": "Metadata name does not exist", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "name", "function": "truthy" } }, "metadata-name-whitelist-check": { "description": "Metadata name should not be having empty or special characters", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "name", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "metadata-version-not-exist": { "description": "Metadata version does not exist", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "version", "function": "truthy" } }, "metadata-version-whitelist-check": { "description": "Metadata version should not be having empty or special characters", "severity": "error", "given": "$.metadata", "resolved": false, "then": { "field": "version", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "metadata-namespace-not-exist": { "description": "Metadata namespace does not exist", "severity": "warn", "given": "$.metadata", "resolved": false, "then": { "field": "namespace", "function": "truthy" } }, "metadata-namespace-whitelist-check": { "description": "Metadata namespace should not be having empty or special characters", "severity": "warn", "given": "$.metadata", "resolved": false, "then": { "field": "namespace", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "spec-details-not-exist": { "description": "Spec details does not exist", "severity": "error", "given": "$", "resolved": false, "then": { "field": "spec", "function": "truthy" } }, "spec-details-whitelist-check": { "description": "Spec should not be having empty or special characters", "severity": "error", "given": "$", "resolved": false, "then": { "field": "spec", "function": "pattern", "functionOptions": { "match": "^(?![\\s\\W_]+$).+$" } } }, "tags-not-exist": { "description": "Tag does not exist", "severity": "warn", "given": "$.metadata", "resolved": false, "then": { "field": "tags", "function": "truthy" } }, "invalid-tag-type": { "description": "Invalid Tag Type", "severity": "error", "given": "$.metadata.tags", "resolved": false, "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-metadata-description-type": { "description": "The description field must be of type string", "severity": "error", "given": "$.metadata.description", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-name-required": { "description": "The name field is required in the $.metadata", "severity": "error", "given": "$.metadata", "then": { "field": "name", "function": "defined" } }, "$-metadata-name-type": { "description": "The name field must be of type string", "severity": "error", "given": "$.metadata.name", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-namespace-type": { "description": "The namespace field must be of type string", "severity": "error", "given": "$.metadata.namespace", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-tags-type": { "description": "The tags field must be of type array", "severity": "error", "given": "$.metadata.tags", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-metadata-tags-items-type": { "description": "Items in the tags array must be of type string", "severity": "error", "given": "$.metadata.tags[*]", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-type-type": { "description": "The type field must be of type string", "severity": "error", "given": "$.metadata.type", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-type-enum": { "description": "The type field must be one of: REST, SWAGGER, SOAP, GRAPHQL, ODATA", "severity": "error", "given": "$.metadata.type", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "REST", "SWAGGER", "SOAP", "GRAPHQL", "ODATA" ] } } } }, "$-metadata-version-required": { "description": "The version field is required in the $.metadata", "severity": "error", "given": "$.metadata", "then": { "field": "version", "function": "defined" } }, "$-metadata-version-type": { "description": "The version field must be of type string", "severity": "error", "given": "$.metadata.version", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-metadata-labels-type": { "description": "The labels field must be of type object", "severity": "error", "given": "$.metadata.labels", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-metadata-labels-gatewayTypes-type": { "description": "The gatewayTypes field must be of type array", "severity": "error", "given": "$.metadata.labels.gatewayTypes", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-metadata-labels-gatewayTypes-items-type": { "description": "Items in the gatewayTypes array must be of type string", "severity": "error", "given": "$.metadata.labels.gatewayTypes[*]", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-accessControl-type": { "description": "The accessControl field must be of type array", "severity": "error", "given": "$.spec.accessControl", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-spec-accessControl-items-type": { "description": "Items in the accessControl array must be of type array", "severity": "error", "given": "$.spec.accessControl[*]", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-spec-extensions-type": { "description": "The extensions field must be of type object", "severity": "error", "given": "$.spec.extensions", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-type": { "description": "The webm-gateway field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-apiVersion-type": { "description": "The apiVersion field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.apiVersion", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-type": { "description": "The spec field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-authenticationMode-type": { "description": "The authenticationMode field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.authenticationMode", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-authenticationMode-enum": { "description": "The authenticationMode field must be one of: ANY, ALL", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.authenticationMode", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "ANY", "ALL" ] } } } }, "$-spec-extensions-webm-gateway-spec-allowAnonymous-type": { "description": "The allowAnonymous field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.allowAnonymous", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-allowAnonymous-no-additional-properties": { "description": "The allowAnonymous object should only contain the defined properties: ", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.allowAnonymous", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": {} } } } }, "$-spec-extensions-webm-gateway-spec-triggerPolicyViolation-type": { "description": "The triggerPolicyViolation field must be of type boolean", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.triggerPolicyViolation", "then": { "function": "schema", "functionOptions": { "schema": { "type": "boolean" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-type": { "description": "The accessControl field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-type": { "description": "The kerberos field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-applicationSecurity-type": { "description": "The applicationSecurity field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos.applicationSecurity", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-applicationSecurity-mode-type": { "description": "The mode field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos.applicationSecurity.mode", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-applicationSecurity-mode-enum": { "description": "The mode field must be one of: authorize, identify, authenticate", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos.applicationSecurity.mode", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "authorize", "identify", "authenticate" ] } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-applicationSecurity-no-additional-properties": { "description": "The applicationSecurity object should only contain the defined properties: mode", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos.applicationSecurity", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "mode": {} } } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-servicePrincipleName-type": { "description": "The servicePrincipleName field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos.servicePrincipleName", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-servicePrinciplePassword-type": { "description": "The servicePrinciplePassword field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos.servicePrinciplePassword", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-kerberos-no-additional-properties": { "description": "The kerberos object should only contain the defined properties: applicationSecurity, servicePrincipleName, servicePrinciplePassword", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.kerberos", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "applicationSecurity": {}, "servicePrincipleName": {}, "servicePrinciplePassword": {} } } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-openIdConnect-type": { "description": "The openIdConnect field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.openIdConnect", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-openIdConnect-applicationSecurity-type": { "description": "The applicationSecurity field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.openIdConnect.applicationSecurity", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-openIdConnect-applicationSecurity-mode-type": { "description": "The mode field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.openIdConnect.applicationSecurity.mode", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-openIdConnect-applicationSecurity-mode-enum": { "description": "The mode field must be one of: authorize, identify, authenticate", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.openIdConnect.applicationSecurity.mode", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "authorize", "identify", "authenticate" ] } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-openIdConnect-applicationSecurity-no-additional-properties": { "description": "The applicationSecurity object should only contain the defined properties: mode", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.openIdConnect.applicationSecurity", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "mode": {} } } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-openIdConnect-no-additional-properties": { "description": "The openIdConnect object should only contain the defined properties: applicationSecurity", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.openIdConnect", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "applicationSecurity": {} } } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-type": { "description": "The payloadElement field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-applicationSecurity-type": { "description": "The applicationSecurity field must be of type object", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement.applicationSecurity", "then": { "function": "schema", "functionOptions": { "schema": { "type": "object" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-applicationSecurity-mode-type": { "description": "The mode field must be of type string", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement.applicationSecurity.mode", "then": { "function": "schema", "functionOptions": { "schema": { "type": "string" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-applicationSecurity-mode-enum": { "description": "The mode field must be one of: authorize, identify, authenticate", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement.applicationSecurity.mode", "then": { "function": "schema", "functionOptions": { "schema": { "enum": [ "authorize", "identify", "authenticate" ] } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-applicationSecurity-no-additional-properties": { "description": "The applicationSecurity object should only contain the defined properties: mode", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement.applicationSecurity", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "mode": {} } } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-payLoadIdentifier-type": { "description": "The payLoadIdentifier field must be of type array", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement.payLoadIdentifier", "then": { "function": "schema", "functionOptions": { "schema": { "type": "array" } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-payloadElement-no-additional-properties": { "description": "The payloadElement object should only contain the defined properties: applicationSecurity, payLoadIdentifier", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl.payloadElement", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "applicationSecurity": {}, "payLoadIdentifier": {} } } } } }, "$-spec-extensions-webm-gateway-spec-accessControl-no-additional-properties": { "description": "The accessControl object should only contain the defined properties: kerberos, openIdConnect, payloadElement", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec.accessControl", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "kerberos": {}, "openIdConnect": {}, "payloadElement": {} } } } } }, "$-spec-extensions-webm-gateway-spec-no-additional-properties": { "description": "The spec object should only contain the defined properties: authenticationMode, allowAnonymous, triggerPolicyViolation, accessControl", "severity": "error", "given": "$.spec.extensions.webm-gateway.spec", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "authenticationMode": {}, "allowAnonymous": {}, "triggerPolicyViolation": {}, "accessControl": {} } } } } }, "$-spec-extensions-webm-gateway-no-additional-properties": { "description": "The webm-gateway object should only contain the defined properties: apiVersion, spec", "severity": "error", "given": "$.spec.extensions.webm-gateway", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "apiVersion": {}, "spec": {} } } } } }, "spec-no-additional-properties": { "description": "The spec object should only contain the defined properties: accessControl, extensions", "severity": "error", "given": "$.spec", "then": { "function": "schema", "functionOptions": { "schema": { "additionalProperties": false, "properties": { "accessControl": {}, "extensions": {} } } } } } } };