Skip to content

Unify secure-gateway URL wrappers: inference_models proxy builder lacks idempotence guard and drops gateway base path #2662

Description

@alexnorell

Follow-ups from the secure-gateway audit on #2658 (out of that PR's scope):

1. roboflow_secure_gateway_proxy_url_builder (inference_models/inference_models/weights_providers/roboflow.py) diverges from wrap_url (inference/core/utils/url_utils.py):

  • No idempotence guard: an already-wrapped download_url gets double-proxied ({gateway}/proxy?url={gateway}%2Fproxy%3Furl%3D...). wrap_url gained this guard in Fix outbound calls that bypass the secure gateway #2658.
  • Base-path handling differs: the builder uses urlsplit scheme+netloc only, dropping any path on the gateway value (SECURE_GATEWAY=https://gw.local/edge → weights traffic goes to gw.local/proxy while server traffic goes to gw.local/edge/proxy).

Both wrappers implement the same /proxy?url= contract; they should either share one implementation or be kept behavior-identical with cross-package tests.

2. Per-run step_execution_mode bypasses the env-level hosted-endpoint gate: #2658 forces WORKFLOWS_STEP_EXECUTION_MODE=local behind SECURE_GATEWAY when the hosted target is configured, but a caller passing workflows_core.step_execution_mode=StepExecutionMode.REMOTE via init_parameters still routes all 42 run_remotely blocks at HOSTED_*_URL — unreachable behind a gateway. The durable fix is gateway support in inference_sdk's InferenceHTTPClient (it path-joins onto api_url, which cannot compose with /proxy?url=<encoded>), or a guard at the StepExecutionMode consumption point.

Context: #2658, #2263.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions