Skip to content

Commit 5a216ec

Browse files
committed
remove insert and update
1 parent e91e669 commit 5a216ec

File tree

17 files changed

+194
-247
lines changed

17 files changed

+194
-247
lines changed

coderd/apidoc/docs.go

Lines changed: 36 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 32 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbauthz/dbauthz.go

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,20 +2408,6 @@ func (q *querier) InsertWorkspaceAgentMetadata(ctx context.Context, arg database
24082408
return q.db.InsertWorkspaceAgentMetadata(ctx, arg)
24092409
}
24102410

2411-
func (q *querier) InsertWorkspaceAgentPortShare(ctx context.Context, arg database.InsertWorkspaceAgentPortShareParams) (database.WorkspaceAgentPortShare, error) {
2412-
w, err := q.db.GetWorkspaceByID(ctx, arg.WorkspaceID)
2413-
if err != nil {
2414-
return database.WorkspaceAgentPortShare{}, err
2415-
}
2416-
2417-
// inserting a workspace port share is more akin to just updating the workspace.
2418-
if err = q.authorizeContext(ctx, rbac.ActionUpdate, w.RBACObject()); err != nil {
2419-
return database.WorkspaceAgentPortShare{}, xerrors.Errorf("authorize context: %w", err)
2420-
}
2421-
2422-
return q.db.InsertWorkspaceAgentPortShare(ctx, arg)
2423-
}
2424-
24252411
func (q *querier) InsertWorkspaceAgentScripts(ctx context.Context, arg database.InsertWorkspaceAgentScriptsParams) ([]database.WorkspaceAgentScript, error) {
24262412
if err := q.authorizeContext(ctx, rbac.ActionCreate, rbac.ResourceSystem); err != nil {
24272413
return []database.WorkspaceAgentScript{}, err
@@ -3063,20 +3049,6 @@ func (q *querier) UpdateWorkspaceAgentMetadata(ctx context.Context, arg database
30633049
return q.db.UpdateWorkspaceAgentMetadata(ctx, arg)
30643050
}
30653051

3066-
func (q *querier) UpdateWorkspaceAgentPortShare(ctx context.Context, arg database.UpdateWorkspaceAgentPortShareParams) error {
3067-
w, err := q.db.GetWorkspaceByID(ctx, arg.WorkspaceID)
3068-
if err != nil {
3069-
return err
3070-
}
3071-
3072-
// updating a workspace port share is more akin to just updating the workspace.
3073-
if err = q.authorizeContext(ctx, rbac.ActionUpdate, w.RBACObject()); err != nil {
3074-
return xerrors.Errorf("authorize context: %w", err)
3075-
}
3076-
3077-
return q.db.UpdateWorkspaceAgentPortShare(ctx, arg)
3078-
}
3079-
30803052
func (q *querier) UpdateWorkspaceAgentStartupByID(ctx context.Context, arg database.UpdateWorkspaceAgentStartupByIDParams) error {
30813053
agent, err := q.db.GetWorkspaceAgentByID(ctx, arg.ID)
30823054
if err != nil {
@@ -3343,6 +3315,10 @@ func (q *querier) UpsertTailnetTunnel(ctx context.Context, arg database.UpsertTa
33433315
return q.db.UpsertTailnetTunnel(ctx, arg)
33443316
}
33453317

3318+
func (q *querier) UpsertWorkspaceAgentPortShare(ctx context.Context, arg database.UpsertWorkspaceAgentPortShareParams) (database.WorkspaceAgentPortShare, error) {
3319+
panic("not implemented")
3320+
}
3321+
33463322
func (q *querier) GetAuthorizedTemplates(ctx context.Context, arg database.GetTemplatesWithFilterParams, _ rbac.PreparedAuthorized) ([]database.Template, error) {
33473323
// TODO Delete this function, all GetTemplates should be authorized. For now just call getTemplates on the authz querier.
33483324
return q.GetTemplatesWithFilter(ctx, arg)

0 commit comments

Comments
 (0)