-
Notifications
You must be signed in to change notification settings - Fork 32
Change platform api https port #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change platform api https port #423
Conversation
WalkthroughPort configuration update across the platform from 8443 to 9243. Changes span documentation, Docker configurations, Go application code, OpenAPI specifications, and frontend configuration files, replacing all references to the old port with the new port throughout the codebase. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
README.md (1)
78-78: Minor markdown formatting improvement for certificate acceptance step.The bare URL on Line 78 could be formatted as a proper markdown link for better tooling compatibility:
[https://localhost:9243](https://localhost:9243). This is a style improvement, not a functional issue.This aligns with the markdownlint recommendation (MD034). While the current bare URL is functional and clear, wrapping it in markdown link syntax improves documentation consistency and passes linting checks.
- Open [https://localhost:9243](https://localhost:9243) in your browser and accept the self-signed certificate.platform-api/spec/impls/gateway-management/gateway-management.md (1)
335-336: Port migration applied consistently; Gitleaks warnings are false positives.All curl examples correctly reference port 9243. The Gitleaks "high" severity warnings flagging bearer tokens in curl headers are false positives: these are documentation examples with placeholder JWT tokens (indicated by the "..." ellipsis), not real secrets.
Optional improvement: To reduce scanner noise, consider adding a comment above the first example like:
> **Note**: `eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...` represents a sample JWT token. Replace with your actual token for testing.Also applies to: 369-370, 416-417, 441-442, 473-474, 501-502
kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml (1)
87-90: Port update is correct; consider a note abouthost.docker.internalportability.
If this manifest is expected to work beyond local Docker Desktop setups,host.docker.internalmay not resolve in many Kubernetes environments—worth ensuring docs/samples position this as “local-only”, or make the host clearly user-configurable in the manifest generation flow.kubernetes/gateway-operator/internal/k8sutil/template_data.go (1)
37-39: DefaultControlPlaneHostupdate to:9243is aligned; consider centralizing the default.
To avoid future “port drift” across generator/template code, you could define a single constant (or source from a config default) used wherever the control plane default endpoint is rendered.Also applies to: 84-94
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (37)
README.md(2 hunks)distribution/all-in-one/docker-compose.yaml(1 hunks)gateway/docker-compose.yaml(1 hunks)gateway/gateway-controller/pkg/config/config.go(1 hunks)gateway/spec/impls/3-gateway-control-plane-registration.md(3 hunks)kubernetes/gateway-operator/HELM_DEPLOYMENT.md(1 hunks)kubernetes/gateway-operator/IMPLEMENTATION_SUMMARY.md(1 hunks)kubernetes/gateway-operator/config/gateway_values.yaml(1 hunks)kubernetes/gateway-operator/config/samples/api_v1_gatewayconfiguration.yaml(1 hunks)kubernetes/gateway-operator/config/samples/operator-config.yaml(1 hunks)kubernetes/gateway-operator/docs/CONFIGURATION.md(3 hunks)kubernetes/gateway-operator/docs/GATEWAY_API_SPEC.md(1 hunks)kubernetes/gateway-operator/internal/controller/resources/README.md(1 hunks)kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml(1 hunks)kubernetes/gateway-operator/internal/k8sutil/template_data.go(2 hunks)kubernetes/helm/gateway-helm-chart/README.md(2 hunks)kubernetes/helm/gateway-helm-chart/values.yaml(1 hunks)kubernetes/helm/operator-helm-chart/values.yaml(1 hunks)platform-api/Dockerfile(1 hunks)platform-api/README.md(7 hunks)platform-api/spec/architecture.md(1 hunks)platform-api/spec/authentication.md(1 hunks)platform-api/spec/impls/api-lifecycle-management.md(1 hunks)platform-api/spec/impls/apiportal-api-publishing.md(2 hunks)platform-api/spec/impls/gateway-management/gateway-management.md(9 hunks)platform-api/spec/impls/gateway-websocket-events/artifacts/plan.md(2 hunks)platform-api/spec/impls/gateway-websocket-events/artifacts/spec.md(1 hunks)platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md(6 hunks)platform-api/spec/impls/organization-management.md(1 hunks)platform-api/spec/impls/project-management.md(1 hunks)platform-api/spec/prds/gateway-websocket-events.md(1 hunks)platform-api/src/cmd/main.go(1 hunks)platform-api/src/internal/server/server.go(1 hunks)platform-api/src/resources/gateway-internal-api.yaml(1 hunks)platform-api/src/resources/openapi.yaml(1 hunks)portals/management-portal/README.md(2 hunks)portals/management-portal/src/hooks/apiConfig.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-06T11:57:08.456Z
Learnt from: BLasan
Repo: wso2/api-platform PR: 140
File: gateway/gateway-controller/pkg/utils/api_deployment.go:88-105
Timestamp: 2025-12-06T11:57:08.456Z
Learning: In the gateway-controller Go codebase (file: gateway/gateway-controller/pkg/utils/api_deployment.go), only the async/websub API kind is currently supported. async/websocket and async/sse API kinds are not yet implemented.
Applied to files:
platform-api/spec/impls/gateway-websocket-events/artifacts/plan.mdplatform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
📚 Learning: 2025-11-08T13:06:22.133Z
Learnt from: thivindu
Repo: wso2/api-platform PR: 110
File: platform-api/src/internal/service/api.go:432-476
Timestamp: 2025-11-08T13:06:22.133Z
Learning: In the platform-api Go codebase (file: platform-api/src/internal/service/api.go), the DeployAPIRevision method is designed to automatically create API-gateway associations during deployment if they don't already exist. There is no requirement that associations must pre-exist before deployment; the system checks for existing associations and creates them on-the-fly as needed.
Applied to files:
platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.mdplatform-api/spec/impls/api-lifecycle-management.mdplatform-api/README.md
🪛 Gitleaks (8.30.0)
platform-api/spec/impls/gateway-management/gateway-management.md
[high] 335-336: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 369-370: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 416-417: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 441-442: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 473-474: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
[high] 501-502: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🪛 markdownlint-cli2 (0.18.1)
README.md
78-78: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (34)
platform-api/spec/architecture.md (1)
9-9: Port reference correctly updated to 9243.The HTTPS server port documentation has been accurately updated to reflect the new default port (9243) as part of the systematic port migration to avoid collision with the gateway router HTTPS port.
kubernetes/helm/operator-helm-chart/values.yaml (1)
84-84: Port migration to 9243 is correct and complete in Helm values.The control plane port has been properly updated to 9243, separating it from the gateway router HTTPS port (8443). This aligns with the PR objective to avoid port collisions.
platform-api/src/resources/openapi.yaml (1)
31-31: OpenAPI development server URL correctly updated to port 9243.The development server endpoint now references the new control plane port. Production server configuration (line 33) is appropriately left unchanged.
kubernetes/gateway-operator/docs/GATEWAY_API_SPEC.md (1)
145-145: Gateway API specification example correctly reflects port 9243.The control plane host in the full spec example now uses the correct HTTPS port. This documentation change ensures developers copy-paste accurate configurations.
gateway/gateway-controller/pkg/config/config.go (1)
375-375: Default control plane host correctly updated to port 9243.The gateway controller's default configuration now points to the correct control plane port. This ensures gateway instances connect to the platform API on the new port without requiring explicit configuration override.
platform-api/spec/authentication.md (1)
140-140: Authentication example curl command updated to port 9243.The API endpoint in the documentation example now matches the actual platform API port, ensuring developers use correct URLs when testing authentication.
platform-api/spec/impls/organization-management.md (1)
20-21: Organization management curl examples updated to port 9243.Both registration and fetch verification examples now use the correct API port. The
-kflag for self-signed certificate handling is appropriately preserved.kubernetes/gateway-operator/HELM_DEPLOYMENT.md (1)
112-112: Helm deployment documentation example updated to port 9243.The GatewayConfiguration sample now references the correct control plane port. This ensures users deploying gateways via Helm will have correct connectivity configuration.
README.md (1)
65-65: Quick start curl example correctly uses port 9243.The organization registration example in the quick start guide now references the correct API port, ensuring users can successfully complete the setup.
platform-api/src/resources/gateway-internal-api.yaml (1)
16-16: LGTM! Development server URL updated correctly.The development server URL has been updated to reflect the new port 9243, consistent with the platform-wide port migration.
kubernetes/gateway-operator/internal/controller/resources/README.md (1)
208-208: LGTM! Documentation updated to reflect new control plane port.The template variables reference table correctly documents the new default port 9243 for the control plane endpoint.
platform-api/Dockerfile (1)
62-65: LGTM! Docker configuration updated correctly.Both the exposed port and health check URL have been updated to 9243, ensuring consistent container configuration and health monitoring on the new port.
portals/management-portal/src/hooks/apiConfig.ts (1)
1-1: LGTM! Default API base URL updated correctly.The default base URL has been updated to port 9243, ensuring the management portal connects to the platform API on the new port when
VITE_PLATFORM_API_URLis not configured.platform-api/spec/impls/gateway-websocket-events/artifacts/spec.md (1)
145-145: LGTM! Functional requirement updated to reflect new WebSocket endpoint.The WebSocket connection endpoint specification has been correctly updated to port 9243, maintaining accurate API contract documentation.
portals/management-portal/README.md (1)
62-62: LGTM! Setup documentation updated consistently.All references to the platform API port have been correctly updated to 9243:
- Docker port mapping now correctly exposes container port 9243 to host port 9243
- Browser URL and API endpoint examples reflect the new port
These changes ensure developers can successfully follow the setup instructions with the new port configuration.
Also applies to: 149-149, 155-155
gateway/spec/impls/3-gateway-control-plane-registration.md (1)
30-30: LGTM! Gateway control plane registration documentation updated consistently.All references to the control plane WebSocket endpoint have been correctly updated to port 9243 across:
- Startup behavior description
- Configuration table default value
- Docker Compose configuration example
This ensures consistent documentation for gateway-to-control-plane connectivity.
Also applies to: 166-166, 184-184
kubernetes/helm/gateway-helm-chart/values.yaml (1)
38-38: Clarify port configuration purpose before approving.The review correctly identifies that port 9243 has been added to the
controlPlanesection at line 38 for control plane communication. However, the verification request is based on a misunderstanding: the port 8443 references that remain throughout the codebase (lines 128, 235, in templates, docker-compose, etc.) are for the gateway's downstream HTTPS listener—a separate, unrelated port configuration that should not be removed. These are two distinct ports serving different purposes:
- 9243: Gateway-to-control-plane communication (newly configured)
- 8443: Gateway's HTTPS listener for downstream client connections (unchanged, properly remains)
The verification request to ensure "no references to port 8443 remain" is based on an incorrect assumption that these ports are being migrated together. They are independent configurations.
Likely an incorrect or invalid review comment.
kubernetes/helm/gateway-helm-chart/README.md (1)
21-21: LGTM!The example commands correctly reflect the new control plane port (9243). Documentation is consistent with the port migration.
Also applies to: 31-31
platform-api/src/cmd/main.go (1)
35-36: LGTM!The HTTPS server startup correctly uses port 9243 in both the log message and the actual
Start()call, ensuring consistency.kubernetes/gateway-operator/config/samples/operator-config.yaml (1)
12-12: LGTM!The control plane host configuration correctly references port 9243, aligning with the new default port.
platform-api/src/internal/server/server.go (1)
206-206: LGTM! Note the breaking change.The default port is correctly updated to 9243. Be aware that any existing deployments relying on the default port will need to be updated or may experience connectivity issues after this change.
kubernetes/gateway-operator/config/gateway_values.yaml (1)
38-38: LGTM!The control plane port is correctly updated to 9243. Note that the gateway router HTTPS port (line 232) intentionally remains at 8443, which is the purpose of this change—to avoid port collision between the control plane and the gateway router.
kubernetes/gateway-operator/IMPLEMENTATION_SUMMARY.md (1)
71-71: LGTM!The documentation example correctly reflects the new control plane port (9243).
platform-api/spec/impls/project-management.md (1)
20-21: LGTM!The verification curl commands correctly target the new HTTPS port (9243).
kubernetes/gateway-operator/config/samples/api_v1_gatewayconfiguration.yaml (1)
28-28: LGTM!The control plane host configuration correctly uses port 9243.
distribution/all-in-one/docker-compose.yaml (1)
56-56: Port migration to 9243 applied correctly.The platform-api service port mapping and health check URL are consistent and align with the broader port migration across the system.
Also applies to: 62-62
gateway/docker-compose.yaml (1)
32-32: Gateway control plane port updated correctly.The environment variable correctly targets the platform-api on the new port. The router's HTTPS port (8443) remains appropriate for its role.
platform-api/README.md (1)
35-35: Documentation examples updated consistently.All curl and wscat commands now reference the correct platform-api port (9243). Examples are ready for users to follow.
Also applies to: 44-44, 55-55, 79-79, 103-103, 118-118, 137-137
platform-api/spec/impls/apiportal-api-publishing.md (1)
34-34: Port migration applied consistently.Both publish and unpublish endpoint examples now reference port 9243 correctly.
Also applies to: 63-63
platform-api/spec/impls/api-lifecycle-management.md (1)
25-29: Port migration applied consistently across lifecycle examples.All verification examples (create, fetch, list, deploy, gateway retrieval) now reference port 9243.
kubernetes/gateway-operator/docs/CONFIGURATION.md (1)
49-49: Configuration defaults updated consistently.Environment variable defaults, configuration table, and sample output all reference the correct control plane port (9243).
Also applies to: 99-99, 255-255
platform-api/spec/prds/gateway-websocket-events.md (1)
10-10: WebSocket endpoint port updated correctly.The gateway connection URL now references the correct platform-api port (9243) while maintaining the secure WebSocket protocol (wss://).
platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md (1)
226-233: Port migration examples look consistent (9243) across curl + wscat flows.
These updated commands should keep the “copy/paste” verification path working after the default HTTPS port change.Also applies to: 248-266, 278-288, 298-303
platform-api/spec/impls/gateway-websocket-events/artifacts/plan.md (1)
7-7: Plan doc endpoint updates to 9243 are consistent and complete.
No additional functional/doc contract concerns in the changed sections.Also applies to: 248-256
| ### Connection Establishment | ||
|
|
||
| 1. Gateway initiates WebSocket upgrade request to `wss://platform-api:8443/api/internal/v1/ws/gateways/connect` | ||
| 1. Gateway initiates WebSocket upgrade request to `wss://platform-api:9243/api/internal/v1/ws/gateways/connect` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify when to use platform-api vs localhost hostnames in examples.
Line 31 uses wss://platform-api:9243/... while later verification uses wss://localhost:9243/...; consider a short note that platform-api is the in-network service/DNS name (e.g., docker-compose/k8s) vs localhost for local testing.
🤖 Prompt for AI Agents
In platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
around line 31, the example hostnames mix wss://platform-api and wss://localhost
which can confuse readers; add a short clarifying note explaining that
"platform-api" is the in-network service/DNS name used in
container/orchestration environments (docker-compose/k8s) while "localhost" is
for local/manual testing, and update the examples or an inline footnote to
consistently show both usages and when to use each.
9fcf3e2 to
31e63d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
README.md(2 hunks)distribution/all-in-one/docker-compose.yaml(1 hunks)gateway/docker-compose.yaml(1 hunks)gateway/gateway-controller/pkg/config/config.go(1 hunks)gateway/spec/impls/3-gateway-control-plane-registration.md(3 hunks)platform-api/Dockerfile(1 hunks)platform-api/README.md(7 hunks)platform-api/spec/architecture.md(1 hunks)platform-api/spec/authentication.md(1 hunks)platform-api/spec/impls/api-lifecycle-management.md(1 hunks)platform-api/spec/impls/apiportal-api-publishing.md(2 hunks)platform-api/spec/impls/gateway-management/gateway-management.md(9 hunks)platform-api/spec/impls/gateway-websocket-events/artifacts/plan.md(2 hunks)platform-api/spec/impls/gateway-websocket-events/artifacts/spec.md(1 hunks)platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md(6 hunks)platform-api/spec/impls/organization-management.md(1 hunks)platform-api/spec/impls/project-management.md(1 hunks)platform-api/spec/prds/gateway-websocket-events.md(1 hunks)platform-api/src/cmd/main.go(1 hunks)platform-api/src/internal/server/server.go(1 hunks)platform-api/src/resources/gateway-internal-api.yaml(1 hunks)platform-api/src/resources/openapi.yaml(1 hunks)portals/management-portal/README.md(2 hunks)portals/management-portal/src/hooks/apiConfig.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (17)
- platform-api/spec/impls/api-lifecycle-management.md
- platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
- platform-api/spec/architecture.md
- portals/management-portal/src/hooks/apiConfig.ts
- portals/management-portal/README.md
- gateway/gateway-controller/pkg/config/config.go
- platform-api/spec/prds/gateway-websocket-events.md
- gateway/docker-compose.yaml
- platform-api/spec/impls/gateway-websocket-events/artifacts/spec.md
- platform-api/spec/impls/apiportal-api-publishing.md
- platform-api/spec/impls/gateway-management/gateway-management.md
- platform-api/spec/authentication.md
- platform-api/spec/impls/gateway-websocket-events/artifacts/plan.md
- platform-api/src/cmd/main.go
- gateway/spec/impls/3-gateway-control-plane-registration.md
- platform-api/src/internal/server/server.go
- platform-api/spec/impls/organization-management.md
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-08T13:06:22.133Z
Learnt from: thivindu
Repo: wso2/api-platform PR: 110
File: platform-api/src/internal/service/api.go:432-476
Timestamp: 2025-11-08T13:06:22.133Z
Learning: In the platform-api Go codebase (file: platform-api/src/internal/service/api.go), the DeployAPIRevision method is designed to automatically create API-gateway associations during deployment if they don't already exist. There is no requirement that associations must pre-exist before deployment; the system checks for existing associations and creates them on-the-fly as needed.
Applied to files:
platform-api/README.md
🪛 markdownlint-cli2 (0.18.1)
README.md
78-78: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (6)
platform-api/Dockerfile (1)
88-88: Port change is correct.The EXPOSE directive correctly reflects the platform-api application's new HTTPS port 9243, aligning with the broader port migration throughout the codebase.
platform-api/spec/impls/project-management.md (1)
20-21: Documentation examples correctly reference port 9243.The curl examples for Create and List operations properly reflect the updated HTTPS port, ensuring developers use the correct endpoint.
platform-api/src/resources/gateway-internal-api.yaml (1)
16-16: Gateway internal API development server URL correctly updated.The development server endpoint is properly updated to reflect the new HTTPS port 9243, ensuring clients of this internal API specification use the correct endpoint.
distribution/all-in-one/docker-compose.yaml (1)
56-56: Docker port mapping and healthcheck properly aligned.The port mapping (9243:9243) and corresponding healthcheck URL update (line 62) are correctly configured. The healthcheck will properly validate the container is running on the new port.
Also applies to: 62-62
platform-api/src/resources/openapi.yaml (1)
31-31: Platform API OpenAPI specification correctly updated.The development server URL is properly updated to https://localhost:9243/api/v1, ensuring API clients, SDKs, and testing tools generated from this specification use the correct HTTPS port.
platform-api/README.md (1)
35-35: README examples comprehensively and correctly updated to port 9243.All API endpoint examples, including curl commands and WebSocket connections, are properly updated to reflect the new HTTPS port. The documentation provides accurate guidance for developers working with the updated port configuration.
Also applies to: 44-44, 55-55, 79-79, 103-103, 118-118, 137-137
|
|
||
| ```bash | ||
| curl -k --location 'https://localhost:8443/api/v1/organizations' \ | ||
| curl -k --location 'https://localhost:9243/api/v1/organizations' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port references correctly updated; minor formatting issue in documentation.
The organization creation endpoint (line 65) and certificate acceptance URL (line 78) are correctly updated to port 9243. However, the bare URL at line 78 should be wrapped for better markdown formatting.
Apply this formatting fix:
-Open https://localhost:9243 in your browser and accept the self-signed certificate.
+Open <https://localhost:9243> in your browser and accept the self-signed certificate.Also applies to: 78-78
🤖 Prompt for AI Agents
In README.md around lines 65 and 78, the endpoint URLs are correctly using port
9243 but the bare URL at line 78 needs markdown-safe wrapping; wrap the plain
URL (and any other bare URLs on these lines) in inline code ticks (or angle
brackets) so they render consistently in Markdown and do not break formatting.
Purpose
The platform api HTTPS port collides with the gateway router HTTPS port
Fixes: wso2/api-platform/issues#422
Approach
This pull request updates the default control plane and API endpoints port from
8443to9243throughout the project. The change standardizes the port usage across documentation, configuration files, Docker, Kubernetes manifests, Helm charts, and code, ensuring consistency for both development and deployment environments.Configuration and Code Updates:
8443to9243in configuration files and code, including Go source files, Kubernetes manifests, Helm chart values, and Dockerfiles. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]Documentation Updates:
9243instead of8443, includingREADME.mdfiles, API usage examples, and configuration guides. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]This change will require anyone running or configuring the platform to use port
9243for secure API and control plane communications going forward.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.