8000 feat: add organization scope for shared ports by aslilac · Pull Request #18314 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add organization scope for shared ports #18314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jun 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
1019F Next Next commit
assert default level
  • Loading branch information
aslilac committed Jun 16, 2025
commit e21abef8b6b0c8688e7723e59e5449c525da93c2
12 changes: 10 additions & 2 deletions enterprise/coderd/workspaceportshare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ func TestWorkspacePortSharePublic(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()

templ, err := client.Template(ctx, r.workspace.TemplateID)
require.NoError(t, err)
require.Equal(t, templ.MaxPortShareLevel, codersdk.WorkspaceAgentPortShareLevelOwner)

// Try to update port share with template max port share level owner.
_, err := client.UpsertWorkspaceAgentPortShare(ctx, r.workspace.ID, codersdk.UpsertWorkspaceAgentPortShareRequest{
_, err = client.UpsertWorkspaceAgentPortShare(ctx, r.workspace.ID, codersdk.UpsertWorkspaceAgentPortShareRequest{
AgentName: r.sdkAgent.Name,
Port: 8080,
ShareLevel: codersdk.WorkspaceAgentPortShareLevelPublic,
Expand Down Expand Up @@ -74,8 +78,12 @@ func TestWorkspacePortShareOrganization(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()

templ, err := client.Template(ctx, r.workspace.TemplateID)
require.NoError(t, err)
require.Equal(t, templ.MaxPortShareLevel, codersdk.WorkspaceAgentPortShareLevelOwner)

// Try to update port share with template max port share level owner
_, err := client.UpsertWorkspaceAgentPortShare(ctx, r.workspace.ID, codersdk.UpsertWorkspaceAgentPortShareRequest{
_, err = client.UpsertWorkspaceAgentPortShare(ctx, r.workspace.ID, codersdk.UpsertWorkspaceAgentPortShareRequest{
AgentName: r.sdkAgent.Name,
Port: 8080,
ShareLevel: codersdk.WorkspaceAgentPortShareLevelOrganization,
Expand Down
Loading
0