Closed Phaust94 closed 1 year ago
After the discussion we decided that we want to leave x-write-key
masking as is. We do not store the key itself, only hash. So we don't want to store it anywhere when it comes (in Kafka queue, etc).
However, some verification is still possible.
keyId
- a part before :
is still available - you can compare it with key id. ctx.source
property. Like ctx.source.type === "s2s" && ctx.source.id === "...."
Description: When trying to access writeKey in Jitsu custom JS functions (jitsu next, cloud) I get that the value of
x-write-key
header is masked in both request body and headers:With the function above, if I send a request to
https://<domain>.d.jitsu.com/api/s/s2s/
withheaders={"X-Write-Key":"server_key_first_part:server_key_second_part"}
, I getevent.source = "CLIENT"
. However, if I replace the server key's second part with stars in the Jitsu function - I getevent.source = "SERVER"
instead:So the key is passed to the function in the header already masked. I would like to be able to match against the full key, to make sure I can trust the data in the event. Expected behaviour Write key is passed to the JS function in headers (
x-write-key
) as-is, unmasked Current behaviour Write key is passed to the JS function in headers (x-write-key
) with it's second part masked