MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetServiceAccount

Method GetServiceAccount

backend/store/service_account.go:88–97  ·  view source on GitHub ↗

GetServiceAccount gets a service account by workspace and email. For use by API layer (workspace-scoped).

(ctx context.Context, workspace string, email string)

Source from the content-addressed store, hash-verified

86// GetServiceAccount gets a service account by workspace and email.
87// For use by API layer (workspace-scoped).
88func (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.
100func (s *Store) ListServiceAccounts(ctx context.Context, find *FindServiceAccountMessage) ([]*ServiceAccountMessage, error) {

Callers

nothing calls this directly

Calls 1

ListServiceAccountsMethod · 0.95

Tested by

no test coverage detected