-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
I've been using the auth/jwt package on a project for a while now and I constantly trip over the difference between FromHTTPContext and ToHTTPContext. The structure of the names don't help me remember which way the data is flowing.
From godoc:
func FromHTTPContext() http.RequestFuncFromHTTPContext moves JWT token from context to request header. Particularly useful for clients.
func ToHTTPContext() http.RequestFuncToHTTPContext moves JWT token from request header to context. Particularly useful for servers.
I'd prefer the following renaming of these functions (and the corresponding gRPC pair):
FromHTTPContext -> ContextToHTTP
ToHTTPContext -> HTTPToContext
Do others find the current names confusing also?
Does anyone have better suggestions that mine?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels