Skip to content

Commit ac18786

Browse files
authored
chore(add-user-agent-on-forbidden): Add User-Agent header to ECS logs on other 4XX requests (#48)
Adds new header to ECS logs on forbidden requests
1 parent 3d98834 commit ac18786

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

neurow/lib/neurow/jwt_auth_plug.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ defmodule Neurow.JwtAuthPlug do
244244
"JWT authentication error: #{error_code} - #{error_message}, path: '#{conn.request_path}', audience: '#{options |> Options.audience()}', token: '#{jwt_token}'",
245245
category: "security",
246246
error_code: "jwt_authentication.#{error_code}",
247+
user_agent_header: conn |> get_req_header("user-agent") |> List.first(),
247248
trace_id: conn |> get_req_header("x-request-id") |> List.first(),
248249
client_ip: conn |> get_req_header("x-forwarded-for") |> List.first()
249250
)

0 commit comments

Comments
 (0)