Skip to content

Add support for E2B access tokens in Kubernetes apps#2554

Merged
hosekpeter merged 5 commits intomainfrom
hosan/PAT-1542
Mar 31, 2026
Merged

Add support for E2B access tokens in Kubernetes apps#2554
hosekpeter merged 5 commits intomainfrom
hosan/PAT-1542

Conversation

@hosekpeter
Copy link
Copy Markdown
Contributor

Release Notes

Added support for E2B access tokens in Kubernetes applications and Secret configuration.

Plans for customer communication

None.

Impact analysis

This change enables Kubernetes apps to securely integrate with E2B using access tokens.

Change type

Feature enhancement.

Justification

Provides additional authentication functionality to Kubernetes apps, improving their integration capabilities with external systems.

Deployment

Merge & automatic deploy.

Rollback plan

Revert of this PR.

Post release support plan

None.

@linear
Copy link
Copy Markdown

linear Bot commented Mar 17, 2026

@hosekpeter hosekpeter marked this pull request as ready for review March 17, 2026 14:27
@hosekpeter hosekpeter requested review from Copilot and pepamartinec and removed request for jachym-tousek-keboola March 17, 2026 14:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for injecting an E2B access token (sourced from a Kubernetes Secret referenced by the App CRD) into upstream requests for E2B sandbox-backed apps, enabling Kubernetes apps to authenticate E2B traffic via apps-proxy.

Changes:

  • Extend the K8s App state cache to load/store an E2B access token from a referenced Secret.
  • Propagate the cached token into the upstream reverse proxy and inject it as an HTTP header.
  • Ensure handler recreation when the upstream URL or cached E2B token changes; update fakes/tests to register Secret list kinds and validate token loading behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/pkg/service/appsproxy/proxy/apphandler/upstream/upstream.go Stores E2B token on AppUpstream and injects it into proxied requests.
internal/pkg/service/appsproxy/proxy/apphandler/manager.go Rebuilds app handler when cached E2B token (or upstream URL/config) changes.
internal/pkg/service/appsproxy/dependencies/mocked.go Registers Secret list kind in fake dynamic client setup.
internal/pkg/service/appsproxy/dataapps/k8sapp/watcher_test.go Adds tests and helpers for E2B token loading from Secrets.
internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go Loads E2B token from Secret on App upsert and exposes it via cached AppInfo.
internal/pkg/service/appsproxy/dataapps/k8sapp/appinfo.go Extends App CRD minimal structs and cached AppInfo with runtime/backend + E2B sandbox secret reference + token.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go
Comment thread internal/pkg/service/appsproxy/dependencies/mocked.go
Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go
Comment thread internal/pkg/service/appsproxy/proxy/apphandler/upstream/upstream.go Outdated
Comment thread internal/pkg/service/appsproxy/proxy/apphandler/manager.go
@hosekpeter hosekpeter marked this pull request as draft March 25, 2026 15:27
@hosekpeter hosekpeter marked this pull request as ready for review March 26, 2026 09:43
@hosekpeter hosekpeter requested a review from pepamartinec March 26, 2026 09:43
Copy link
Copy Markdown
Contributor

@pepamartinec pepamartinec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review of the lazy-loading and error-handling in .

Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go
Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go Outdated
Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go Outdated
Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go
Comment thread internal/pkg/service/appsproxy/dataapps/k8sapp/watcher.go
@pepamartinec
Copy link
Copy Markdown
Contributor

@hosekpeter jeste jsem to prosel s Claudem a krome nejakyho bordelu nasel par zajimavych veci. To co sem poslal mi prislo relevantni a melo by se pofixovat, ale necham na tobe, jestli hned, nebo na to hodis separatni issue (jelikoz E2B appky zatim v produkci nejsou, nemelo by se nic z toho aktivovat)

@hosekpeter hosekpeter requested a review from pepamartinec March 26, 2026 13:25
Copy link
Copy Markdown
Contributor

@pepamartinec pepamartinec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope just irrelevant tests are failing 🤞

@hosekpeter hosekpeter merged commit 73ff8f9 into main Mar 31, 2026
15 checks passed
@hosekpeter hosekpeter deleted the hosan/PAT-1542 branch March 31, 2026 08:53
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.

4 participants