Test context package

This commit is contained in:
2024-11-23 22:15:25 +01:00
parent 8f2f8b30dd
commit 9f241271a7
4 changed files with 366 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ func WithUserContextMiddleware(next http.Handler) http.Handler {
}
// WithWorkspaceContextMiddleware adds workspace information to the request context
func WithWorkspaceContextMiddleware(db db.Database) func(http.Handler) http.Handler {
func WithWorkspaceContextMiddleware(db db.WorkspaceReader) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx, ok := GetRequestContext(w, r)