Skip to content

Commit c75c366

Browse files
committed
Update KrakenD schemas
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent f960bc0 commit c75c366

File tree

30 files changed

+533
-30
lines changed

30 files changed

+533
-30
lines changed

DEPENDENCIES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ manfred-mac-0-5 https://github.com/getmanfred/mac v0.5
2626
manfred-mac-0-4 https://github.com/getmanfred/mac v0.4
2727
manfred-mac-0-3 https://github.com/getmanfred/mac v0.3
2828
movielabs-omc-2-6 https://github.com/MovieLabs/OMC v2.6-release-1
29-
krakend https://github.com/krakend/krakend-schema 473daa217c7a02de7e947cf682bf5ab0cffa21dc
29+
krakend https://github.com/krakend/krakend-schema 197ad7860e108e7e15988f485824ca384a5fa397
3030
octue-power-curve https://github.com/octue/power-curve-schema 1.0.0.alpha-1
3131
usnistgov-mgi-2022-08 https://github.com/usnistgov/mgi-json-schema e5e6aaf3f5eae0d15b88ecbd57f44cc28b035f11
3232
cloudevents-1-0-0 https://github.com/cloudevents/spec v1.0

vendor/krakend/v2.1/auth/revoker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"properties": {
1616
"N": {
1717
"$id": "#auth/revoker/N",
18-
"title": "Bot detector",
18+
"title": "Number of elements",
1919
"description": "The maximum `N`umber of elements you want to keep in the bloom filter. Tens of millions work fine on machines with low resources.\n\nSee: https://www.krakend.io/docs/authorization/revoking-tokens/",
2020
"examples": [
2121
10000000

vendor/krakend/v2.10/auth/revoker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"properties": {
1616
"N": {
1717
"$id": "#auth/revoker/N",
18-
"title": "Bot detector",
18+
"title": "Number of elements",
1919
"description": "The maximum `N`umber of elements you want to keep in the bloom filter. Tens of millions work fine on machines with low resources.\n\nSee: https://www.krakend.io/docs/authorization/revoking-tokens/",
2020
"examples": [
2121
10000000

vendor/krakend/v2.10/backend_extra_config.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
"backend/static-filesystem": {
7070
"$ref": "backend/static-filesystem.json"
7171
},
72+
"governance/quota": {
73+
"$ref": "governance/quota.json"
74+
},
7275
"modifier/body-generator": {
7376
"$ref": "modifier/body-generator.json"
7477
},
@@ -181,6 +184,20 @@
181184
},
182185
"additionalProperties": false
183186
},
187+
"telemetry/logging": {
188+
"title": "Backend Log",
189+
"description": "Enterprise only. Add a specific Backend Log. Useful to see status codes, headers, and other information that come from your backends.\n\nSee: https://www.krakend.io/docs/enterprise/logging/",
190+
"type": "object",
191+
"properties": {
192+
"backend": {
193+
"$ref": "telemetry/backend_log.json"
194+
}
195+
},
196+
"patternProperties": {
197+
"^[@$_#]": {}
198+
},
199+
"additionalProperties": false
200+
},
184201
"telemetry/opentelemetry": {
185202
"$ref": "telemetry/opentelemetry-backend.json"
186203
},

vendor/krakend/v2.10/documentation/openapi.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,74 @@
556556
"type": "string"
557557
}
558558
},
559+
"servers": {
560+
"$id": "#documentation/openapi/servers",
561+
"title": "Servers",
562+
"description": "The list of servers where the API is hosted. The server URL can be a relative path, e.g., `/v1` or an absolute path. The URL might contain `{variables}`, although these are only recognized by OpenAPI and to KrakenD they are just literal strings because it does not use them.\n\nSee: https://www.krakend.io/docs/enterprise/developer/openapi/",
563+
"examples": [
564+
[
565+
{
566+
"url": "/v1"
567+
}
568+
],
569+
[
570+
{
571+
"url": "https://example.com:{port}",
572+
"variables": {
573+
"port": {
574+
"default": "8443",
575+
"enum": [
576+
"8443",
577+
"443"
578+
]
579+
}
580+
}
581+
}
582+
]
583+
],
584+
"type": "array",
585+
"items": {
586+
"type": "object",
587+
"required": [
588+
"url"
589+
],
590+
"properties": {
591+
"description": {
592+
"$id": "#documentation/openapi/servers/description",
593+
"title": "Description",
594+
"description": "A short description of the server URL.",
595+
"type": "string"
596+
},
597+
"url": {
598+
"$id": "#documentation/openapi/servers/url",
599+
"title": "URL",
600+
"description": "The URL of the server. This URL will be used as the base path for all endpoints.",
601+
"type": [
602+
"string",
603+
"object"
604+
]
605+
},
606+
"variables": {
607+
"$id": "#documentation/openapi/servers/variables",
608+
"title": "Variables",
609+
"description": "A [Server Variable Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object) according to the OpenAPI specification. The variable name is the key and the value is the default value for that variable.",
610+
"type": "object",
611+
"patternProperties": {
612+
"^.*$": {
613+
"type": [
614+
"string",
615+
"object"
616+
]
617+
}
618+
}
619+
}
620+
},
621+
"patternProperties": {
622+
"^[@$_#]": {}
623+
},
624+
"additionalProperties": false
625+
}
626+
},
559627
"summary": {
560628
"$id": "#documentation/openapi/summary",
561629
"title": "Summary",

vendor/krakend/v2.10/endpoint_extra_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
"documentation/postman": {
6161
"$ref": "documentation/postman_endpoint.json"
6262
},
63+
"governance/quota": {
64+
"$ref": "governance/quota.json"
65+
},
6366
"modifier/jmespath": {
6467
"$ref": "modifier/jmespath.json"
6568
},
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://www.krakend.io/schema/v2.10/governance/processors.json",
4+
"title": "Governance processors.",
5+
"description": "Declares rules and limits to be enforced.",
6+
"type": "object",
7+
"required": [
8+
"quotas"
9+
],
10+
"properties": {
11+
"quotas": {
12+
"description": "The list of quota processors available for attachment. You can have multiple processors with different configurations.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
13+
"type": "array",
14+
"items": {
15+
"type": "object",
16+
"required": [
17+
"name",
18+
"connection_name",
19+
"rules"
20+
],
21+
"properties": {
22+
"connection_name": {
23+
"description": "The name of the [Redis connection](https://www.krakend.io/docs/enterprise/service-settings/redis-connection-pools/) to use, it must exist under the `redis` namespace at the service level and written exactly as declared.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
24+
"type": "string"
25+
},
26+
"deny_queue_flush_interval": {
27+
"description": "When you have a `rejecter_cache`, the time interval to write the events stored in the buffer in the bloom filter. This is the maximum time that can elapse before the events are written to the bloom filter.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
28+
"default": "1s",
29+
"$ref": "../timeunits.json#/$defs/timeunit",
30+
"type": "string"
31+
},
32+
"deny_queue_flush_threshold": {
33+
"description": "When you have a `rejecter_cache`, the maximum number of events in the buffer that will force a write to the bloom filter event when the flush interval has not kicked in yet.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
34+
"default": 10,
35+
"type": "integer"
36+
},
37+
"deny_queue_size": {
38+
"description": "When you have a `rejecter_cache`, the size of the buffer (number of events stored) to write in the bloomfilter. It defaults to the number of cores on the machine. This is the maximum number of events that can be stored in memory before being written to the bloom filter. You should not set this value unless you are seeing increased latencies on very high-concurrency scenarios; ask support for help.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
39+
"type": "integer"
40+
},
41+
"hash_keys": {
42+
"description": "Whether to hash the keys used for quota consumption. If you have PII (Personal Identifiable Information) in the keys (like an email), enable this option to `true` to avoid Redis containing clear text keys with PII. This is a setting for privacy, enabling it may affect performance because of the extra hashing, and makes data exploration difficult.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
43+
"default": false,
44+
"type": "boolean"
45+
},
46+
"name": {
47+
"description": "Name of the quota. The exact name you type here is the one you need to reference when you attach a quota under the `governance/quota` namespace, and is also part of the key name on the persistence layer.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
48+
"examples": [
49+
"public_api",
50+
"LLM"
51+
],
52+
"type": "string"
53+
},
54+
"on_failure_allow": {
55+
"description": "What to do with the user request if Redis is down. When `true`, allows continuing to perform requests even when Redis is unreachable, but the quota won't be counted. When `false`, the request is rejected and the user receives a 500 error. This is a fail-safe option, but it may lead to quota overconsumption.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
56+
"type": "boolean"
57+
},
58+
"on_failure_backoff_strategy": {
59+
"description": "The backoff strategy to use when Redis is unreachable. The default is `exponential`, which means that the time between retries will increase exponentially. The other option is `linear`, which means that the time between retries will be constant.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
60+
"default": "exponential",
61+
"enum": [
62+
"linear",
63+
"exponential"
64+
]
65+
},
66+
"on_failure_max_retries": {
67+
"description": "Maximum number of retries to Redis when it is unreachable. Once the retries are exhausted, the processor is no longer usable and the quota stops working until the Redis connection is restored and the service restarted. The users will be able to consume content depending on the `on_failure_allow` option. A zero value means no retries.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
68+
"default": 0,
69+
"type": "integer"
70+
},
71+
"rejecter_cache": {
72+
"description": "The bloom filter configuration that you use to cache rejections. The bloom filter is used to store the events that are rejected by the quota processor. This is useful to avoid rejecting the same event multiple times.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
73+
"type": "object",
74+
"required": [
75+
"N",
76+
"P"
77+
],
78+
"properties": {
79+
"N": {
80+
"title": "Number of elements",
81+
"description": "The maximum `N`umber of elements you want to keep in the bloom filter. Tens of millions work fine on machines with low resources.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
82+
"examples": [
83+
10000000
84+
],
85+
"type": "integer"
86+
},
87+
"P": {
88+
"title": "Probability",
89+
"description": "The `P`robability of returning a false positive. E.g.,`1e-7` for one false positive every 10 million different tokens. The values `N` and `P` determine the size of the resulting bloom filter to fulfill your expectations. E.g: 0.0000001\n\nSee: https://www.krakend.io/docs/authorization/revoking-tokens/\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
90+
"examples": [
91+
1e-07,
92+
1e-07
93+
],
94+
"type": "number"
95+
},
96+
"cleanup_interval": {
97+
"description": "The time interval to clean up the bloom filter. This is the maximum time that can elapse before the bloom filter is cleaned up.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
98+
"default": "30m",
99+
"$ref": "../timeunits.json#/$defs/timeunit",
100+
"type": "string"
101+
},
102+
"hash_name": {
103+
"title": "Hash function name",
104+
"description": "Either `optimal` (recommended) or `default`. The `optimal` consumes less CPU but has less entropy when generating the hash, although the loss is negligible.\n\nSee: https://www.krakend.io/docs/authorization/revoking-tokens/\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
105+
"default": "optimal",
106+
"enum": [
107+
"optimal",
108+
"default"
109+
]
110+
}
111+
},
112+
"patternProperties": {
113+
"^[@$_#]": {}
114+
},
115+
"additionalProperties": false
116+
},
117+
"rules": {
118+
"description": "The rules to use for the quota processor.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
119+
"type": "array",
120+
"items": {
121+
"type": "object",
122+
"required": [
123+
"name",
124+
"limits"
125+
],
126+
"properties": {
127+
"limits": {
128+
"description": "The limits for the rule. The limits are defined as an array of objects, each object containing an amount and a unit.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
129+
"examples": [
130+
[
131+
{
132+
"amount": 10,
133+
"unit": "hour"
134+
},
135+
{
136+
"amount": 250,
137+
"unit": "day"
138+
}
139+
]
140+
],
141+
"type": "array",
142+
"items": {
143+
"type": "object",
144+
"required": [
145+
"amount",
146+
"unit"
147+
],
148+
"properties": {
149+
"amount": {
150+
"description": "The amount of the limit. This is the maximum number of requests that can be made in the given time unit.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
151+
"type": "number"
152+
},
153+
"unit": {
154+
"description": "The time unit for the limit.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
155+
"enum": [
156+
"second",
157+
"minute",
158+
"hour",
159+
"day",
160+
"week",
161+
"month",
162+
"year"
163+
]
164+
}
165+
},
166+
"patternProperties": {
167+
"^[@$_#]": {}
168+
},
169+
"additionalProperties": false
170+
}
171+
},
172+
"name": {
173+
"description": "The name of the rule. This is the name that will be used to identify the rule in the logs and metrics. It is also the plan name.\n\nSee: https://www.krakend.io/docs/enterprise/governance/quota/",
174+
"examples": [
175+
"gold",
176+
"silver"
177+
],
178+
"type": "string"
179+
}
180+
},
181+
"patternProperties": {
182+
"^[@$_#]": {}
183+
},
184+
"additionalProperties": false
185+
}
186+
}
187+
},
188+
"patternProperties": {
189+
"^[@$_#]": {}
190+
},
191+
"additionalProperties": false
192+
}
193+
}
194+
},
195+
"patternProperties": {
196+
"^[@$_#]": {}
197+
},
198+
"additionalProperties": false
199+
}

0 commit comments

Comments
 (0)