Skip to content

fix(dashboard-api): hide default templates for BYOC teams (clusterID != nil)#2805

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1779484618-hide-default-templates-for-byoc
Open

fix(dashboard-api): hide default templates for BYOC teams (clusterID != nil)#2805
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1779484618-hide-default-templates-for-byoc

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Summary

When a team has a clusterID defined (BYOC customer), the /templates/defaults endpoint now returns an empty list instead of showing E2B public templates that aren't available in their cluster.

Changes:

  • Added team auth (Supabase2TeamAuth / AuthProviderTeamAuth) to the /templates/defaults endpoint in the OpenAPI spec
  • Added early-return check in GetTemplatesDefaults handler: if team.ClusterID != nil, respond with empty templates list
  • Regenerated api.gen.go from updated spec

Review & Testing Checklist for Human

  • Verify the dashboard frontend sends team headers (X-Supabase-Team or X-Team-ID) when calling /templates/defaults. If not, a corresponding dashboard change is needed.
  • Test with a BYOC team (non-nil clusterID) — should see empty templates list
  • Test with a regular team (nil clusterID) — should see default templates as before
  • Confirm no regression for users authenticating via AuthProviderBearerAuth + AuthProviderTeamAuth

Notes

This addresses the confusion where BYOC customers see public E2B templates in their dashboard that they can't actually use (the API would reject them since templates are scoped by cluster).

Link to Devin session: https://app.devin.ai/sessions/3bab014a95b04fe49f44868d221e484d

When a team has a clusterID defined (BYOC customer), the
/templates/defaults endpoint now returns an empty list instead of
showing E2B public templates that aren't available in their cluster.

Changes:
- Add team auth to /templates/defaults endpoint in OpenAPI spec
- Check team.ClusterID in handler; return empty when non-nil
- Regenerate api.gen.go

Co-Authored-By: ben@e2b.dev <ben@e2b.dev>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@cla-bot cla-bot Bot added the cla-signed label May 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2708 2 2706 7
View the full list of 2 ❄️ flaky test(s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity

Flake rate in main: 60.87% (Passed 540 times, Failed 840 times)

Stack Traces | 80.9s run time
=== RUN   TestSandboxMemoryIntegrity
=== PAUSE TestSandboxMemoryIntegrity
=== CONT  TestSandboxMemoryIntegrity
    sandbox_memory_integrity_test.go:27: Build completed successfully
--- FAIL: TestSandboxMemoryIntegrity (80.87s)
github.com/e2b-dev/infra/tests/integration/internal/tests/orchestrator::TestSandboxMemoryIntegrity/tmpfs_hash

Flake rate in main: 61.09% (Passed 530 times, Failed 832 times)

Stack Traces | 102s run time
=== RUN   TestSandboxMemoryIntegrity/tmpfs_hash
=== PAUSE TestSandboxMemoryIntegrity/tmpfs_hash
=== CONT  TestSandboxMemoryIntegrity/tmpfs_hash
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{start:{pid:1266}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Total memory: 985 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Used memory before tmpfs mount: 191 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Free memory before tmpfs mount: 793 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Memory to use in integrity test (80% of free, min 64MB): 634 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"634+0 records in\n634+0 records out\n664797184 bytes (665 MB, 634 MiB) copied, 3.07817 s, 216 MB/s\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stderr:"\tCommand being timed: \"dd if=/dev/urandom of=/mnt/testfile bs=1M count=634\"\n\tUser time (seconds): 0.00\n\tSystem time (seconds): 3.06\n\tPercent of CPU this job got: 99%\n\tElapsed (wall clock) time (h:mm:ss or m:ss): 0:03.08\n\tAverage shared text size (kbytes): 0\n\tAverage unshared data size (kbytes): 0\n\tAverage stack size (kbytes): 0\n\tAverage total size (kbytes): 0\n\tMaximum resident set size (kbytes): 2596\n\tAverage resident set size (kbytes): 0\n\tMajor (requiring I/O) page faults: 2\n\tMinor (reclaiming a frame) page faults: 340\n\tVoluntary context switches: 3\n\tInvoluntary context switches: 26\n\tSwaps: 0\n\tFile system inputs: 176\n\tFile system outputs: 0\n\tSocket messages sent: 0\n\tSocket messages received: 0\n\tSignals delivered: 0\n\tPage size (bytes): 4096\n\tExit status: 0\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{data:{stdout:"Used memory after tmpfs mount and file fill: 830 MB\n"}}
    sandbox_memory_integrity_test.go:70: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:70: Command [bash] completed successfully in sandbox i0ur1v6mnd160f4j9cbyi
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1282}}
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{data:{stdout:"211bf0b5bcea5b79b7a7d324bf7238ed087cec4bfff8d34d70473c518b220186\n"}}
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{end:{exited:true status:"exit status 0"}}
    sandbox_memory_integrity_test.go:80: Command [bash] completed successfully in sandbox i0ur1v6mnd160f4j9cbyi
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
    sandbox_memory_integrity_test.go:80: Command [bash] output: event:{start:{pid:1285}}
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
Executing command bash in sandbox i0ur1v6mnd160f4j9cbyi (user: root)
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:81
        	            				.../hostedtoolcache/go/1.26.3.../src/runtime/asm_amd64.s:1771
        	Error:      	Received unexpected error:
        	            	failed to execute command bash in sandbox i0ur1v6mnd160f4j9cbyi: unavailable: HTTP status 502 Bad Gateway
    sandbox_memory_integrity_test.go:110: 
        	Error Trace:	.../tests/orchestrator/sandbox_memory_integrity_test.go:78
        	            				.../tests/orchestrator/sandbox_memory_integrity_test.go:110
        	Error:      	Condition never satisfied
        	Test:       	TestSandboxMemoryIntegrity/tmpfs_hash
--- FAIL: TestSandboxMemoryIntegrity/tmpfs_hash (102.36s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@ben-fornefeld ben-fornefeld changed the title fix: hide default templates for BYOC teams (clusterID != nil) fix(dashboard-api): hide default templates for BYOC teams (clusterID != nil) May 22, 2026
@jakubno jakubno requested a review from sitole May 25, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant