@apistudio/apim-cli
Version:
CLI for API Management Products
1,409 lines (1,407 loc) • 191 kB
JavaScript
// Function to get combined ruleset data
export {};
/*export function getCombinedRuleset(): Record<string, any> {
return {
"api.ibm.com_v1_api.ruleset.yaml": {
"rules": {
"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 one of 'API' | 'CORS' | 'Quota' | 'Product' | 'Plan' | 'StagedPolicySequence' | 'Scope' | 'ValidateAPISpecification' | 'Project' | 'URISchemes' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'InvokeAWSLambda' | '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' | 'FreeFlowPolicySequence' | 'Switch' | 'If' | 'Try' | 'JavaScript' | 'LuaScript' | 'EnforceCircuitBreaker' | 'TokenMediation' | 'block' ",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "schema",
"functionOptions": {
"schema": {
"type": "string",
"enum": ["API", "CORS", "Quota", "Product", "Plan", "StagedPolicySequence",
"Scope", "ValidateAPISpecification", "Project", "URISchemes",
"Telemetry", "Properties", "LoadBalancer", "InvokeAWSLambda",
"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", "FreeFlowPolicySequence",
"Switch", "If", "Try", "JavaScript", "LuaScript",
"EnforceCircuitBreaker", "TokenMediation", "block"]
}
}
}
},
"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",
"resolved": false,
"then": {
"field": "tags",
"function": "schema",
"functionOptions": {
"schema": {
"type": "array"
}
}
}
},
"valid-api-spec": {
"description": "The spec object must contain api-spec with $path as a string.",
"severity": "error",
"given": "$.spec.api-spec",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"required": ["$path"],
"properties": {
"$path": { "type": "string" }
},
"additionalProperties": false
}
}
}
},
"valid-uri-schemes": {
"description": "The uriSchemes field must be a reference to a valid UriSchemes object with $ref",
"severity": "error",
"given": "$.spec.uriSchemes",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"required": ["$ref"],
"properties": {
"$ref": { "type": "string" }
},
"additionalProperties": false
}
}
}
},
"valid-policy-sequence": {
"description": "The policy-sequence field is required and must be an array of objects containing $ref as a string.",
"severity": "error",
"given": "$.spec.policy-sequence",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "array",
"items": {
"type": "object",
"required": ["$ref"],
"properties": {
"$ref": { "type": "string" }
},
"additionalProperties": false
}
}
}
}
},
"no-extra-spec-keys": {
"description": "The spec object is missing the required attribute - api-spec",
"severity": "error",
"given": "$.spec",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"required": ["api-spec"],
"properties": {
"api-spec": { "type": "object"},
},
"additionalProperties": true
}
}
}
}
}
},
"api.ibm.com_v1_cors.ruleset.yaml": {
"rules": {
"kind-not-exist": {
"description": "Kind does not exist.",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "truthy"
}
},
"invalid-kind-value": {
"description": "Kind must be one of 'API' | 'CORS' | 'Quota' | 'Product' | 'Plan' | 'StagedPolicySequence' | 'Scope' | 'ValidateAPISpecification' | 'Project' | 'URISchemes' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'InvokeAWSLambda' | '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' | 'FreeFlowPolicySequence' | 'Switch' | 'If' | 'Try' | 'JavaScript' | 'LuaScript' | 'EnforceCircuitBreaker' | 'TokenMediation' | 'block' ",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "schema",
"functionOptions": {
"schema": {
"type": "string",
"enum": ["API", "CORS", "Quota", "Product", "Plan", "StagedPolicySequence",
"Scope", "ValidateAPISpecification", "Project", "URISchemes",
"Telemetry", "Properties", "LoadBalancer", "InvokeAWSLambda",
"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", "FreeFlowPolicySequence",
"Switch", "If", "Try", "JavaScript", "LuaScript",
"EnforceCircuitBreaker", "TokenMediation", "block"]
}
}
}
},
"invalid-kind-spl-character": {
"description": "Kind should not be empty or contain only special characters",
"severity": "error",
"given": "$",
"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": "$",
"then": {
"field": "apiVersion",
"function": "truthy"
}
},
"metadata-not-exist": {
"description": "Metadata does not exist.",
"severity": "error",
"given": "$",
"then": {
"field": "metadata",
"function": "truthy"
}
},
"metadata-name-not-exist": {
"description": "Metadata name does not exist",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "name",
"function": "truthy"
}
},
"metadata-name-whitelist-check": {
"description": "Metadata name should not be empty or contain only special characters",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "name",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-version-not-exist": {
"description": "Metadata version does not exist",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "version",
"function": "truthy"
}
},
"metadata-version-whitelist-check": {
"description": "Metadata version should not be empty or contain only special characters",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "version",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-namespace-not-exist": {
"description": "Metadata namespace does not exist",
"severity": "warn",
"given": "$.metadata",
"then": {
"field": "namespace",
"function": "truthy"
}
},
"metadata-namespace-whitelist-check": {
"description": "Metadata namespace should not be empty or contain only special characters",
"severity": "warn",
"given": "$.metadata",
"then": {
"field": "namespace",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"spec-details-not-exist": {
"description": "Spec details does not exist",
"severity": "error",
"given": "$",
"then": {
"field": "spec",
"function": "truthy"
}
},
"tags-not-exist": {
"description": "Tag does not exist",
"severity": "warn",
"given": "$.metadata",
"then": {
"field": "tags",
"function": "truthy"
}
},
"invalid-tag-type": {
"description": "Invalid Tag Type (must be array)",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "tags",
"function": "schema",
"functionOptions": {
"schema": {
"type": "array"
}
}
}
},
"cors-spec-rules-required": {
"description": "The 'spec.rules' field must be an array with at least one rule.",
"severity": "error",
"given": "$.spec",
"then": {
"field": "rules",
"function": "length",
"functionOptions": {
"min": 1
}
}
},
"cors-rules-action-valid": {
"description": "Each rule must contain a valid 'action' value (allow or deny).",
"severity": "error",
"given": "$.spec.rules[*].action",
"then": {
"function": "enumeration",
"functionOptions": {
"values": ["allow", "deny"]
}
}
},
"cors-rules-originlist-required": {
"description": "Each rule must include an 'originList' with at least one origin.",
"severity": "error",
"given": "$.spec.rules[*].originList",
"then": {
"function": "length",
"functionOptions": {
"min": 1
}
}
},
"cors-rules-maxage-range": {
"description": "The 'maxAge' must be an integer between 0 and 4294967295.",
"severity": "error",
"given": "$.spec.rules[*].maxAge",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
}
}
},
"cors-rules-allowmethods-unique": {
"description": "The 'allowMethods' array must not contain duplicates.",
"severity": "warn",
"given": "$.spec.rules[*].allowMethods",
"then": {
"function": "uniqueItems"
}
},
"cors-rules-exposeheaders-structure": {
"description": "The 'exposeHeaders' object may only contain 'predefined', 'custom', or 'backend'.",
"severity": "error",
"given": "$.spec.rules[*].exposeHeaders",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"predefined": { "type": "boolean" },
"custom": { "type": "string" },
"backend": { "type": "boolean" }
}
}
}
}
}
}
},
"api.ibm.com_v1_invoke.ruleset.yaml": {
"rules": {
"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 one of 'API' | 'CORS' | 'Quota' | 'Product' | 'Plan' | 'StagedPolicySequence' | 'Scope' | 'ValidateAPISpecification' | 'Project' | 'URISchemes' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'InvokeAWSLambda' | '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' | 'FreeFlowPolicySequence' | 'Switch' | 'If' | 'Try' | 'JavaScript' | 'LuaScript' | 'EnforceCircuitBreaker' | 'TokenMediation' | 'block' ",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "schema",
"functionOptions": {
"schema": {
"type": "string",
"enum": ["API", "CORS", "Quota", "Product", "Plan", "StagedPolicySequence",
"Scope", "ValidateAPISpecification", "Project", "URISchemes",
"Telemetry", "Properties", "LoadBalancer", "InvokeAWSLambda",
"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", "FreeFlowPolicySequence",
"Switch", "If", "Try", "JavaScript", "LuaScript",
"EnforceCircuitBreaker", "TokenMediation", "block"]
}
}
}
},
"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.",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "metadata",
"function": "truthy"
}
},
"metadata-whitelist-check": {
"description": "Metadata should not be having empty or special characters",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "metadata",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-name-not-exist": {
"description": "Metadata name does not exist",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "name",
"function": "truthy"
}
},
"metadata-name-whitelist-check": {
"description": "Metadata name should not be having empty or special characters",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "name",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-version-not-exist": {
"description": "Metadata version does not exist",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "version",
"function": "truthy"
}
},
"metadata-version-whitelist-check": {
"description": "Metadata version should not be having empty or special characters",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "version",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-namespace-not-exist": {
"description": "Metadata namespace does not exist",
"given": "$.metadata",
"severity": "warn",
"resolved": false,
"then": {
"field": "namespace",
"function": "truthy"
}
},
"metadata-namespace-whitelist-check": {
"description": "Metadata namespace should not be having empty or special characters",
"given": "$.metadata",
"severity": "warn",
"resolved": false,
"then": {
"field": "namespace",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"spec-details-not-exist": {
"description": "Spec details does not exist",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "spec",
"function": "truthy"
}
},
"spec-details-whitelist-check": {
"description": "Spec should not be having empty or special characters",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "spec",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"tags-not-exist": {
"description": "Tag does not exist",
"given": "$.metadata",
"severity": "warn",
"resolved": false,
"then": {
"field": "tags",
"function": "truthy"
}
},
"invalid-tag-type": {
"description": "Invalid Tag Type",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "tags",
"function": "schema",
"functionOptions": {
"schema": {
"type": "array"
}
}
}
},
"validate-spec": {
"description": "The 'spec' object must contain endpoint.",
"given": "$.spec",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"required": ["endpoint"]
}
}
}
},
"validate-verb": {
"description": "HTTP contains a verb, and it must be a string with allowed values",
"given": "$.spec.endpoint.http",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"required": ["verb"],
"properties": {
"verb": {
"type": "string",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH", "CUSTOM", "KEEP"]
}
}
}
}
}
},
"validate-target": {
"description": "The target must be an object with required field 'url'",
"given": "$.spec.endpoint.http",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"required": ["target"],
"properties": {
"target": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string"
},
"timeout": {
"type": "integer"
}
}
}
},
"additionalProperties": true
}
}
}
}, "validate-input-output": {
"description": "input and output must be strings if present",
"given": "$.spec",
"severity": "warn",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"properties": {
"input": {
"type": "string"
},
"output": {
"type": "string"
}
}
}
}
}
},
"validate-cache-expire": {
"description": "cache.expire must match one of the allowed formats",
"given": "$.spec.cache.expire",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"oneOf": [
{
"type": "object",
"required": ["fromMessageHeader"],
"properties": {
"fromMessageHeader": {
"type": "object",
"required": ["headerName", "messageName"],
"properties": {
"headerName": { "type": "string" },
"messageName": { "type": "string" }
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": ["fromVariable"],
"properties": {
"fromVariable": {
"type": "object",
"required": ["name"],
"properties": {
"name": { "type": "string" }
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": ["static"],
"properties": {
"static": {
"type": "object",
"required": ["seconds"],
"properties": {
"seconds": {
"type": "integer",
"minimum": 0
}
}
}
},
"additionalProperties": false
}
]
}
}
}
},
"validate-cache-scope": {
"description": "cache.scope must be narrowScope or wideScope",
"given": "$.spec.cache.scope",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"oneOf": [
{
"type": "object",
"required": ["narrowScope"],
"properties": {
"narrowScope": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": ["wideScope"],
"properties": {
"wideScope": {
"type": "object",
"required": ["scopeId"],
"properties": {
"scopeId": {
"type": "string"
}
}
}
},
"additionalProperties": false
}
]
}
}
}
},
"validate-urlType": {
"description": "urlType must be one of plain, variables, jsonata",
"given": "$.spec.endpoint.http.target",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"properties": {
"urlType": {
"type": "string",
"enum": ["plain", "variables", "jsonata"]
}
}
}
}
}
},
"validate-version": {
"description": "HTTP version must be one of HTTP/1.0, HTTP/1.1, or HTTP/2",
"given": "$.spec.endpoint.http.target",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"properties": {
"version": {
"type": "string",
"enum": ["HTTP/1.0", "HTTP/1.1", "HTTP/2"]
}
}
}
}
}
},
}
},
"api.ibm.com_v1_urischemes.ruleset.yaml": {
"rules": {
"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 one of 'API' | 'CORS' | 'Quota' | 'Product' | 'Plan' | 'StagedPolicySequence' | 'Scope' | 'ValidateAPISpecification' | 'Project' | 'URISchemes' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'InvokeAWSLambda' | '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' | 'FreeFlowPolicySequence' | 'Switch' | 'If' | 'Try' | 'JavaScript' | 'LuaScript' | 'EnforceCircuitBreaker' | 'TokenMediation' | 'block' ",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "schema",
"functionOptions": {
"schema": {
"type": "string",
"enum": ["API", "CORS", "Quota", "Product", "Plan", "StagedPolicySequence",
"Scope", "ValidateAPISpecification", "Project", "URISchemes",
"Telemetry", "Properties", "LoadBalancer", "InvokeAWSLambda",
"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", "FreeFlowPolicySequence",
"Switch", "If", "Try", "JavaScript", "LuaScript",
"EnforceCircuitBreaker", "TokenMediation", "block"]
}
}
}
},
"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.",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "metadata",
"function": "truthy"
}
},
"metadata-whitelist-check": {
"description": "Metadata should not be having empty or special characters",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "metadata",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-name-not-exist": {
"description": "Metadata name does not exist",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "name",
"function": "truthy"
}
},
"metadata-name-whitelist-check": {
"description": "Metadata name should not be having empty or special characters",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "name",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-version-not-exist": {
"description": "Metadata version does not exist",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "version",
"function": "truthy"
}
},
"metadata-version-whitelist-check": {
"description": "Metadata version should not be having empty or special characters",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "version",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-namespace-not-exist": {
"description": "Metadata namespace does not exist",
"given": "$.metadata",
"severity": "warn",
"resolved": false,
"then": {
"field": "namespace",
"function": "truthy"
}
},
"metadata-namespace-whitelist-check": {
"description": "Metadata namespace should not be having empty or special characters",
"given": "$.metadata",
"severity": "warn",
"resolved": false,
"then": {
"field": "namespace",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"spec-details-not-exist": {
"description": "Spec details does not exist",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "spec",
"function": "truthy"
}
},
"spec-details-whitelist-check": {
"description": "Spec should not be having empty or special characters",
"given": "$",
"severity": "error",
"resolved": false,
"then": {
"field": "spec",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"tags-not-exist": {
"description": "Tag does not exist",
"given": "$.metadata",
"severity": "warn",
"resolved": false,
"then": {
"field": "tags",
"function": "truthy"
}
},
"invalid-tag-type": {
"description": "Invalid Tag Type (must be an array)",
"given": "$.metadata",
"severity": "error",
"resolved": false,
"then": {
"field": "tags",
"function": "schema",
"functionOptions": {
"schema": {
"type": "array"
}
}
}
},
"uriSchemes-not-exist": {
"description": "uriSchemes is missing",
"given": "$.spec",
"severity": "error",
"then": {
"field": "uriSchemes",
"function": "truthy"
}
},
"uriSchemes-invalid-type": {
"description": "uriSchemes should be an array of strings",
"given": "$.spec",
"severity": "error",
"then": {
"field": "uriSchemes",
"function": "schema",
"functionOptions": {
"schema": {
"type": "array",
"items": { "type": "string" }
}
}
}
},
"uriSchemes-invalid-values": {
"description": "uriSchemes should only contain http or https",
"given": "$.spec.uriSchemes[*]",
"severity": "error",
"then": {
"function": "pattern",
"functionOptions": {
"match": "^(http|https)$"
}
}
},
"spec-invalid-fields": {
"description": "spec should contain uriSchemes with http",
"given": "$.spec",
"severity": "error",
"then": {
"function": "schema",
"functionOptions": {
"schema": {
"type": "object",
"properties": {
"uriSchemes": {
"type": "array",
"items": {
"type": "string",
"enum": ["http", "https"]
}
}
},
"required": ["uriSchemes"]
}
}
}
}
}
}
,
"api.ibm.com_v1_stagedpolicysequence.ruleset.yaml": {
"rules": {
"kind-not-exist": {
"description": "Kind does not exist.",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "truthy"
}
},
"invalid-kind-value": {
"description": "Kind must be one of 'API' | 'CORS' | 'Quota' | 'Product' | 'Plan' | 'StagedPolicySequence' | 'Scope' | 'ValidateAPISpecification' | 'Project' | 'URISchemes' | 'Telemetry' | 'Properties' | 'LoadBalancer' | 'InvokeAWSLambda' | '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' | 'FreeFlowPolicySequence' | 'Switch' | 'If' | 'Try' | 'JavaScript' | 'LuaScript' | 'EnforceCircuitBreaker' | 'TokenMediation' | 'block' ",
"severity": "error",
"given": "$",
"then": {
"field": "kind",
"function": "schema",
"functionOptions": {
"schema": {
"type": "string",
"enum": ["API", "CORS", "Quota", "Product", "Plan", "StagedPolicySequence",
"Scope", "ValidateAPISpecification", "Project", "URISchemes",
"Telemetry", "Properties", "LoadBalancer", "InvokeAWSLambda",
"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", "FreeFlowPolicySequence",
"Switch", "If", "Try", "JavaScript", "LuaScript",
"EnforceCircuitBreaker", "TokenMediation", "block"]
}
}
}
},
"invalid-kind-spl-character": {
"description": "Kind should not be empty or contain special characters",
"severity": "error",
"given": "$",
"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": "$",
"then": {
"field": "apiVersion",
"function": "truthy"
}
},
"metadata-not-exist": {
"description": "Metadata does not exist.",
"severity": "error",
"given": "$",
"then": {
"field": "metadata",
"function": "truthy"
}
},
"metadata-name-not-exist": {
"description": "Metadata name does not exist",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "name",
"function": "truthy"
}
},
"metadata-name-whitelist-check": {
"description": "Metadata name should not be empty or contain only special characters",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "name",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W_]+$).+$"
}
}
},
"metadata-version-not-exist": {
"description": "Metadata version does not exist",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "version",
"function": "truthy"
}
},
"metadata-version-whitelist-check": {
"description": "Metadata version should not be empty or contain only special characters",
"severity": "error",
"given": "$.metadata",
"then": {
"field": "version",
"function": "pattern",
"functionOptions": {
"match": "^(?![\\s\\W