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

Method getChatDebugLogging

coderd/exp_chats.go:5169–5188  ·  view source on GitHub ↗

EXPERIMENTAL: this endpoint is experimental and is subject to change. nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.

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

Source from the content-addressed store, hash-verified

5167//
5168//nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.
5169func (api *API) getChatDebugLogging(rw http.ResponseWriter, r *http.Request) {
5170 ctx := r.Context()
5171 if !api.Authorize(r, policy.ActionRead, rbac.ResourceDeploymentConfig) {
5172 httpapi.ResourceNotFound(rw)
5173 return
5174 }
5175
5176 allowUsers, err := api.Database.GetChatDebugLoggingAllowUsers(ctx)
5177 if err != nil && !errors.Is(err, sql.ErrNoRows) {
5178 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
5179 Message: "Internal error fetching chat debug logging setting.",
5180 Detail: err.Error(),
5181 })
5182 return
5183 }
5184 httpapi.Write(ctx, rw, http.StatusOK, codersdk.ChatDebugLoggingAdminSettings{
5185 AllowUsers: err == nil && allowUsers,
5186 ForcedByDeployment: api.deploymentChatDebugLoggingEnabled(),
5187 })
5188}
5189
5190// EXPERIMENTAL: this endpoint is experimental and is subject to change.
5191func (api *API) putChatDebugLogging(rw http.ResponseWriter, r *http.Request) {

Callers 1

chatDebugLoggingFunction · 0.80

Calls 8

AuthorizeMethod · 0.95
ResourceNotFoundFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65
IsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected