MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / List

Method List

app/controlplane/pkg/biz/robotaccount.go:107–128  ·  view source on GitHub ↗
(ctx context.Context, orgID, workflowID string, includeRevoked bool)

Source from the content-addressed store, hash-verified

105}
106
107func (uc *RobotAccountUseCase) List(ctx context.Context, orgID, workflowID string, includeRevoked bool) ([]*RobotAccount, error) {
108 ctx, span := otelx.Start(ctx, robotAccountTracer, "RobotAccountUseCase.List")
109 defer span.End()
110
111 workflowUUID, err := uuid.Parse(workflowID)
112 if err != nil {
113 return nil, NewErrInvalidUUID(err)
114 }
115
116 orgUUID, err := uuid.Parse(orgID)
117 if err != nil {
118 return nil, NewErrInvalidUUID(err)
119 }
120 // Check that the workflow is from the provided user
121 if wf, err := uc.workflowRepo.GetOrgScoped(ctx, orgUUID, workflowUUID); err != nil {
122 return nil, err
123 } else if wf == nil {
124 return nil, NewErrNotFound("workflow")
125 }
126
127 return uc.robotAccountRepo.List(ctx, workflowUUID, includeRevoked)
128}
129
130func (uc *RobotAccountUseCase) FindByID(ctx context.Context, id string) (*RobotAccount, error) {
131 ctx, span := otelx.Start(ctx, robotAccountTracer, "RobotAccountUseCase.FindByID")

Callers

nothing calls this directly

Calls 6

StartFunction · 0.92
NewErrInvalidUUIDFunction · 0.85
ParseMethod · 0.80
NewErrNotFoundFunction · 0.70
GetOrgScopedMethod · 0.65
ListMethod · 0.65

Tested by

no test coverage detected