GetServiceAccount gets a service account by workspace and email. For use by API layer (workspace-scoped).
(ctx context.Context, workspace string, email string)
| 86 | // GetServiceAccount gets a service account by workspace and email. |
| 87 | // For use by API layer (workspace-scoped). |
| 88 | func (s *Store) GetServiceAccount(ctx context.Context, workspace string, email string) (*ServiceAccountMessage, error) { |
| 89 | sas, err := s.ListServiceAccounts(ctx, &FindServiceAccountMessage{Workspace: workspace, Email: &email, ShowDeleted: true}) |
| 90 | if err != nil { |
| 91 | return nil, err |
| 92 | } |
| 93 | if len(sas) == 0 { |
| 94 | return nil, nil |
| 95 | } |
| 96 | return sas[0], nil |
| 97 | } |
| 98 | |
| 99 | // ListServiceAccounts lists service accounts. |
| 100 | func (s *Store) ListServiceAccounts(ctx context.Context, find *FindServiceAccountMessage) ([]*ServiceAccountMessage, error) { |
nothing calls this directly
no test coverage detected