--- API key endpoints (Item #3) --- authedJSON constructs a POST/PATCH with a JSON body and session cookie. Local to auth_test so the existing authedRequest stays body-less.
(method, url, sessionToken, body string)
| 155 | // authedJSON constructs a POST/PATCH with a JSON body and session cookie. |
| 156 | // Local to auth_test so the existing authedRequest stays body-less. |
| 157 | func authedJSON(method, url, sessionToken, body string) *http.Request { |
| 158 | req := httptest.NewRequest(method, url, strings.NewReader(body)) |
| 159 | req.Header.Set("Content-Type", "application/json") |
| 160 | req.AddCookie(&http.Cookie{Name: auth.SessionCookieName, Value: sessionToken}) |
| 161 | return req |
| 162 | } |
| 163 | |
| 164 | // TestHandleListAPIKeys_ReturnsLastUsedAtAndExpiresAt: the dashboard |
| 165 | // API keys table needs both columns to render. Asserts the JSON |
no outgoing calls
no test coverage detected