MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / AddAPIKey

Method AddAPIKey

internal/tui/client.go:260–265  ·  view source on GitHub ↗

AddAPIKey adds a new API key by sending old=nil, new=key which appends.

(key string)

Source from the content-addressed store, hash-verified

258
259// AddAPIKey adds a new API key by sending old=nil, new=key which appends.
260func (c *Client) AddAPIKey(key string) error {
261 body := map[string]any{"old": nil, "new": key}
262 jsonBody, _ := json.Marshal(body)
263 _, err := c.patch("/v0/management/api-keys", strings.NewReader(string(jsonBody)))
264 return err
265}
266
267// EditAPIKey replaces an API key at the given index.
268func (c *Client) EditAPIKey(index int, newValue string) error {

Callers 1

UpdateMethod · 0.80

Calls 1

patchMethod · 0.95

Tested by

no test coverage detected