Skip to content

FEATURE - Enable SSH tunnel in CF backend middleware for OnPremise destinations #4519

@nikmace

Description

@nikmace

As a developer working on an SAP Adaptation Project targeting Cloud Foundry,
I want to have an SSH tunnel automatically established to the connectivity proxy when my
project uses OnPremise destinations
,
so that I can preview and test my adaptation project locally against on-premise backend systems without manual tunnel setup

Description

_When an adaptation project's webapp/xs-app.json contains routes pointing to BTP destinations
configured as OnPremise, the local development server cannot reach those backend systems
directly. Today, developers must manually deploy a tunnel app and run cf ssh -L to forward
traffic through the connectivity proxy — a tedious, error-prone process.

This feature automates the entire flow within @sap-ux/backend-proxy-middleware-cf. At
middleware startup it:

  1. Parses webapp/xs-app.json to extract destination names from routes.
  2. Queries the BTP Destination Configuration API to check whether any destination has
    ProxyType: OnPremise.
  3. If so, deploys a minimal CF app (if not already present) to serve as the SSH tunnel
    endpoint.
  4. Opens an SSH tunnel (cf ssh -L) forwarding localhost: to the connectivity proxy
    host/port.
  5. Overrides onpremise_proxy_host so the approuter middleware routes on-premise traffic through
    the local tunnel.

The tunnel lifecycle is fully managed — including port conflict detection, automatic cleanup on
process exit, and graceful skip when running in SAP Business Application Studio (where the
connectivity proxy is already reachable)._

Acceptance Criteria

GivenWhenThen format (https://martinfowler.com/bliki/GivenWhenThen.html)

Given I have an adaptation project with webapp/xs-app.json containing a route whose destination
is configured as OnPremise in BTP
when I start the local development server with backend-proxy-middleware-cf
then the middleware automatically deploys a tunnel app (if needed), opens an SSH tunnel to the
connectivity proxy, and routes on-premise traffic through localhost.

Notes

Tasks

  • Unit Tests added
  • Test Cases defined

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions