MCPcopy Index your code
hub / github.com/coder/coder / AuthorizeTunnel

Method AuthorizeTunnel

coderd/workspaceupdates.go:302–309  ·  view source on GitHub ↗
(ctx context.Context, agentID uuid.UUID)

Source from the content-addressed store, hash-verified

300}
301
302func (r *rbacAuthorizer) AuthorizeTunnel(ctx context.Context, agentID uuid.UUID) error {
303 ws, err := r.db.GetWorkspaceByAgentID(ctx, agentID)
304 if err != nil {
305 return xerrors.Errorf("get workspace by agent ID: %w", err)
306 }
307 // Authorizes against `ActionSSH`
308 return r.sshPrep.Authorize(ctx, ws.RBACObject())
309}
310
311var _ tailnet.TunnelAuthorizer = (*rbacAuthorizer)(nil)

Callers

nothing calls this directly

Calls 4

GetWorkspaceByAgentIDMethod · 0.65
AuthorizeMethod · 0.65
RBACObjectMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected