Merge pull request #11750 from savonarola/1011-redact-auth-http-request
Do not trace authn http request bodies
This commit is contained in:
commit
90a0c093bf
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_bridge_http, [
|
{application, emqx_bridge_http, [
|
||||||
{description, "EMQX HTTP Bridge and Connector Application"},
|
{description, "EMQX HTTP Bridge and Connector Application"},
|
||||||
{vsn, "0.1.3"},
|
{vsn, "0.1.4"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx_connector, emqx_resource, ehttpc]},
|
{applications, [kernel, stdlib, emqx_connector, emqx_resource, ehttpc]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -57,6 +57,8 @@
|
||||||
-define(DEFAULT_PIPELINE_SIZE, 100).
|
-define(DEFAULT_PIPELINE_SIZE, 100).
|
||||||
-define(DEFAULT_REQUEST_TIMEOUT_MS, 30_000).
|
-define(DEFAULT_REQUEST_TIMEOUT_MS, 30_000).
|
||||||
|
|
||||||
|
-define(READACT_REQUEST_NOTE, "the request body is redacted due to security reasons").
|
||||||
|
|
||||||
%%=====================================================================
|
%%=====================================================================
|
||||||
%% Hocon schema
|
%% Hocon schema
|
||||||
|
|
||||||
|
@ -303,7 +305,8 @@ on_query(
|
||||||
"QUERY",
|
"QUERY",
|
||||||
"http_connector_received",
|
"http_connector_received",
|
||||||
#{
|
#{
|
||||||
request => redact(Request),
|
request => redact_request(Request),
|
||||||
|
note => ?READACT_REQUEST_NOTE,
|
||||||
connector => InstId,
|
connector => InstId,
|
||||||
state => redact(State)
|
state => redact(State)
|
||||||
}
|
}
|
||||||
|
@ -329,7 +332,7 @@ on_query(
|
||||||
{error, #{status_code := StatusCode}} ->
|
{error, #{status_code := StatusCode}} ->
|
||||||
?SLOG(error, #{
|
?SLOG(error, #{
|
||||||
msg => "http_connector_do_request_received_error_response",
|
msg => "http_connector_do_request_received_error_response",
|
||||||
note => "the body will be redacted due to security reasons",
|
note => ?READACT_REQUEST_NOTE,
|
||||||
request => redact_request(NRequest),
|
request => redact_request(NRequest),
|
||||||
connector => InstId,
|
connector => InstId,
|
||||||
status_code => StatusCode
|
status_code => StatusCode
|
||||||
|
@ -338,7 +341,8 @@ on_query(
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?SLOG(error, #{
|
?SLOG(error, #{
|
||||||
msg => "http_connector_do_request_failed",
|
msg => "http_connector_do_request_failed",
|
||||||
request => redact(NRequest),
|
note => ?READACT_REQUEST_NOTE,
|
||||||
|
request => redact_request(NRequest),
|
||||||
reason => Reason,
|
reason => Reason,
|
||||||
connector => InstId
|
connector => InstId
|
||||||
}),
|
}),
|
||||||
|
@ -379,7 +383,8 @@ on_query_async(
|
||||||
"QUERY_ASYNC",
|
"QUERY_ASYNC",
|
||||||
"http_connector_received",
|
"http_connector_received",
|
||||||
#{
|
#{
|
||||||
request => redact(Request),
|
request => redact_request(Request),
|
||||||
|
note => ?READACT_REQUEST_NOTE,
|
||||||
connector => InstId,
|
connector => InstId,
|
||||||
state => redact(State)
|
state => redact(State)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Eliminated logging and tracing of HTTP request bodies in HTTP authentification and HTTP bridges.
|
Loading…
Reference in New Issue