···55 "encoding/hex"
66 "encoding/json"
77 "errors"
88- "math/rand"
88+ "math/big"
99 "net/http"
1010 "net/url"
1111···127127func RandomVarchar(length int) string {
128128 b := make([]rune, length)
129129 for i := range b {
130130- b[i] = letters[rand.Intn(len(letters))]
130130+ n, err := crand.Int(crand.Reader, big.NewInt(int64(len(letters))))
131131+ if err != nil {
132132+ panic(err)
133133+ }
134134+ b[i] = letters[n.Int64()]
131135 }
132136 return string(b)
133137}
+3-3
oauth/client/manager.go
···254254 "default_max_age",
255255 "userinfo_signed_response_alg",
256256 "id_token_signed_response_alg",
257257- "userinfo_encryhpted_response_alg",
257257+ "userinfo_encrypted_response_alg",
258258 "authorization_encrypted_response_enc",
259259 "authorization_encrypted_response_alg",
260260 "tls_client_certificate_bound_access_tokens",
···367367 }
368368369369 if !slices.Contains(metadata.ResponseTypes, "code") {
370370- return nil, errors.New("response_types must inclue `code`")
370370+ return nil, errors.New("response_types must include `code`")
371371 }
372372373373 if !slices.Contains(metadata.GrantTypes, "authorization_code") {
···427427 return nil, fmt.Errorf("loopback redirect uri %s must use http", ruri)
428428 }
429429 case u.Scheme == "http":
430430- return nil, errors.New("only loopbvack redirect uris are allowed to use the `http` scheme")
430430+ return nil, errors.New("only loopback redirect uris are allowed to use the `http` scheme")
431431 case u.Scheme == "https":
432432 if isLocalHostname(u.Hostname()) {
433433 return nil, fmt.Errorf("redirect uri %s's domain must not be a local hostname", ruri)