camunda / camunda/orchestration-cluster-api-python
Add config option to opt out of automatic /v2 suffix on CAMUNDA_REST_ADDRESS
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 6h 15m
- Merged PRs (30d)
- 20
Description
Summary
Please add a configuration option to opt out of the automatic /v2 suffix that the SDK appends to CAMUNDA_REST_ADDRESS (e.g. an env var CAMUNDA_REST_ADDRESS_EXACT=true and/or a config field CAMUNDA_REST_ADDRESS_EXACT).
Current behaviour
_normalize_rest_address() unconditionally appends /v2 unless the value already ends in /v2 (in runtime/configuration_resolver.py):
@staticmethod
def _normalize_rest_address(value: str) -> str:
value = value.strip()
if not value:
return value
normalized = value.rstrip("/")
if normalized.endswith("/v2"):
return normalized
return normalized + "/v2"
This runs in the @model_validator(mode="after") on CamundaSdkConfiguration, normalizing both CAMUNDA_REST_ADDRESS and ZEEBE_REST_ADDRESS. The field doc even states "/v2 is appended automatically if missing" — there is no way to have the SDK use the address exactly as provided.
Why this is a problem
For deployments behind an API gateway / reverse proxy, the effective base path often does not follow the .../v2 convention (the gateway may mount the REST API under a different prefix, or strip/rewrite path segments). Because the suffix is unconditional, these setups cannot be expressed through configuration alone.
Impact / current workaround
We consume this family of SDKs in camunda/c8ctl and support gateway-fronted profiles via c8ctl add profile --exactBaseUrl. To make that work with SDKs that force the /v2 suffix, we have to rewrite outgoing request URLs to strip the SDK-computed .../v2 and substitute the profile's literal base URL. This is brittle and couples us to the SDK's internal URL format.
Proposed solution
Add a boolean config/env option — e.g. CAMUNDA_REST_ADDRESS_EXACT=true — that short-circuits _normalize_rest_address() so the configured address is used verbatim (no /v2 appended).
Alternatives considered
- Requiring users to embed
/v2in the address — doesn't help, since the gateway path may differ from the/v2convention entirely. - URL rewriting in a custom transport (our current workaround) — works but is fragile.
Cross-SDK note
This is a family-wide behaviour: the JS, Go, C# and Rust SDKs all append /v2 unconditionally with no opt-out. Tracking issue on the JS SDK: camunda/orchestration-cluster-api-js#499. It would be ideal to align the opt-out mechanism (env var name + config field) across all five SDKs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in runtime/configuration_resolver.py with _normalize_rest_address() and the CamundaSdkConfiguration model validator, then trace how CAMUNDA_REST_ADDRESS and ZEEBE_REST_ADDRESS are loaded. Add the proposed exact-address configuration behavior and verify that both addresses can bypass automatic /v2 appending while retaining current normalization by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100