()
| 1415 | } |
| 1416 | |
| 1417 | func (h *handler) getBasicAuth() (username string, password string) { |
| 1418 | auth := h.rq.Header.Get("Authorization") |
| 1419 | if strings.HasPrefix(auth, "Basic ") { |
| 1420 | decoded, err := base64.StdEncoding.DecodeString(auth[6:]) |
| 1421 | if err == nil { |
| 1422 | components := strings.SplitN(string(decoded), ":", 2) |
| 1423 | if len(components) == 2 { |
| 1424 | return components[0], components[1] |
| 1425 | } |
| 1426 | } |
| 1427 | } |
| 1428 | return |
| 1429 | } |
| 1430 | |
| 1431 | func (h *handler) getBearerToken() string { |
| 1432 | auth := h.rq.Header.Get("Authorization") |
no test coverage detected