Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev v2.5 enterprise #26

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flexible_config.json
Original file line number Diff line number Diff line change
@@ -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"
}
35 changes: 34 additions & 1 deletion v2.5/.test.json.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@
"foo": "bar"
}
}
},
"request_definition": {
"@comment": "Some comment",
"description": "Page not found",
"example": {
"status": "KO"
},
"content_type": "application/json"
}
},
"validation/cel": [
Expand Down Expand Up @@ -1775,11 +1783,36 @@
"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",
"identifier": "Authorization",
"hash": "plain",
"salt": "mySalt",
"keys": [
{
"key": "4d2c61e1-34c4-e96c-9456-15bd983c5019",
Expand Down
16 changes: 15 additions & 1 deletion v2.5/.test_e2e.json.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
]
}
28 changes: 28 additions & 0 deletions v2.5/.test_flexible_config.ignore
Original file line number Diff line number Diff line change
@@ -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
}
16 changes: 16 additions & 0 deletions v2.5/auth/api-keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
86 changes: 85 additions & 1 deletion v2.5/documentation/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -177,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",
Expand All @@ -200,6 +231,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. Notice that the path `#/components/schemas/` is not needed.",
"examples": ["your_schema_name"]

},
"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`"
}
}
}
}
}
Loading
Loading