mirror of
https://github.com/valitydev/bouncer.git
synced 2024-11-06 02:15:18 +00:00
Cut fragments ctx out of audit logs (#19)
They provide too much redundant information at no tangible benefit. Also stop adding woody metadata to audit log events.
This commit is contained in:
parent
6a7ca8f2e9
commit
2e575b0654
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -18,6 +18,6 @@ build('bouncer', 'docker-host', finalHook) {
|
||||
pipeErlangService = load("${env.JENKINS_LIB}/pipeErlangService.groovy")
|
||||
}
|
||||
|
||||
pipeErlangService.runPipe(true, true)
|
||||
pipeErlangService.runPipe(true, false)
|
||||
|
||||
}
|
||||
|
@ -264,9 +264,10 @@ encode_context(Context = #{}) ->
|
||||
Context.
|
||||
|
||||
encode_fragments(Fragments = #{}) ->
|
||||
% TODO
|
||||
% See above.
|
||||
Fragments.
|
||||
maps:map(fun encode_fragment/2, Fragments).
|
||||
|
||||
encode_fragment(_ID, Fragment) ->
|
||||
maps:with([type, metadata], Fragment).
|
||||
|
||||
extract_woody_ctx(WoodyCtx = #{rpc_id := RpcID}, Acc) ->
|
||||
extract_woody_meta(WoodyCtx, extract_woody_rpc_id(RpcID, Acc));
|
||||
@ -276,7 +277,13 @@ extract_woody_ctx(undefined, Acc) ->
|
||||
extract_woody_rpc_id(RpcID = #{span_id := _, trace_id := _, parent_id := _}, Acc) ->
|
||||
maps:merge(Acc, RpcID).
|
||||
|
||||
extract_woody_meta(#{meta := Meta}, Acc) when map_size(Meta) > 0 ->
|
||||
Acc#{woody => #{metadata => Meta}};
|
||||
%% TODO
|
||||
%% This currently duplicates scoper-related metadata in every audit log
|
||||
%% message. However, scoper is not a must, so we should probably allow
|
||||
%% to turn this thing on and off through options.
|
||||
%%
|
||||
%% extract_woody_meta(#{meta := Meta}, Acc) when map_size(Meta) > 0 ->
|
||||
%% Acc#{woody => #{metadata => Meta}};
|
||||
%% Acc;
|
||||
extract_woody_meta(#{}, Acc) ->
|
||||
Acc.
|
||||
|
Loading…
Reference in New Issue
Block a user