Skip to content

Commit 5e8449b

Browse files
authored
Dev v2.6 enterprise (#29)
* Aliased hosts on virtualhosts * gRPC server * Max payload * Add opentelemetry for grpc server * OpenTelemetry security
1 parent b8d88af commit 5e8449b

File tree

12 files changed

+287
-17
lines changed

12 files changed

+287
-17
lines changed

v2.1/auth/revoker.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://www.krakend.io/schema/v2.1/auth/revoker.json",
4-
"title": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
4+
"title": "Revoke Server",
5+
"description": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
56
"type": "object",
67
"additionalProperties": false,
78
"patternProperties": {

v2.2/auth/revoker.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://www.krakend.io/schema/v2.2/auth/revoker.json",
4-
"title": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
4+
"title": "Revoke Server",
5+
"description": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
56
"type": "object",
67
"additionalProperties": false,
78
"patternProperties": {

v2.3/auth/revoker.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://www.krakend.io/schema/v2.3/auth/revoker.json",
4-
"title": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
4+
"title": "Revoke Server",
5+
"description": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
56
"type": "object",
67
"additionalProperties": false,
78
"patternProperties": {

v2.4/auth/revoker.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://www.krakend.io/schema/v2.4/auth/revoker.json",
4-
"title": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
4+
"title": "Revoke Server",
5+
"description": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
56
"type": "object",
67
"additionalProperties": false,
78
"patternProperties": {

v2.5/auth/revoker.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://www.krakend.io/schema/v2.5/auth/revoker.json",
4-
"title": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
4+
"title": "Revoke Server",
5+
"description": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
56
"type": "object",
67
"additionalProperties": false,
78
"patternProperties": {

v2.6/.test.json.ignore

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,10 +1569,9 @@
15691569
]
15701570
},
15711571
"server/virtualhost": {
1572-
"hosts": [
1573-
"host-a.tld",
1574-
"host-b.tld"
1575-
]
1572+
"aliased_hosts": {
1573+
"user_api": "users.svc.example.com:9000"
1574+
}
15761575
},
15771576
"server/static-filesystem": {
15781577
"prefix": "/media/assets",
@@ -1586,7 +1585,55 @@
15861585
"grpc": {
15871586
"catalog": [
15881587
"./grpc/definitions"
1589-
]
1588+
],
1589+
"server": {
1590+
"services": [
1591+
{
1592+
"name": "flight_finder.Flights",
1593+
"methods": [
1594+
{
1595+
"name": "FindFlight",
1596+
"input_headers": [
1597+
"*"
1598+
],
1599+
"payload_params": {
1600+
"page.cursor": "cursor"
1601+
},
1602+
"backend": [
1603+
{
1604+
"host": [
1605+
"http://localhost:8080"
1606+
],
1607+
"url_pattern": "/__debug/foo/"
1608+
},
1609+
{
1610+
"host": [
1611+
"localhost:4242"
1612+
],
1613+
"url_pattern": "/flight_finder.Flights/FindFlight",
1614+
"extra_config": {
1615+
"backend/grpc": {
1616+
"use_request_body": true
1617+
}
1618+
}
1619+
},
1620+
{
1621+
"method": "GET",
1622+
"host": [
1623+
"http://localhost:8000"
1624+
],
1625+
"url_pattern": "/articles.json?q={cursor}"
1626+
}
1627+
]
1628+
}
1629+
]
1630+
}
1631+
],
1632+
"opentelemetry": {
1633+
"metrics_disabled": true,
1634+
"traces_disabled": true
1635+
}
1636+
}
15901637
},
15911638
"auth/validator": {
15921639
"shared_cache_duration": 5,

v2.6/auth/revoker.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://www.krakend.io/schema/v2.6/auth/revoker.json",
4-
"title": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
4+
"title": "Revoke Server",
5+
"description": "The API Gateway authorizes users that provide valid tokens according to your criteria, but at some point, you might want to change your mind and decide to revoke JWT tokens that are still valid.",
56
"type": "object",
67
"additionalProperties": false,
78
"patternProperties": {
@@ -31,7 +32,8 @@
3132
"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/",
3233
"type": "number",
3334
"examples": [
34-
0.0000001
35+
0.0000001,
36+
1e-7
3537
]
3638
},
3739
"hash_name": {

v2.6/grpc.json

Lines changed: 112 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"properties": {
1414
"catalog": {
1515
"title": "Catalog definition",
16-
"description": "The paths to the different `.pb` files you want to load, or the paths to directories containing `.pb` files. All content is scanned in the order of the list, and after fetching all files it resolves the dependencies of their imports. The order you use here is not important to resolve imports, but it matters when there are conflicts (different files using the same namespace and package type).\n\nSee: https://www.krakend.io/docs/backends/grpc/",
16+
"description": "The paths to the different `.pb` files you want to load, or the paths to directories containing `.pb` files. All content is scanned in the order of the list, and after fetching all files it resolves the dependencies of their imports. The order you use here is not important to resolve imports, but it matters when there are conflicts (different files using the same namespace and package type).\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
1717
"type": "array",
1818
"examples": [
1919
"./grpc/flights.pb",
@@ -23,6 +23,117 @@
2323
"items": {
2424
"type": "string"
2525
}
26+
},
27+
"server": {
28+
"title": "gRPC Server",
29+
"description": "Defines the gRPC server properties.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
30+
"type": "object",
31+
"additionalProperties": false,
32+
"patternProperties": {
33+
"^[@$_#]": {}
34+
},
35+
"properties": {
36+
"services": {
37+
"title": "gRPC services",
38+
"description": "Defines one object per available gRPC service.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
39+
"type": "array",
40+
"items": {
41+
"type": "object",
42+
"additionalProperties": false,
43+
"patternProperties": {
44+
"^[@$_#]": {}
45+
},
46+
"properties": {
47+
"name": {
48+
"title": "gRPC name",
49+
"description": "The name of the published gRPC service.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
50+
"type": "string",
51+
"examples": [
52+
"flight_finder.Flights"
53+
]
54+
},
55+
"methods": {
56+
"title": "Methods",
57+
"description": "The gRPC methods available for this service (this is not related with HTTP methods despite using the same name).\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
58+
"type": "array",
59+
"items": {
60+
"type": "object",
61+
"additionalProperties": false,
62+
"patternProperties": {
63+
"^[@$_#]": {}
64+
},
65+
"properties": {
66+
"name": {
67+
"title": "Method name",
68+
"description": "The name of the published gRPC method.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
69+
"type": "string",
70+
"examples": [
71+
"FindFlight"
72+
]
73+
},
74+
"payload_params": {
75+
"description": "Maps a property of the gRPC incoming payload to a `{parameter}` that you can inject and reuse in a `url_pattern`. It supports dot nation to access nested objects.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
76+
"type": "object",
77+
"examples": [
78+
{
79+
"some.grpc.object": "param1"
80+
}
81+
]
82+
},
83+
"input_headers": {
84+
"title": "Allowed Headers In",
85+
"description": "Defines the list of all client headers that you can use as gRPC metadata.\nBy default, KrakenD won't pass any header from the client to the backend. This list is **case-insensitive**. You can declare headers in lowercase, uppercase, or mixed.\nAn entry `[\"X-Something\"]` forwards a single `X-Something` header to the backend, ignoring everything else. A single star element `[\"*\"]` as value forwards everything to the backend (**it's safer to avoid this option**).",
86+
"type": "array",
87+
"uniqueItems": true,
88+
"default": [],
89+
"examples": [
90+
"X-Custom-Trace",
91+
"*"
92+
],
93+
"items": {
94+
"type": "string"
95+
}
96+
},
97+
"backend": {
98+
"type": "array",
99+
"title": "Backend",
100+
"description": "An array with all the [backend objects](https://www.krakend.io/docs/backends/) mapped to this method",
101+
"items": {
102+
"type": "object",
103+
"$ref": "backend.json"
104+
},
105+
"minItems": 1
106+
}
107+
}
108+
}
109+
}
110+
}
111+
}
112+
},
113+
"opentelemetry": {
114+
"title": "OpenTelemetry settings",
115+
"description": "Overrides [OpenTelemetry settings](/docs/enterprise/telemetry/opentelemetry-layers-metrics/) for the gRPC server.",
116+
"type": "object",
117+
"additionalProperties": false,
118+
"patternProperties": {
119+
"^[@$_#]": {}
120+
},
121+
"properties": {
122+
"disable_metrics": {
123+
"title": "Disable metrics",
124+
"description": "Whether you want to disable all metrics happening in the gRPC server.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
125+
"type": "boolean",
126+
"default": false
127+
},
128+
"disable_traces": {
129+
"title": "Disable trace",
130+
"description": "Whether you want to disable all traces happening in the gRPC server.\n\nSee: https://www.krakend.io/docs/enterprise/grpc/server/",
131+
"type": "boolean",
132+
"default": false
133+
}
134+
}
135+
}
136+
}
26137
}
27138
}
28139
}

v2.6/proxy.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@
2121
"description": "The list of operations to **execute sequentially** (top down). Every operation is defined with an object containing two properties:\n\nSee: https://www.krakend.io/docs/backends/flatmap/",
2222
"type": "array",
2323
"$ref": "proxy/flatmap.json"
24+
},
25+
"max_payload": {
26+
"title": "Maximum Payload",
27+
"description": "Enterprise Only. Limits the maximum number of bytes a user can send to the endpoint. `0` means no limit. You can also set this value globally at the [service level](/docs/enterprise/service-settings/router-options/#max_payload).\n\nSee: https://www.krakend.io/docs/service-settings/router-options/",
28+
"type": "integer",
29+
"default": 0
30+
},
31+
"decompress_gzip": {
32+
"title": "Decompress Gzip",
33+
"description": "Enterprise Only. Decompresses any Gzipped content before sending it to the backend when the `Content-Encoding` has `gzip` in the first position. You can also set this value globally at the [service level](/docs/enterprise/service-settings/router-options/#max_payload).\n\nSee: https://www.krakend.io/docs/service-settings/router-options/",
34+
"type": "boolean",
35+
"default": false
2436
}
2537
}
2638
}

v2.6/router.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@
5555
"type": "boolean",
5656
"default": false
5757
},
58+
"max_payload": {
59+
"title": "Maximum Payload",
60+
"description": "**Requires Enterprise**. Limits the maximum number of bytes a user can send to the gateway. `0` means no limit. You can also set this value [per endpoint](/docs/enterprise/endpoints/maximum-request-size/).\n\nSee: https://www.krakend.io/docs/service-settings/router-options/",
61+
"type": "integer",
62+
"default": 0
63+
},
64+
"decompress_gzip": {
65+
"title": "Decompress Gzip",
66+
"description": "**Requires Enterprise**. Decompresses any Gzipped content before sending it to the backend when the `Content-Encoding` has `gzip` in the first position. You can also set this value [per endpoint](/docs/enterprise/endpoints/maximum-request-size/).\n\nSee: https://www.krakend.io/docs/service-settings/router-options/",
67+
"type": "integer",
68+
"default": 0
69+
},
5870
"disable_redirect_trailing_slash": {
5971
"title": "Disable redirect trailing slash",
6072
"description": "Disables automatic redirection if the current route can't be matched but a handler for the path with (without) the trailing slash exists.\n\nSee: https://www.krakend.io/docs/service-settings/router-options/",

v2.6/server/virtualhost.json

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,44 @@
88
"patternProperties": {
99
"^[@$_#]": {}
1010
},
11-
"required": [
12-
"hosts"
11+
"oneOf": [
12+
{
13+
"required": [
14+
"hosts"
15+
]
16+
},
17+
{
18+
"required": [
19+
"aliased_hosts"
20+
]
21+
}
1322
],
1423
"properties": {
24+
"aliased_hosts": {
25+
"title": "Virtualhosts with alias",
26+
"description": "A map of all recognized virtual hosts where the key is the alias and the value the host name, including the port if it's not 443 or 80. The values declared here must match the content of the `Host` header passed by the client. The alias must be an alphanumeric string.\n\nSee: https://www.krakend.io/docs/enterprise/service-settings/virtual-hosts/",
27+
"type": "object",
28+
"examples": [
29+
{
30+
"user_api": "users.svc.example.com:9000"
31+
}
32+
],
33+
"properties": {
34+
"[a-z0-9_]": {
35+
"title": "Virtualhost",
36+
"type": "string",
37+
"description": "The key of this map must compile with the regexp `a-z0-9_` and the host name is the string that matches the value sent by the user in the `Host` header."
38+
}
39+
}
40+
},
1541
"hosts": {
1642
"title": "Virtualhosts",
1743
"description": "All recognized virtual hosts by KrakenD must be listed here. The values declared here must match the content of the `Host` header when passed by the client.\n\nSee: https://www.krakend.io/docs/enterprise/service-settings/virtual-hosts/",
1844
"type": "array",
1945
"examples": [
2046
[
21-
"api-a.host.com",
22-
"api-b.host.com"
47+
"api-a.example.com",
48+
"api-b.example.com"
2349
]
2450
],
2551
"items": {

0 commit comments

Comments
 (0)