feat: add rbac tracing (#4093)

This commit is contained in:
Colin Adler
2022-09-16 18:32:15 +00:00
committed by GitHub
parent 1bca269b90
commit b340634aaa
14 changed files with 79 additions and 34 deletions
+3 -3
View File
@@ -13,8 +13,8 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/features"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/tracing"
)
type RequestParams struct {
@@ -93,9 +93,9 @@ func ResourceType[T Auditable](tgt T) database.ResourceType {
// that should be deferred, causing the audit log to be committed when the
// handler returns.
func InitRequest[T Auditable](w http.ResponseWriter, p *RequestParams) (*Request[T], func()) {
sw, ok := w.(*httpapi.StatusWriter)
sw, ok := w.(*tracing.StatusWriter)
if !ok {
panic("dev error: http.ResponseWriter is not *httpapi.StatusWriter")
panic("dev error: http.ResponseWriter is not *tracing.StatusWriter")
}
req := &Request[T]{