Skip to content

Commit 7647f3b

Browse files
committed
[fapi] address PR review feedback
1 parent 07fcd6d commit 7647f3b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

gateway/src/apicast/policy/fapi/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Validate requests with a x-fapi-customer-ip-address header containing a valid IP
5454

5555
### Validate certificate-bound access tokens
5656

57-
Certificate-bound access tokens, as defined in [RFC 8705]((https://datatracker.ietf.org/doc/html/rfc8705)), enhance security by linking tokens to clients, thereby verifying the sender's authorization to access protected resources.
57+
Certificate-bound access tokens, as defined in [RFC 8705](https://datatracker.ietf.org/doc/html/rfc8705), enhance security by linking tokens to clients, thereby verifying the sender's authorization to access protected resources.
5858

5959
You'll need to:
60-
* Configure an Identity Provider (IdP) such as Keycloak configured with mTLS and X.509 client certificate authentication.
60+
* Configure an Identity Provider (IdP) such as Keycloak with mTLS and X.509 client certificate authentication.
6161
* Configure the gateway to handle mTLS client certificate authentication.
6262
* Enable `validate_oauth2_certificate_bound_access_token` in the FAPI plugin.
6363

gateway/src/apicast/policy/fapi/fapi.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ end
9898
function _M:header_filter()
9999
--- 6.2.1.11
100100
-- shall set the response header x-fapi-interaction-id to the value received from the corresponding FAPI client request header or to a RFC4122 UUID value if the request header was not provided to track the interaction
101-
local transaction_id = ngx.req.get_headers()[X_FAPI_INTERACTION_ID_HEADER]
102-
if not transaction_id or transaction_id == "" then
101+
local interaction_id = ngx.req.get_headers()[X_FAPI_INTERACTION_ID_HEADER]
102+
if not interaction_id or interaction_id == "" then
103103
-- Nothing found, generate one
104-
transaction_id = ngx.resp.get_headers()[X_FAPI_INTERACTION_ID_HEADER]
105-
if not transaction_id or transaction_id == "" then
106-
transaction_id = uuid.generate_v4()
104+
interaction_id = ngx.resp.get_headers()[X_FAPI_INTERACTION_ID_HEADER]
105+
if not interaction_id or interaction_id == "" then
106+
interaction_id = uuid.generate_v4()
107107
end
108108
end
109-
ngx.header[X_FAPI_INTERACTION_ID_HEADER] = transaction_id
109+
ngx.header[X_FAPI_INTERACTION_ID_HEADER] = interaction_id
110110
end
111111

112112
return _M

0 commit comments

Comments
 (0)