Headers
Headers represent an advanced aspect of gecholog
, offering multiple layers of handling and considerable flexibility for expert users.
Ingress Headers
In gecholog
, ingress_headers
are obtained from the requester. They become accessible to processors after step 2. Unless modified by processors beforehand, these headers are logged in their original state.
1. From Request
The initial step involves populating ingress_headers
with the raw headers from the request. During this phase, headers categorized as masked_headers
are obfuscated.
2. Router Header Configuration Check
If router.ingress.headers
are configured in /app/conf/gl_config.json
, both the name and value of each header listed must match those in the request. If there's a mismatch, gecholog
responds with http.StatusUnauthorized
.
Outbound Headers
The outbound_headers
will be sent to the target by gecholog
. They are made available to processors after step 2 and sent to the target after step 3. Unless altered by async processors beforehand, this is also the state in which they are logged.
1. Creation from Ingress Headers
outbound_headers
are initially copied from ingress_headers
.
2. Cleaning Up Headers
These headers are removed from outbound_headers
:
- The mandatory
router.ingress.headers
- The
Session-Id
header - Headers in the
remove_headers
list
NOTE: An example of a standard
remove_headers
entry is theContent-Length
header, which needs to be recreated at each step: ingress, outbound, inbound, and egress.
3. Sending to Target
Before sending outbound_headers
to the target, the masked_headers
are restored to their un-masked state. The remove_headers
process runs again, and the router.outbound.headers
are added. If there is a conflict, router.outbound.headers
takes precedence.
Inbound Headers
The inbound_headers
are received by gecholog
from the target. They are made available to processors after step 1. Unless altered by processors beforehand, this is also the state in which they are logged.
1. Raw Inbound Headers
inbound_headers
are initially the raw response headers from the target, with remove_headers
removed. At this point, the headers in the masked_headers
category are obfuscated.
Egress Headers
The egress_headers
will be sent to the original requestor as a response from gecholog
. They are made available to processors after step 1 and sent to the original requestor after step 2. Unless altered by async processors beforehand, this is also the state in which they are logged.
1. Creation from Inbound Headers
egress_headers
are first copied from inbound_headers
.
2. Sending Them Back
egress_headers
have remove_headers
removed and headers in the masked_headers
category restored. Then, the Session-Id
header is added.