feat: Gotify CRUD + internal handler dispatch for notification service
CI / CI (pull_request) Successful in 3m11s
CI / CI (pull_request) Successful in 3m11s
- Add internal handler support to ServiceAdapter (Handler field) - Dispatcher routes to internal handler when set (no reverse proxy) - GotifyClient: full CRUD (send/list/delete messages, CRUD applications) - Refactor notification handler: route by X-Resource header, not body format - Register notification as ServiceAdapter with auth required - Resources: send-email, send-message, list-messages, delete-message, delete-all-messages, list-applications, create-application, delete-application - Update examples: sendmsg-email.sh, gotify-crud.sh - Env vars: GOTIFY_URL, GOTIFY_APP_TOKEN, GOTIFY_CLIENT_TOKEN
This commit is contained in:
@@ -80,6 +80,14 @@ func (d *Dispatcher) Dispatch(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// Internal handler: dispatch directly without reverse proxy
|
||||
if adapter.Handler != nil {
|
||||
// Set X-Upstream-Path so the handler knows which method was matched
|
||||
r.Header.Set("X-Upstream-Path", method.UpstreamPath)
|
||||
adapter.Handler.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
upstreamURL := adapter.Spec.Upstream.URL
|
||||
if strings.HasPrefix(upstreamURL, "grpc://") {
|
||||
d.dispatchGRPC(w, r, upstreamURL, method, adapter)
|
||||
|
||||
Reference in New Issue
Block a user