Skip to content

Commit 0577817

Browse files
committed
Propagate role
1 parent 9f5d84c commit 0577817

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

v2.6/.test.json.ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,7 @@
18961896
"identifier": "Authorization",
18971897
"hash": "plain",
18981898
"salt": "mySalt",
1899+
"propagate_role": "X-Role",
18991900
"keys": [
19001901
{
19011902
"key": "4d2c61e1-34c4-e96c-9456-15bd983c5019",

v2.6/auth/api-keys.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"title": "Identifier",
4242
"description": "The header name or the query string name that contains the API key. Defaults to `key` when using the `query_string` strategy and to `Authorization` when using the `header` strategy. The identifier set here is used across all endpoints with API key authentication enabled, but they can override this entry individually.\n\nSee: https://www.krakend.io/docs/enterprise/authentication/api-keys/",
4343
"type": "string",
44-
"examples": ["Authorization"]
44+
"examples": ["Authorization", "X-Key"],
45+
"default": "Authorization"
4546
},
4647
"keys": {
4748
"$id": "#auth/api-keys/keys",
@@ -71,6 +72,13 @@
7172
}
7273
}
7374

75+
},
76+
"propagate_role": {
77+
"title": "Propagate role as header",
78+
"description": "The name of a header that will propagate to the backend containing the matching role. The backend receives no header when the string is empty, or the attribute is not declared. Otherwise, the backend receives the declared header name containing **the first matching role of the user**. The header value will be `ANY` when the endpoint does not require roles. For instance, if an API key has roles `[A, B]`, and the endpoint demands roles `[B, C]`, the backend will receive a header with the value `B`.\n\nSee: https://www.krakend.io/docs/enterprise/authentication/api-keys/",
79+
"type": "string",
80+
"examples": ["X-Krakend-Role"],
81+
"default": ""
7482
}
7583
}
7684
}

0 commit comments

Comments
 (0)