Skip to content

Commit a3a807a

Browse files
committed
Merge branch 'main' into bq/migrate-to-muiv5
2 parents 7251da2 + d17ea84 commit a3a807a

File tree

22 files changed

+1230
-86
lines changed

22 files changed

+1230
-86
lines changed

coderd/apidoc/docs.go

Lines changed: 109 additions & 0 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: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbauthz/querier.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,13 @@ func (q *querier) InsertWorkspaceProxy(ctx context.Context, arg database.InsertW
17051705
return insert(q.log, q.auth, rbac.ResourceWorkspaceProxy, q.db.InsertWorkspaceProxy)(ctx, arg)
17061706
}
17071707

1708+
func (q *querier) UpdateWorkspaceProxy(ctx context.Context, arg database.UpdateWorkspaceProxyParams) (database.WorkspaceProxy, error) {
1709+
fetch := func(ctx context.Context, arg database.UpdateWorkspaceProxyParams) (database.WorkspaceProxy, error) {
1710+
return q.db.GetWorkspaceProxyByID(ctx, arg.ID)
1711+
}
1712+
return updateWithReturn(q.log, q.auth, fetch, q.db.UpdateWorkspaceProxy)(ctx, arg)
1713+
}
1714+
17081715
func (q *querier) RegisterWorkspaceProxy(ctx context.Context, arg database.RegisterWorkspaceProxyParams) (database.WorkspaceProxy, error) {
17091716
fetch := func(ctx context.Context, arg database.RegisterWorkspaceProxyParams) (database.WorkspaceProxy, error) {
17101717
return q.db.GetWorkspaceProxyByID(ctx, arg.ID)

coderd/database/dbfake/databasefake.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5233,6 +5233,31 @@ func (q *fakeQuerier) RegisterWorkspaceProxy(_ context.Context, arg database.Reg
52335233
return database.WorkspaceProxy{}, sql.ErrNoRows
52345234
}
52355235

5236+
func (q *fakeQuerier) UpdateWorkspaceProxy(_ context.Context, arg database.UpdateWorkspaceProxyParams) (database.WorkspaceProxy, error) {
5237+
q.mutex.Lock()
5238+
defer q.mutex.Unlock()
5239+
5240+
for _, p := range q.workspaceProxies {
5241+
if p.Name == arg.Name && p.ID != arg.ID {
5242+
return database.WorkspaceProxy{}, errDuplicateKey
5243+
}
5244+
}
5245+
5246+
for i, p := range q.workspaceProxies {
5247+
if p.ID == arg.ID {
5248+
p.Name = arg.Name
5249+
p.DisplayName = arg.DisplayName
5250+
p.Icon = arg.Icon
5251+
if len(p.TokenHashedSecret) > 0 {
5252+
p.TokenHashedSecret = arg.TokenHashedSecret
5253+
}
5254+
q.workspaceProxies[i] = p
5255+
return p, nil
5256+
}
5257+
}
5258+
return database.WorkspaceProxy{}, sql.ErrNoRows
5259+
}
5260+
52365261
func (q *fakeQuerier) UpdateWorkspaceProxyDeleted(_ context.Context, arg database.UpdateWorkspaceProxyDeletedParams) error {
52375262
q.mutex.Lock()
52385263
defer q.mutex.Unlock()

coderd/database/querier.go

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

coderd/database/queries.sql.go

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

0 commit comments

Comments
 (0)