feat: webhooker 1.0 MVP — entity rename, core engine, delivery, management UI #16

Merged
sneak merged 33 commits from feature/mvp-1.0 into main 2026-03-04 01:19:41 +01:00
Showing only changes of commit 45228d9e99 - Show all commits

View File

@@ -108,18 +108,22 @@ func (s *Middleware) Logging() func(http.Handler) http.Handler {
} }
func (s *Middleware) CORS() func(http.Handler) http.Handler { func (s *Middleware) CORS() func(http.Handler) http.Handler {
return cors.Handler(cors.Options{ if s.params.Config.IsDev() {
// CHANGEME! these are defaults, change them to suit your needs or // In development, allow any origin for local testing.
// read from environment/viper. return cors.Handler(cors.Options{
// AllowedOrigins: []string{"https://foo.com"}, // Use this to allow specific origin hosts AllowedOrigins: []string{"*"},
AllowedOrigins: []string{"*"}, AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
// AllowOriginFunc: func(r *http.Request, origin string) bool { return true }, AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, ExposedHeaders: []string{"Link"},
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"}, AllowCredentials: false,
ExposedHeaders: []string{"Link"}, MaxAge: 300,
AllowCredentials: false, })
MaxAge: 300, // Maximum value not ignored by any of major browsers }
}) // In production, the web UI is server-rendered so cross-origin
// requests are not expected. Return a no-op middleware.
return func(next http.Handler) http.Handler {
return next
}
} }
// RequireAuth returns middleware that checks for a valid session. // RequireAuth returns middleware that checks for a valid session.