[Bug]: Updating a REST API on the gateway doesn't resolve its vhosts, so _gateway_default_ is stored as a hostname
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee gateway/gateway-controller/pkg/service/restapi/service.go, especialmente RestAPIService.Update y la ruta de creación a través de DeployAPIConfiguration; compara cómo gestiona cada una los vhosts. Después, inspecciona gateway/gateway-controller/pkg/utils/api_deployment.go y su función resolveVhostSentinels. El trabajo estará terminado cuando las actualizaciones resuelvan _gateway_default_ y los vhosts ausentes a los valores predeterminados actuales del gateway, y GET devuelva los valores resueltos; comprueba si existen pruebas de actualización de la REST API para confirmar este comportamiento.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
When a REST API is created on the gateway, its vhosts are resolved at deploy time: _gateway_default_, or a missing vhosts block, becomes the gateway's current default hosts. The resolved values are stored, so a later change to the gateway defaults doesn't move the API (discussion #369).
Updating the API through the gateway's REST API (PUT /rest-apis/{id}) skips that step:
- With
vhosts.main: _gateway_default_: the placeholder is stored literally, as a hostname. The API stops answering on the default hosts. - With no
vhostsblock: nothing is stored. The API keeps answering on the defaults only because the router falls back to the live default. So it follows the next config change, which is what deploy-time resolution is meant to prevent, andGETshows no vhosts.
Observed (gateway with router.vhosts.main.default = "*.wso2.com" and router.vhosts.sandbox.default = "*-sandbox.wso2.com")
POST /rest-apiswith novhosts:GET /rest-apis/{id}showsspec.vhosts.main*.wso2.comandspec.vhosts.sandbox*-sandbox.wso2.com, and a request withHost: api.wso2.comanswers 200.PUT /rest-apis/{id}withvhosts: {"main": "_gateway_default_"}:GETshowsspec.vhosts.main_gateway_default_, and the same request now answers 404.PUT /rest-apis/{id}with novhosts:GETshows nospec.vhostsat all.
Expected
An update resolves vhosts the same way a create does. _gateway_default_ and a missing vhosts block become the current gateway defaults, which are stored and shown by GET.
Cause
Create goes through DeployAPIConfiguration (gateway/gateway-controller/pkg/service/restapi/service.go:174), which calls resolveVhostSentinels (gateway/gateway-controller/pkg/utils/api_deployment.go:312). RestAPIService.Update (pkg/service/restapi/service.go:320) parses the body and saves it without that call. The event gateway's WebSub update does resolve vhosts, because it goes through DeployAPIConfiguration.
Steps to Reproduce
- Start a gateway with
[router.vhosts.main] default = "*.wso2.com". - Create a REST API with no
vhoststhroughPOST /rest-apis. A request withHost: api.wso2.comanswers 200. - Update it through
PUT /rest-apis/{id}with"vhosts": {"main": "_gateway_default_"}. GET /rest-apis/{id}shows_gateway_default_, and the request withHost: api.wso2.comanswers 404.- Update it again with no
vhosts:GETshows no vhosts.
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
Current main (e90cde473). Platform-api and gateway built from source and run by the IT suite (tests/framework), on macOS with Rancher Desktop.
- Lenguaje dominante
- Go
- Estrellas
- 85
- Forks
- 137
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 247
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
wso2/api-platform#4369 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsAbiertoArea/Policies Aspect/Other Severity/Trivial Type/Bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
wso2/api-platform#4355 ·
Los mantenedores suelen responder en 1 día
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
wso2/api-platform#4348 ·
Los mantenedores suelen responder en 1 día
-
Aspect/AI Aspect/API. Severity/Major
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
wso2/api-platform#4343 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: content-length-guardrail policy accepts a non-string streamingJsonPath at API creationAbiertoArea/Policies Aspect/Configuration Severity/Minor Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
wso2/api-platform#4330 ·
Los mantenedores suelen responder en 1 día
Todos los issues de wso2/api-platform
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
needs discussion
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openfga/openfga.dev#1436 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
都道府県を指定すると区名から始まる住所に市名を補わないAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
digital-go-jp/abr-geocoder#457 ·
Los mantenedores suelen responder en 3 días
-
benchmark
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
mozilla-ai/cq#601 ·
Los mantenedores suelen responder en 1 día