MCPcopy Index your code
hub / github.com/coder/coder / DeleteUserSecret

Method DeleteUserSecret

codersdk/usersecrets.go:99–109  ·  view source on GitHub ↗
(ctx context.Context, user string, name string)

Source from the content-addressed store, hash-verified

97}
98
99func (c *Client) DeleteUserSecret(ctx context.Context, user string, name string) error {
100 res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/api/v2/users/%s/secrets/%s", user, name), nil)
101 if err != nil {
102 return err
103 }
104 defer res.Body.Close()
105 if res.StatusCode != http.StatusNoContent {
106 return ReadBodyAsError(res)
107 }
108 return nil
109}

Callers 3

TestUserSecretAuditFunction · 0.80
TestDeleteUserSecretFunction · 0.80
secretDeleteMethod · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 2

TestUserSecretAuditFunction · 0.64
TestDeleteUserSecretFunction · 0.64