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

Method putChatDebugLogging

coderd/exp_chats.go:5191–5210  ·  view source on GitHub ↗

EXPERIMENTAL: this endpoint is experimental and is subject to change.

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

5189
5190// EXPERIMENTAL: this endpoint is experimental and is subject to change.
5191func (api *API) putChatDebugLogging(rw http.ResponseWriter, r *http.Request) {
5192 ctx := r.Context()
5193 if !api.Authorize(r, policy.ActionUpdate, rbac.ResourceDeploymentConfig) {
5194 httpapi.Forbidden(rw)
5195 return
5196 }
5197
5198 var req codersdk.UpdateChatDebugLoggingAllowUsersRequest
5199 if !httpapi.Read(ctx, rw, r, &req) {
5200 return
5201 }
5202 if err := api.Database.UpsertChatDebugLoggingAllowUsers(ctx, req.AllowUsers); err != nil {
5203 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
5204 Message: "Internal error updating chat debug logging setting.",
5205 Detail: err.Error(),
5206 })
5207 return
5208 }
5209 rw.WriteHeader(http.StatusNoContent)
5210}
5211
5212// EXPERIMENTAL: this endpoint is experimental and is subject to change.
5213//

Callers

nothing calls this directly

Calls 8

AuthorizeMethod · 0.95
ForbiddenFunction · 0.92
ReadFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65
ErrorMethod · 0.45
WriteHeaderMethod · 0.45

Tested by

no test coverage detected