Allow HTTPS for WebSub hub topic operations from gateway-controller

Aperta
#4,266 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
47/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Start with gateway/gateway-controller/pkg/utils/api_deployment.go and trace how the router's WebSub hub listener ports and HTTPS settings are configured. Then read EventGatewayConfig.Validate() and the related configuration and tests to see how options are loaded and checked. Done means the scheme, port and CA settings are covered, HTTPS verifies the router certificate, and invalid or disabled HTTPS configurations are rejected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Aspect/Other Type/Improvement
Please select the area the issue is related to

Gateway, Event Gateway

Please select the aspect the issue is related to

Aspect/Other (Anything else which does not match above categories)

Suggested Improvement

The gateway-controller registers and deregisters WebSub hub topics by sending a request to the router's internal WebSub hub listener. The URL's scheme is hard-coded to http:

// gateway/gateway-controller/pkg/utils/api_deployment.go
targetURL := fmt.Sprintf("http://%s:%d/websubhub/operations", webSubHubHost, webSubPort)

The router already exposes an HTTPS version of this internal listener on port 8446 (WEBSUB_HUB_INTERNAL_HTTPS_PORT) when HTTPS is enabled. Because the scheme is fixed, the controller can't use it. Deployments that want this traffic over TLS have no supported way to do that, for example when the controller and router run as separate containers or pods instead of sharing localhost.

Proposed Change
  1. Add a config option under router.event_gateway that selects the scheme, e.g. websub_hub_listener_scheme = "http" | "https". Default to http so existing deployments behave the same.
  2. When it's set to https:
    • Build the target URL with https:// and default the port to 8446 unless one is configured.
    • Use an HTTP client whose TLS settings trust the router's certificate. Allow a configurable CA bundle, and don't skip certificate verification.
  3. Validate the new option in EventGatewayConfig.Validate(). Reject unknown schemes, and reject https when the router's HTTPS listener isn't enabled.
Related Issues

No response

Lingua principale
Go
Stelle
85
Fork
137
Merge medio
1g 12h
PR unite (30g)
247

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wso2/api-platform

Tutte le issue di wso2/api-platform

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.