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
Next Next commit
update subagent api
  • Loading branch information
aslilac committed Jun 16, 2025
commit 04872d263af2ddc4fa699faa8701244aa895d4c6
16 changes: 6 additions & 10 deletions coderd/agentapi/subagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"database/sql"
"errors"
"fmt"
"strings"

"github.com/google/uuid"
"github.com/sqlc-dev/pqtype"
Expand Down Expand Up @@ -140,20 +141,15 @@ func (a *SubAgentAPI) CreateSubAgent(ctx context.Context, req *agentproto.Create
health = database.WorkspaceAppHealthInitializing
}

var sharingLevel database.AppSharingLevel
switch app.GetShare() {
case agentproto.CreateSubAgentRequest_App_OWNER:
sharingLevel = database.AppSharingLevelOwner
case agentproto.CreateSubAgentRequest_App_AUTHENTICATED:
sharingLevel = database.AppSharingLevelAuthenticated
case agentproto.CreateSubAgentRequest_App_PUBLIC:
sharingLevel = database.AppSharingLevelPublic
default:
share := app.GetShare()
protoSharingLevel, ok := agentproto.CreateSubAgentRequest_App_SharingLevel_name[int32(share)]
if !ok {
return codersdk.ValidationError{
Field: "share",
Detail: fmt.Sprintf("%q is not a valid app sharing level", app.GetShare()),
Detail: fmt.Sprintf("%q is not a valid app sharing level", share.String()),
}
}
sharingLevel := database.AppSharingLevel(strings.ToLower(protoSharingLevel))

var openIn database.WorkspaceAppOpenIn
switch app.GetOpenIn() {
Expand Down
Loading
0