(h string)
| 111 | } |
| 112 | |
| 113 | func parseAuthHeader(h string) (authHeader, error) { |
| 114 | parts := strings.Split(h, " ") |
| 115 | |
| 116 | if len(parts) != 2 { |
| 117 | return authHeader{}, errors.New("Invalid authorization header") |
| 118 | } |
| 119 | |
| 120 | parsed := authHeader{ |
| 121 | scheme: parts[0], |
| 122 | credential: parts[1], |
| 123 | } |
| 124 | |
| 125 | return parsed, nil |
| 126 | } |
| 127 | |
| 128 | // getSessionKeyFromAuth reads and returns a session key from the Authorization header |
| 129 | func getSessionKeyFromAuth(r *http.Request) (string, error) { |
no test coverage detected