From 272080495ed591878c469c818e7df14730f2df6f Mon Sep 17 00:00:00 2001 From: Albert Lombarte Date: Thu, 16 Nov 2023 18:34:08 +0100 Subject: [PATCH 1/5] Openapi features for 2.5 --- v2.5/.test.json.ignore | 33 +++++- v2.5/.test_e2e.json.ignore | 16 ++- v2.5/documentation/openapi.json | 79 +++++++++++++- v2.5/e2e.json | 175 +++++++++++++++++++++++++++++++- 4 files changed, 295 insertions(+), 8 deletions(-) diff --git a/v2.5/.test.json.ignore b/v2.5/.test.json.ignore index 39aafb4..d177d11 100644 --- a/v2.5/.test.json.ignore +++ b/v2.5/.test.json.ignore @@ -383,6 +383,14 @@ "foo": "bar" } } + }, + "request_definition": { + "@comment": "Some comment", + "description": "Page not found", + "example": { + "status": "KO" + }, + "content_type": "application/json" } }, "validation/cel": [ @@ -1775,7 +1783,30 @@ "schemes": [ "http", "https" - ] + ], + "components_schemas": { + "Pet": "ewogICAgICAgICJ0eXBlIjogIm9iamVjdCIsCiAgICAgICAgInJlcXVpcmVkIjogWwogICAgICAgICAgImlkIiwKICAgICAgICAgICJuYW1lIgogICAgICAgIF0sCiAgICAgICAgInByb3BlcnRpZXMiOiB7CiAgICAgICAgICAiaWQiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImludGVnZXIiLAogICAgICAgICAgICAiZm9ybWF0IjogImludDY0IgogICAgICAgICAgfSwKICAgICAgICAgICJuYW1lIjogewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciCiAgICAgICAgICB9LAogICAgICAgICAgInRhZyI6IHsKICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQ==", + "Pot": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + + } }, "auth/api-keys": { "strategy": "header", diff --git a/v2.5/.test_e2e.json.ignore b/v2.5/.test_e2e.json.ignore index d27534a..089a517 100644 --- a/v2.5/.test_e2e.json.ignore +++ b/v2.5/.test_e2e.json.ignore @@ -32,5 +32,19 @@ } } } - } + }, + "next": [ + { + "in": { + "method": "GET", + "url": "http://localhost:8080/test/rate-limit-stateless", + "header": { + "User-Agent": "krakend e2e tool" + } + }, + "out": { + "status_code": 503 + } + } + ] } \ No newline at end of file diff --git a/v2.5/documentation/openapi.json b/v2.5/documentation/openapi.json index a21efb3..cfc62a8 100644 --- a/v2.5/documentation/openapi.json +++ b/v2.5/documentation/openapi.json @@ -9,6 +9,30 @@ "^[@$_#]": {} }, "properties": { + "components_schemas": { + "$id": "#documentation/openapi/components_schemas", + "type": "object", + "title": "Component Schemas", + "description": "The JSON Schemas you can reuse inside endpoint definitions using `ref`. You can either pass the JSON Schema object, or a bas64 string.", + "examples": [ + { + "Pet": { + "type": "object", + "required": [ + "id", + "name" + ] + } + } + ], + "patternProperties":{ + ".*": { + "title": "JSON Schema", + "description": "JSON Schema in base64 or as an object", + "type":["string","object"] + } + } + }, "description": { "$id": "#documentation/openapi/description", "title": "API Description", @@ -149,7 +173,7 @@ ] }, "response_definition": { - "$id": "#documentation/openapi/error_definition", + "$id": "#documentation/openapi/response_definition", "title": "Definition of errors (OAS3 only)", "description": "Describes the different status codes returned by this endpoint. Each key is the definition of the status code, represented by a string. E.g., `200` (success), `500` (internal error), etc.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", "type": [ @@ -200,6 +224,59 @@ } } } + }, + "request_definition": { + "$id": "#documentation/openapi/request_definition", + "title": "Definition of a request (OAS3 only)", + "description": "Describes the request needed to consume the endpoint. If a JSON Schema validation exists, it takes precedence when generating the documentation. An example use case is when you need to document a `multipart/form-data` request body.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/", + "type": [ + "object" + ], + "examples": [ + { + + "@comment": "Some comment", + "description": "Page not found", + "example": { + "status": "KO" + }, + "content_type": "application/json" + } + ], + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "required": ["content_type"], + "properties": { + "ref": { + "type": "string", + "title": "Reference", + "description": "The relative reference to the `components/schema` OpenAPI definition that will be used as definition of the accepted request.", + "examples": ["#/mydef"] + + }, + "description": { + "type": ["string"], + "title": "Description", + "description": "The description of the payload this endpoint accepts.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/" + }, + "example_schema": { + "type": ["string"], + "pattern": "^[a-zA-Z0-9+/=_-]+$", + "description": "A JSON schema that describes the response format for the selected status code, encoded as a base64 string. Use either example or example_schema, but not both." + }, + "example": { + "type": ["string","object","array","boolean","integer","null","number"], + "title": "Content Type", + "description": "A free form JSON object or a string you would like to show as a sample response of the endpoint. The examples assume they are JSON content types except when using the `output_encoding=string`.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/" + }, + "content_type": { + "type": "string", + "title": "Content Type", + "description": "The content type returned by this error, e.g., `application/json`" + } + } } } } \ No newline at end of file diff --git a/v2.5/e2e.json b/v2.5/e2e.json index 3fa0a5b..9f35d2d 100644 --- a/v2.5/e2e.json +++ b/v2.5/e2e.json @@ -1,5 +1,4 @@ { - "definitions": {}, "$schema": "http://json-schema.org/draft-07/schema#", "title": "Schema validation for End To End testing specs", "type": "object", @@ -14,7 +13,7 @@ "properties": { "in": { "title": "Input", - "description": "The parameters used to build the request to a running KrakenD with your configuration", + "description": "The input request definition. At least you should define the URL used to connect to KrakenD", "type": "object", "required": [ "url" @@ -47,7 +46,7 @@ }, "header": { "title": "Headers", - "description": "An optional map of headers to include in the request.", + "description": "An optional map of headers you want to include in the request.", "type": "object", "examples": [ { @@ -57,7 +56,7 @@ }, "body": { "title": "Body", - "description": "An optional payload you can send in the request as data.", + "description": "If you want to add a payload in the request, set its body here", "type": [ "object", "array", @@ -104,7 +103,7 @@ }, "body": { "title": "Body", - "description": "The expected returned body by the response as a string or JSON object. Remove this body field when you don’t want to check its contents, when the response does not have a body, or when you want to use the schema instead.", + "description": "The expected returned body by the response as a string or JSON object. Remove this body field when you don't want to check its contents, when the response does not have a body, or when you want to use the schema instead.", "type": [ "string", "object" @@ -146,6 +145,172 @@ "$ref": "http://json-schema.org/draft-07/schema#" } } + }, + "next": { + "description": "Additional checks, in sequential order, of `in` and `out` definitions. The outter `in` and `out` are always executed first.", + "type": "array", + "items": { + "minItems": 1, + "required": [ + "in", + "out" + ], + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "properties": { + "in": { + "title": "Input", + "description": "The input request definition. At least you should define the URL used to connect to KrakenD", + "type": "object", + "required": [ + "url" + ], + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "properties": { + "method": { + "title": "Method", + "description": "The method sent in the request", + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE" + ], + "default": "GET" + }, + "url": { + "title": "URL", + "description": "The full URL you want to use in the request, including schema, host, port, path, and any additional query string parameters you might need.", + "type": "string", + "examples": [ + "http://localhost:8080/__debug/something" + ] + }, + "header": { + "title": "Headers", + "description": "An optional map of headers you want to include in the request.", + "type": "object", + "examples": [ + { + "User-Agent": "krakend e2e tool" + } + ] + }, + "body": { + "title": "Body", + "description": "If you want to add a payload in the request, set its body here", + "type": [ + "object", + "array", + "string" + ] + } + } + }, + "out": { + "title": "Output", + "description": "The expected response from the server", + "type": "object", + "anyOf": [ + { + "required": [ + "status_code" + ] + }, + { + "required": [ + "status_code", + "body" + ] + }, + { + "required": [ + "status_code", + "schema" + ] + } + ], + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "properties": { + "status_code": { + "title": "Status code", + "description": "The integer value of the HTTP status code returned by the server.", + "type": "integer", + "examples": [ + 200 + ] + }, + "body": { + "title": "Body", + "description": "The expected returned body by the response as a string or JSON object. Remove this body field when you don't want to check its contents, when the response does not have a body, or when you want to use the schema instead.", + "type": [ + "string", + "object" + ], + "examples": [ + "http://localhost:8080/__debug/something" + ] + }, + "header": { + "title": "Headers", + "description": "Checks that all headers included in the response match the provided values. You only need to declare the relevant headers you want, as the rest are ignored. As headers, by RFC definition, can be multiple, you must always use an array to express the values you want to check. You can also check that **a specific header does not exist** in the response declaring an empty value `[\"\"]`.", + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "examples": [ + { + "content-type": [ + "application/json; charset=utf-8" + ], + "Cache-Control": [ + "" + ], + "X-Krakend-Completed": [ + "true" + ] + } + ] + }, + "schema": { + "title": "JSON Schema", + "description": "A JSON Schema object that validates the response. This option allows you to work with responses that the literal value is not that important and you want to check the structure of the returned document instead. If the response matches the schema definition, the test passes. If you define a `schema` and a `body` simultaneously only the schema is validated.", + "type": "object", + "$ref": "http://json-schema.org/draft-07/schema#" + } + } + } + } + }, + "examples": [ + { + "next": [ + { + "in": {}, + "out": {} + }, + { + "in": {}, + "out": {} + } + ] + } + ] } } } \ No newline at end of file From e8c98d2449f0081df84384e244c056fa50d45afe Mon Sep 17 00:00:00 2001 From: Albert Lombarte Date: Fri, 17 Nov 2023 18:40:29 +0100 Subject: [PATCH 2/5] Add Extended Flexible Config schema --- flexible_config.json | 6 ++ v2.5/.test_flexible_config.ignore | 28 ++++++ v2.5/flexible_config.json | 148 ++++++++++++++++++++++++++++++ v2.5/modifier/lua.json | 2 +- v2.5/tls.json | 4 +- 5 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 flexible_config.json create mode 100644 v2.5/.test_flexible_config.ignore create mode 100644 v2.5/flexible_config.json diff --git a/flexible_config.json b/flexible_config.json new file mode 100644 index 0000000..47c036f --- /dev/null +++ b/flexible_config.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://www.krakend.io/schema/flexible_config.json", + "title": "Schema validation for the latest version of Extended Flexible Configuration. Consider sticking to the specific version you are using.", + "$ref": "v2.5/flexible_config.json" +} \ No newline at end of file diff --git a/v2.5/.test_flexible_config.ignore b/v2.5/.test_flexible_config.ignore new file mode 100644 index 0000000..6daa0ed --- /dev/null +++ b/v2.5/.test_flexible_config.ignore @@ -0,0 +1,28 @@ +{ + "$schema": "./flexible_config.json", + "@comment": "Makes sure that the debug endpoint returns a status ok", + "settings": { + "paths": [ + "settings" + ], + "allow_overwrite": true, + "dir_field_prefix": "", + "allowed_suffixes": [ + ".yaml", + ".json" + ] + }, + "partials": { + "paths": [ + "partials" + ] + }, + "templates": { + "paths": [ + "templates" + ] + }, + "meta_key": "meta", + "out": "result.json", + "debug": true +} \ No newline at end of file diff --git a/v2.5/flexible_config.json b/v2.5/flexible_config.json new file mode 100644 index 0000000..f1c2e34 --- /dev/null +++ b/v2.5/flexible_config.json @@ -0,0 +1,148 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Schema validation for Extended Flexible Configuration.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "object", + "required": [ + "in", + "out" + ], + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "properties": { + "partials": { + "title": "Partials", + "description": "When needed, the partials are treated as raw text files, and they are inserted in the placeholder 'as is', and no template evaluation of its content is performed.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "properties": { + "paths": { + "title": "Paths to partials dirs", + "description": "The [relative](/docs/enterprise/configuration/working-directory/) or absolute paths to the partials directories, each entry is a different path. Contents are scanned **recursively**.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "array", + "default": [], + "examples": [ + ["partials"] + ], + "items": { + "type": "string" + } + } + } + }, + "templates": { + "title": "Templates", + "description": "The location of the Go templates you want to use to express your configuration.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "object", + "examples": [ + ["templates"] + ], + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "properties": { + "paths": { + "title": "Paths to templates dirs", + "description": "The [relative](/docs/enterprise/configuration/working-directory/) or absolute paths to the templates directories, each entry is a different path. You might have multiple directories when you have templates shared across environments or projects, and then you have dedicated templates for the running environment. Defaults to not use any templates directory. Contents are scanned **recursively**.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "array", + "default": [], + "examples": [ + "templates" + ], + "items": { + "type": "string" + } + } + } + }, + "settings": { + "title": "Settings", + "description": "Settings are files expressed in JSON, YAML, ENV, TOML, INI or properties (Java) formats that are parsed and available as a tree like `.filename` inside the templates.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[@$_#]": {} + }, + "examples": [["settings/production","settings/common"]], + "properties": { + "paths": { + "title": "Paths to settings dirs", + "description": "The [relative](/docs/enterprise/configuration/working-directory/) or absolute paths to the settings directories, each entry is a different path. Contents are scanned **recursively**.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "array", + "default": [], + "examples": [ + "settings" + ], + "items": { + "type": "string" + } + }, + "allow_overwrite": { + "title": "Allow overwrite", + "description": "When the settings tree is converted to a traversable variable, whether to accept that another path that resolves to the same tree path can override a previous one or not.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "boolean", + "default": false + }, + "dir_field_prefix": { + "title": "Directory prefix", + "description": "When converting the settings tree into a traversable variable, add a prefix to directory names.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "string", + "examples": [ + "dir_" + ], + "default": "" + }, + "allowed_suffixes": { + "title": "Allowed suffixes", + "description": "The list of file suffixes you want the parser to take into account. Non-matching files are ignored and unavailable in the templates.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + ".yaml", + ".json", + "krakend.env" + ] + ], + "default": [ + ".yaml", + ".yml", + ".json", + ".toml", + ".tml", + ".ini", + ".dotenv", + ".env", + ".properties", + ".prop", + ".props" + ] + } + } + }, + "meta_key": { + "title": "Metadata key", + "description": "The name of the variable you have available on templates containing the metadata tree of settings involved in the configuration. You can access to this variable with a starting dot, e.g., `{{ .meta }}`.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "string", + "default": "meta" + }, + "out": { + "title": "Output file", + "description": "It specifies a filename where the result of compiling the templates is stored. The directory and the filename you use must be writeable by the KrakenD process. It has no other purpose than debugging the resulting template.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "type": "string", + "default": "" + }, + "debug": { + "type": "boolean", + "title": "Debug", + "description": "Whether to enable the debug mode or not. The debug shows the hierarchy of the settings tree in the console. You can also enable this flag during runtime passing an environment variable `FC_DEBUG=true`.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/" + } + } +} \ No newline at end of file diff --git a/v2.5/modifier/lua.json b/v2.5/modifier/lua.json index 7c2dcf3..57e8cd7 100644 --- a/v2.5/modifier/lua.json +++ b/v2.5/modifier/lua.json @@ -12,7 +12,7 @@ "properties": { "sources": { "title": "Sources", - "description": "An array with all the Lua files that will be processed. If no path is provided (e.g., `myfile.lua`) the file loads from the working directory (same place you loaded the configuration, usually `/etc/krakend`)\n\nSee: https://www.krakend.io/docs/endpoints/lua/", + "description": "An array with all the Lua files that will be processed. If no path is provided (e.g., `myfile.lua`) the file loads from the [working directory](/docs/configuration/working-directory/).\n\nSee: https://www.krakend.io/docs/endpoints/lua/", "type": "array" }, "md5": { diff --git a/v2.5/tls.json b/v2.5/tls.json index 250d1d4..3178810 100644 --- a/v2.5/tls.json +++ b/v2.5/tls.json @@ -23,7 +23,7 @@ "public_key": { "$id": "#service/tls/public_key", "title": "Public key", - "description": "Absolute path to the public key, or relative to the current working directory.\n\nSee: https://www.krakend.io/docs/service-settings/tls/", + "description": "Absolute path to the public key, or relative to the current [working directory](/docs/configuration/working-directory/).\n\nSee: https://www.krakend.io/docs/service-settings/tls/", "type": "string", "default": "./certs/cert.pem", "examples": [ @@ -34,7 +34,7 @@ "private_key": { "$id": "#service/tls/private_key", "title": "Private key", - "description": "Absolute path to the private key, or relative to the current working directory.\n\nSee: https://www.krakend.io/docs/service-settings/tls/", + "description": "Absolute path to the private key, or relative to the current [working directory](/docs/configuration/working-directory/).\n\nSee: https://www.krakend.io/docs/service-settings/tls/", "type": "string", "default": "./certs/key.pem", "examples": [ From cea9617caa5aaa0f51614eb7d1bfa4708975d719 Mon Sep 17 00:00:00 2001 From: Albert Lombarte Date: Fri, 17 Nov 2023 20:50:19 +0100 Subject: [PATCH 3/5] Add undefined vars in EFC --- v2.5/flexible_config.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v2.5/flexible_config.json b/v2.5/flexible_config.json index f1c2e34..1dab00a 100644 --- a/v2.5/flexible_config.json +++ b/v2.5/flexible_config.json @@ -124,12 +124,19 @@ ".prop", ".props" ] + }, + "undefined_vars": { + "title": "Undefined variables behavior", + "description": "How to treat access to unexisting variables in the templates. When the value is `error` the template will fail to compile, when `zero` it will set a zero-value (e.g, empty string), and when the value is `invalid` it will replace the content with the string ``.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "default": "error", + "type": "string", + "enum": ["error", "zero", "invalid"] } } }, "meta_key": { "title": "Metadata key", - "description": "The name of the variable you have available on templates containing the metadata tree of settings involved in the configuration. You can access to this variable with a starting dot, e.g., `{{ .meta }}`.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", + "description": "The name of the variable you have available on templates containing the tree of files involved in the configuration (except partials). You can access to this variable with a starting dot, e.g., `{{ .meta }}`.\n\nSee: https://www.krakend.io/docs/enterprise/configuration/flexible-config/", "type": "string", "default": "meta" }, From ec86da9ca51220b5928646c4c2b4507faef984fc Mon Sep 17 00:00:00 2001 From: Albert Lombarte Date: Sat, 18 Nov 2023 13:33:46 +0100 Subject: [PATCH 4/5] Hash API keys --- v2.5/.test.json.ignore | 2 ++ v2.5/auth/api-keys.json | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/v2.5/.test.json.ignore b/v2.5/.test.json.ignore index d177d11..1cadb04 100644 --- a/v2.5/.test.json.ignore +++ b/v2.5/.test.json.ignore @@ -1811,6 +1811,8 @@ "auth/api-keys": { "strategy": "header", "identifier": "Authorization", + "hash": "plain", + "salt": "mySalt", "keys": [ { "key": "4d2c61e1-34c4-e96c-9456-15bd983c5019", diff --git a/v2.5/auth/api-keys.json b/v2.5/auth/api-keys.json index 220e247..5e8b282 100644 --- a/v2.5/auth/api-keys.json +++ b/v2.5/auth/api-keys.json @@ -20,6 +20,22 @@ "enum": ["header","query_string"], "default": "header" }, + "hash": { + "$id": "#auth/api-keys/hash", + "title": "Hash", + "description": "The hashing function used to store the value of the key. When you use `plain` the API key is written as it will passed by the user. The rest of the hashes require you to save the API key after applying the desired function.\n\nSee: https://www.krakend.io/docs/enterprise/authentication/api-keys/", + "type": "string", + "default": "plain", + "enum": ["plain","fnv128","sha256","sha1"] + }, + "salt": { + "$id": "#auth/api-keys/salt", + "title": "Salt", + "description": "A salt string for the desired hashing function. When provided, the API key is concatenated after the salt string and both hashed together.\n\nSee: https://www.krakend.io/docs/enterprise/authentication/api-keys/", + "type": "string", + "default": "", + "examples": ["mySalt"] + }, "identifier": { "$id": "#auth/api-keys/identifier", "title": "Identifier", From 245fdc8532c4c6e4ba1ece47f3dbdc7e8c3fe1d9 Mon Sep 17 00:00:00 2001 From: Albert Lombarte Date: Mon, 20 Nov 2023 14:11:57 +0100 Subject: [PATCH 5/5] Add moesif configuration --- v2.5/documentation/openapi.json | 11 +++++++++-- v2.5/service_extra_config.json | 3 +++ v2.5/telemetry/moesif.json | 34 ++++++++++++++++----------------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/v2.5/documentation/openapi.json b/v2.5/documentation/openapi.json index cfc62a8..0261183 100644 --- a/v2.5/documentation/openapi.json +++ b/v2.5/documentation/openapi.json @@ -201,6 +201,13 @@ }, "required": ["content_type"], "properties": { + "ref": { + "type": "string", + "title": "Reference", + "description": "The relative reference to the `components/schema` OpenAPI definition that will be used as definition of the accepted request. Notice that the path `#/components/schemas/` is not needed.", + "examples": ["your_schema_name"] + + }, "description": { "type": ["string"], "title": "Description", @@ -252,8 +259,8 @@ "ref": { "type": "string", "title": "Reference", - "description": "The relative reference to the `components/schema` OpenAPI definition that will be used as definition of the accepted request.", - "examples": ["#/mydef"] + "description": "The relative reference to the `components/schema` OpenAPI definition that will be used as definition of the accepted request. Notice that the path `#/components/schemas/` is not needed.", + "examples": ["your_schema_name"] }, "description": { diff --git a/v2.5/service_extra_config.json b/v2.5/service_extra_config.json index 499be18..0547fac 100644 --- a/v2.5/service_extra_config.json +++ b/v2.5/service_extra_config.json @@ -154,6 +154,9 @@ "telemetry/newrelic": { "$ref": "telemetry/newrelic.json" }, + "telemetry/moesif": { + "$ref": "telemetry/moesif.json" + }, "documentation/openapi": { "$ref": "documentation/openapi.json" }, diff --git a/v2.5/telemetry/moesif.json b/v2.5/telemetry/moesif.json index 02dbcd3..4ea9936 100644 --- a/v2.5/telemetry/moesif.json +++ b/v2.5/telemetry/moesif.json @@ -2,7 +2,7 @@ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://www.krakend.io/schema/v2.5/telemetry/moesif.json", "title": "Moesif integration", - "description": "The Moesif integration helps you understand and monetize API usage with a robust analytics and billing platform.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The Moesif integration helps you understand and monetize API usage with a robust analytics and billing platform.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "object", "additionalProperties": false, "patternProperties": { @@ -16,48 +16,48 @@ "application_id": { "$id": "#telemetry/moesif/application_id", "title": "Collector Application ID", - "description": "The Collector Application ID is used to send events, actions, users, and companies to Moesif's Collector API. Moesif provides it under the 'API Keys' section.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The Collector Application ID is used to send events, actions, users, and companies to Moesif's Collector API. Moesif provides it under the 'API Keys' section.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "string" }, "debug": { "$id": "#telemetry/moesif/debug", "title": "Enable debug", - "description": "Set to true when configuring Moesif for the first time while in development, to see the activity in the logs. Set to false in production.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "Set to true when configuring Moesif for the first time while in development, to see the activity in the logs. Set to false in production.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "boolean", "default": false }, "log_body": { "$id": "#telemetry/moesif/log_body", "title": "Send the body", - "description": "Send the body of all endpoints and requests to Moesif.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "Send the body of all endpoints and requests to Moesif.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "boolean", "default": true }, "event_queue_size": { "$id": "#telemetry/moesif/event_queue_size", "title": "Event Queue Size", - "description": "Sends the number of events you can hold in-memory to send them asynchronously to Moesif. If the throughput of your API generates more events than the size of the queue, the exceeding events will be discarded and not reported.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "Sends the number of events you can hold in-memory to send them asynchronously to Moesif. If the throughput of your API generates more events than the size of the queue, the exceeding events will be discarded and not reported.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "integer", "default": 1000000 }, "batch_size": { "$id": "#telemetry/moesif/batch_size", "title": "Batch Size", - "description": "Number of events you will send on every batch reporting asynchronously to Moesif. For high throughput you will need to increase this value.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "Number of events you will send on every batch reporting asynchronously to Moesif. For high throughput you will need to increase this value.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "integer", "default": 200 }, "timer_wake_up_seconds":{ "$id": "#telemetry/moesif/timer_wake_up_seconds", "title": "Timer Wake Up", - "description": "Specifies how often a background thread runs to send events to Moesif. Value in seconds.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "Specifies how often a background thread runs to send events to Moesif. Value in seconds.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "integer", "default": 2 }, "request_header_masks": { "$id": "#telemetry/moesif/request_header_masks", "title": "Request header masks", - "description": "The list of request headers that you want to mask their values before sending them to Moesif.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The list of request headers that you want to mask their values before sending them to Moesif.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "array", "items": { "type": "string" @@ -67,7 +67,7 @@ "response_header_masks": { "$id": "#telemetry/moesif/response_header_masks", "title": "Response header masks", - "description": "The list of response headers that you want to mask their values before sending them to Moesif.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The list of response headers that you want to mask their values before sending them to Moesif.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "array", "items": { "type": "string" @@ -77,7 +77,7 @@ "request_body_masks": { "$id": "#telemetry/moesif/request_body_masks", "title": "Request body masks", - "description": "The list of fields in the request body that you want to mask before sending them to Moesif. You can set `log_body` to `false` to prevent any body being sent.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The list of fields in the request body that you want to mask before sending them to Moesif. You can set `log_body` to `false` to prevent any body being sent.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "array", "items": { "type": "string" @@ -87,7 +87,7 @@ "response_body_masks": { "$id": "#telemetry/moesif/response_body_masks", "title": "Response body masks", - "description": "The list of fields in the response body that you want to mask before sending them to Moesif. You can set `log_body` to `false` to prevent any body being sent.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The list of fields in the response body that you want to mask before sending them to Moesif. You can set `log_body` to `false` to prevent any body being sent.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "array", "items": { "type": "string" @@ -98,7 +98,7 @@ "user_id_headers": { "$id": "#telemetry/moesif/user_id_headers", "title": "User ID headers", - "description": "Defines the list of possible headers that can identify a user uniquely. When the header is `Authorization`, it automatically extracts the username if it contains an `Authorization: Basic` value with no additional configuration. If, on the other hand, you use tokens and pass an `Authorization: Bearer`, it will extract the user ID from the JWT claim defined under `user_id_jwt_claim`. If there are multiple headers in the list, all of them are tested in the given order, and the first existing header in the list is used to extract the user ID (successfully or not).\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "Defines the list of possible headers that can identify a user uniquely. When the header is `Authorization`, it automatically extracts the username if it contains an `Authorization: Basic` value with no additional configuration. If, on the other hand, you use tokens and pass an `Authorization: Bearer`, it will extract the user ID from the JWT claim defined under `user_id_jwt_claim`. If there are multiple headers in the list, all of them are tested in the given order, and the first existing header in the list is used to extract the user ID (successfully or not).\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "array", "examples": [ [ @@ -110,7 +110,7 @@ "user_id_jwt_claim": { "$id": "#telemetry/moesif/user_id_jwt_claim", "title": "User ID JWT claim", - "description": "When using JWT tokens, it defines which claim contains the user ID. The field must be a string.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "When using JWT tokens, it defines which claim contains the user ID. The field must be a string.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "string", "default": "sub" }, @@ -121,25 +121,25 @@ }, "$id": "#telemetry/moesif/identify_company", "title": "Identify company", - "description": "It sets which strategy you want to use to identify the company. Identifying the company helps you efficiently govern your API. Choose the system you wish to apply (**declare only one property**).\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "It sets which strategy you want to use to identify the company. Identifying the company helps you efficiently govern your API. Choose the system you wish to apply (**declare only one property**).\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "object", "maxProperties": 1, "properties": { "jwt_claim": { "title": "Company in Claim", - "description": "The company is stored in a claim inside the JWT. The claim must return a string.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The company is stored in a claim inside the JWT. The claim must return a string.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "string", "examples": ["company_id"] }, "header": { "title": "Company in Header", - "description": "The company is identified using a header. Provide the header name.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The company is identified using a header. Provide the header name.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "string", "examples": ["X-Tenant"] }, "query_string": { "title": "Company in Query String", - "description": "The company is always passed inside a query string when calling any URL. Provide the query string name.\n\nSee: https://www.krakend.io/docs/enterprise/telemetry/moesif/", + "description": "The company is always passed inside a query string when calling any URL. Provide the query string name.\n\nSee: https://www.krakend.io/docs/enterprise/governance/moesif/", "type": "string", "examples": ["company"]