scopesFromChallenges returns the scopes from the given "WWW-Authenticate" header challenges. It only looks at challenges with the "Bearer" scheme.
(cs []oauthex.Challenge)
| 299 | // scopesFromChallenges returns the scopes from the given "WWW-Authenticate" header challenges. |
| 300 | // It only looks at challenges with the "Bearer" scheme. |
| 301 | func scopesFromChallenges(cs []oauthex.Challenge) []string { |
| 302 | for _, c := range cs { |
| 303 | if c.Scheme == "bearer" && c.Params["scope"] != "" { |
| 304 | return strings.Fields(c.Params["scope"]) |
| 305 | } |
| 306 | } |
| 307 | return nil |
| 308 | } |
| 309 | |
| 310 | // errorFromChallenges returns the error from the given "WWW-Authenticate" header challenges. |
| 311 | // It only looks at challenges with the "Bearer" scheme. |
no outgoing calls
no test coverage detected
searching dependent graphs…