FAQ
https://codereview.appspot.com/6884049/diff/4001/oauth/jwt/jwt.go
File oauth/jwt/jwt.go (right):

https://codereview.appspot.com/6884049/diff/4001/oauth/jwt/jwt.go#newcode38
oauth/jwt/jwt.go:38: package jwt
On 2012/12/12 02:44:38, adg wrote:
Can I get an example of this new functionality in action?
I have a simple pass through example in jwt_test.go; I also added
another example here in the comments.

https://codereview.appspot.com/6884049/diff/4001/oauth/jwt/jwt.go#newcode76
oauth/jwt/jwt.go:76: func urlEncode(b []byte) string {
On 2012/12/12 02:44:38, adg wrote:
let's rename these to base64Encode and base64Decode, as that's what
they do

Done.

https://codereview.appspot.com/6884049/diff/4001/oauth/jwt/jwt.go#newcode205
oauth/jwt/jwt.go:205: if len(t.keyID) != 0 {
On 2012/12/12 02:44:38, adg wrote:
header := struct{
Algorithm string `json:"alg"`
Type string `json:"typ"`
KeyId string `json:"kid,omitempty"`
}{stdAlgorithm, stdType, t.keyId}
b, err := json.Marshal(header)
if err != nil {
panic(err)
}
return urlEncode(b)
I pulled out the Header struct and did more json.Marshal elsewhere to
clean this up.

https://codereview.appspot.com/6884049/diff/4001/oauth/jwt/jwt.go#newcode211
oauth/jwt/jwt.go:211: func (t *Token) SetKeyID(kid string) {
On 2012/12/12 02:44:38, adg wrote:
Why not just add a KeyID field if you want it to be mutable?
Good point. Fixed.

https://codereview.appspot.com/6884049/diff/4001/oauth/jwt/jwt.go#newcode349
oauth/jwt/jwt.go:349: d, err := urlDecode(s[1])
On 2012/12/12 02:44:38, adg wrote:
must check if len(s) >=1 before using s[1]
Done.

https://codereview.appspot.com/6884049/

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedDec 13, '12 at 12:17a
activeDec 13, '12 at 4:08a
posts2
users2
websitegolang.org

2 users in discussion

Adg: 1 post Sledbetter: 1 post

People

Translate

site design / logo © 2022 Grokbase