Conversation
|
For the record, #!/usr/bin/env fish
for pair in \
"FromHTTPContext ContextToHTTP" \
"ToHTTPContext HTTPToContext" \
"FromGRPCContext ContextToGRPC" \
"ToGRPCContext GRPCToContext" \
"FromHTTPRequest HTTPToContext" \
"ToHTTPRequest ContextToHTTP" \
"FromGRPCRequest GRPCToContext" \
"ToGRPCRequest ContextToGRPC"
set fr (echo $pair | awk '{print $1}')
set to (echo $pair | awk '{print $2}')
echo change from $fr to $to
find . -type f -name '*.go' -exec sed -i '' s/$fr/$to/ \{\} + # macOS syntax
end |
ChrisHines
left a comment
There was a problem hiding this comment.
The code looks good. I think the docs have some broken grammar.
auth/jwt/transport.go
Outdated
| ) | ||
|
|
||
| // ToHTTPContext moves JWT token from request header to context. Particularly | ||
| // HTTPToContext moves JWT token from request header to context. Particularly |
There was a problem hiding this comment.
I feel obligated to point out that JWT is an acronym for JSON Web Token, which makes the phrase "JWT token" repetitive. I believe a more grammatically correct phrasing is "... moves a JWT from request header to context."
| ) | ||
|
|
||
| // ToHTTPContext moves JWT token from request header to context. Particularly | ||
| // HTTPToContext moves a JWT from request header to context. Particularly |
There was a problem hiding this comment.
The "a" article use is now inconsistent (present with "JWT", absent with "request header" and "context"), not sure if that's intentional, not a big deal.
| // HTTPToContext moves a JWT from request header to context. Particularly | ||
| // useful for servers. | ||
| func ToHTTPContext() http.RequestFunc { | ||
| func HTTPToContext() http.RequestFunc { |
There was a problem hiding this comment.
"Context" seems to be in all of these names, so is it redundant? Would To/FromHTTP and To/FromGRPC be equally clear? I haven't taken a close look at the whole file, and I've never used the package, so I'm genuinely asking. :) If not, the names look good!
Fix confusing names
Closes #526.
@ChrisHines @basvanbeek — interested in a review?
@willfaught @terinjokes — likewise, and FYI.