Approaches to Securely Store Authorization Header Value in Discord Implementation
I've been looking at approaches to implement Expanding Headers Type to Exclude Authorization Header (being able to store the
I've looked at changing the
Or allowing any key to be a
Both approaches seem doable; the former results in things like:
which is a bit more complex to implement but is possibly a more straightforward API.
Trying both approaches out, however, has shown that the
I've paused these changes to check for feedback on two related questions:
1. Would splitting the
2. What headers should it be possible to set as
Authorization header value as a secret to avoid logging it).I've looked at changing the
Headers type so that the values are strings except for that key:Or allowing any key to be a
Secret:Both approaches seem doable; the former results in things like:
which is a bit more complex to implement but is possibly a more straightforward API.
Trying both approaches out, however, has shown that the
Headers type is shared between both request- and response-related code for clients and servers. Response headers should remain as is; using the Secret type only needs to apply to requests.I've paused these changes to check for feedback on two related questions:
1. Would splitting the
Headers type into RequestHeaders and ResponseHeaders type be a good idea? (Maybe a generic would be better, so Headers<string> for responses, but Headers<Secret | string> for requests?)2. What headers should it be possible to set as
Secret on a request, just Authorization or any?