Skip to content

Add transparent proxy endpoint for RDI native API - #6468

Draft
ArtemHoruzhenko wants to merge 1 commit into
feature/rdi-ui/pipeline-draft-crudfrom
feature/rdi-ui/proxy-endpoint
Draft

Add transparent proxy endpoint for RDI native API#6468
ArtemHoruzhenko wants to merge 1 commit into
feature/rdi-ui/pipeline-draft-crudfrom
feature/rdi-ui/proxy-endpoint

Conversation

@ArtemHoruzhenko

Copy link
Copy Markdown
Contributor

What

Fourth PR in the rdi-ui integration chain (stacked on #6467, which is stacked on #6465/#6464).

Adds rdi/:id/proxy/*, a transparent passthrough to an RDI instance's native API. The upcoming @rdi-ui/pipeline package ships its own SDK (@rdi-ui/sdk) that speaks the native RDI API directly rather than RedisInsight's curated /rdi/:id/pipeline endpoints. This proxy gives it something real to call while keeping credentials and TLS handling entirely server-side.

Key points:

  • Why a proxy at all, not a direct browser→RDI call: RDI instances generally won't set CORS headers allowing RedisInsight's web origin, and RedisInsight would otherwise have to hand the browser either raw stored credentials or a JWT it obtained itself. Confirmed this is also how cloud-ui's own production integration of the same SDK works — it always proxies server-side rather than using the SDK's own login flow or a direct RDI URL.
  • Why RdiClient needs a new method (proxyRequest, declared on the abstract RdiClient, implemented once on ApiRdiClient, inherited by ApiV2RdiClient): the authenticated connection (bearer token, self-signed-cert TLS bypass) only exists inside that class; RdiClientProvider.getOrCreate() returns the abstract RdiClient type, so every other RDI capability is already exposed this same way. Reusing it avoids re-implementing login/token-refresh in the proxy layer.
  • Header stripping (both directions) prevents real bugs, not just tidiness: forwarding the caller's authorization/cookie would override the RDI client's own bearer token or leak RedisInsight's session; forwarding original content-length/content-encoding on the response would corrupt it in the browser once axios has already decompressed the body. Hop-by-hop headers (connection, te, trailer, etc.) are never proxy-safe per RFC 7230.
  • No frontend or npm dependency changes in this PR — that's next.

Testing

  • npm run lint:api and npm run type-check --prefix redisinsight/api (0 new errors) pass.
  • New specs for RdiProxyService, RdiProxyController, and ApiRdiClient.proxyRequest (incl. non-2xx passthrough).
  • Full rdi module test suite (293 tests) still passes.

No ticket yet.

@ArtemHoruzhenko
ArtemHoruzhenko force-pushed the feature/rdi-ui/proxy-endpoint branch from 26b2880 to fae4cd3 Compare September 1, 2026 09:46
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 93.24% 16819/18038
🟡 Branches 75.53% 5399/7148
🟢 Functions 87.7% 2588/2951
🟢 Lines 93.1% 16083/17275

Test suite run success

3813 tests passing in 330 suites.

Report generated by 🧪jest coverage report action from 4657769

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.72% 18558/23278
🟡 Branches 62.2% 8689/13969
🟡 Functions 67.45% 2516/3730
🟡 Lines 79.33% 17475/22028

Adds rdi/:id/proxy/* forwarding an arbitrary request to an RDI
instance's native API, with credentials and TLS handling staying
server-side and CORS avoided entirely since the browser only talks to
RedisInsight. Needed by the upcoming rdi-ui integration: the
@rdi-ui/pipeline package ships its own SDK that speaks the native RDI
API directly rather than RedisInsight's curated /rdi/:id/pipeline
endpoints, so this passthrough gives it something real to call.

RdiClient gains an abstract proxyRequest() method, implemented once on
ApiRdiClient (ApiV2RdiClient inherits it). Hop-by-hop, auth, and
transport-level headers are stripped in both directions.
@ArtemHoruzhenko
ArtemHoruzhenko force-pushed the feature/rdi-ui/proxy-endpoint branch from fae4cd3 to 4657769 Compare September 1, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant