MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / authedJSON

Function authedJSON

internal/auth/auth_test.go:157–162  ·  view source on GitHub ↗

--- 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)

Source from the content-addressed store, hash-verified

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.
157func 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

Calls

no outgoing calls

Tested by

no test coverage detected