(w http.ResponseWriter, r *http.Request)
| 36 | } |
| 37 | |
| 38 | func (ah *testAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 39 | // Check if request is as expected. |
| 40 | ar := GetAPIRequest(r) |
| 41 | switch { |
| 42 | case ar == nil: |
| 43 | http.Error(w, "ar == nil", http.StatusInternalServerError) |
| 44 | case ar.AuthToken == nil: |
| 45 | http.Error(w, "ar.AuthToken == nil", http.StatusInternalServerError) |
| 46 | default: |
| 47 | http.Error(w, "auth success", http.StatusOK) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func makeAuthTestPath(reading bool, p Permission) string { |
| 52 | if reading { |
nothing calls this directly
no test coverage detected