@@ -4,15 +4,16 @@ import (
4
4
"context"
5
5
"strings"
6
6
7
+ "github.com/google/uuid"
8
+ "github.com/sqlc-dev/pqtype"
9
+ "golang.org/x/xerrors"
10
+ "google.golang.org/protobuf/types/known/emptypb"
11
+
7
12
"cdr.dev/slog"
8
13
agentproto"github.com/coder/coder/v2/agent/proto"
9
14
"github.com/coder/coder/v2/coderd/database"
10
15
"github.com/coder/coder/v2/coderd/database/dbauthz"
11
16
"github.com/coder/quartz"
12
- "github.com/google/uuid"
13
- "github.com/sqlc-dev/pqtype"
14
- "golang.org/x/xerrors"
15
- "google.golang.org/protobuf/types/known/emptypb"
16
17
)
17
18
18
19
type DevContainerAgentAPI struct {
@@ -25,6 +26,7 @@ type DevContainerAgentAPI struct {
25
26
}
26
27
27
28
func (a * DevContainerAgentAPI )CreateDevContainerAgent (ctx context.Context ,req * agentproto.CreateDevContainerAgentRequest ) (* agentproto.CreateDevContainerAgentResponse ,error ) {
29
+ //nolint:gocritic // We are the Dev Container Agent API, so this is safe.
28
30
ctx = dbauthz .AsDevContainerAgentAPI (ctx )
29
31
30
32
parentAgent ,err := a .AgentFn (ctx )
@@ -68,6 +70,7 @@ func (a *DevContainerAgentAPI) CreateDevContainerAgent(ctx context.Context, req
68
70
}
69
71
70
72
func (a * DevContainerAgentAPI )DeleteDevContainerAgent (ctx context.Context ,req * agentproto.DeleteDevContainerAgentRequest ) (* emptypb.Empty ,error ) {
73
+ //nolint:gocritic // We are the Dev Container Agent API, so this is safe.
71
74
ctx = dbauthz .AsDevContainerAgentAPI (ctx )
72
75
73
76
devContainerAgentID ,err := uuid .FromBytes (req .Id )
@@ -82,7 +85,8 @@ func (a *DevContainerAgentAPI) DeleteDevContainerAgent(ctx context.Context, req
82
85
return & emptypb.Empty {},nil
83
86
}
84
87
85
- func (a * DevContainerAgentAPI )ListDevContainerAgents (ctx context.Context ,req * agentproto.ListDevContainerAgentsRequest ) (* agentproto.ListDevContainerAgentsResponse ,error ) {
88
+ func (a * DevContainerAgentAPI )ListDevContainerAgents (ctx context.Context ,_ * agentproto.ListDevContainerAgentsRequest ) (* agentproto.ListDevContainerAgentsResponse ,error ) {
89
+ //nolint:gocritic // We are the Dev Container Agent API, so this is safe.
86
90
ctx = dbauthz .AsDevContainerAgentAPI (ctx )
87
91
88
92
workspaceAgents ,err := a .Database .GetWorkspaceAgentsWithParentID (ctx , uuid.NullUUID {Valid :true ,UUID :a .AgentID })