Add SSH Key Management

This commit is contained in:
Tom Wiesing 2023-01-15 13:41:56 +01:00
parent ef76844922
commit bcd1805001
No known key found for this signature in database
62 changed files with 1004 additions and 188 deletions

14
pkg/httpx/wrap.go Normal file
View file

@ -0,0 +1,14 @@
package httpx
import (
"context"
"net/http"
)
// WithContextWrapper generates a new handler that wraps the context of each request with the wrapper function.
func WithContextWrapper(handler http.Handler, wrapper func(context.Context) context.Context) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
r = r.WithContext(wrapper(r.Context()))
handler.ServeHTTP(w, r)
})
}