coder / coder/internal

Refactor workspace app auditing to include HTTP status codes returned outside of `Issue`

Open
#517 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

@mafredri one thing we could do is have `proxyWorkspaceApp` return the reverse proxy and an error/boolean/something. That way the code can look _something_ like:

```golang
token, audit, ok := ResolveRequest(rw, r, ResolveRequestOptions{
// ....

proxy, err := s.proxyWorkspaceApp(rw, r, *token, chiPath, appurl.ApplicationURL{})

audit()
proxy.ServeHTTP(rw, r)
```

That would catch all the top level proxy errors. It is a bit of a refactor, and I am sure I am not thinking of something. However the audit log up front feels like an improvement, and we do not need to hook into the status writer.

_Originally posted by @Emyrk in https://github.com/coder/coder/pull/16801#discussion_r1985158788_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.