wso2 / wso2/api-platform

Add support for separate endpointUrlMain and endpointUrlSandbox metadata keys for deployment endpoint overrides

Open
#1,352 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type/New Feature
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Description

Currently, the platform API accepts three metadata keys when creating/overriding a deployment:

  • endpointUrl - Overrides the upstream endpoint URL
  • vhostMain - Overrides the virtual host for the main environment
  • vhostSandbox - Overrides the virtual host for the sandbox environment

Since an API can have both a main and a sandbox upstream endpoint, it should be possible to override them independently at deployment time, just as vhosts can be overridden independently.

Proposed change

Introduce two new metadata keys alongside the existing one

  • endpointUrlMain — overrides Upstream.Main.URL
  • endpointUrlSandbox — overrides Upstream.Sandbox.URL

The existing endpointUrl key should either be kept as an alias for endpointUrlMain (for backwards compatibility) or deprecated.

Affected areas:

  • constants/constants.go — add MetadataKeyEndpointUrlMain, MetadataKeyEndpointUrlSandbox
  • service/deployment.go — read and apply both new keys; extend applyEndpointOverride (or split it) to handle sandbox URL
  • dto/upstream.go / gateway YAML structs — verify sandbox upstream URL field is writable through the same path
  • No Gateway side changes needed

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in constants/constants.go and service/deployment.go, then trace dto/upstream.go and the gateway YAML structs to verify how upstream URLs are written. Done means endpointUrlMain and endpointUrlSandbox independently override the main and sandbox URLs, while endpointUrl remains an alias or is deprecated; no Gateway changes are needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.