Documentation ¶
Index ¶
Constants ¶
View Source
const ( ActionRead = "serviceaccounts:read" ActionWrite = "serviceaccounts:write" ActionCreate = "serviceaccounts:create" ActionDelete = "serviceaccounts:delete" )
Variables ¶
View Source
var ( ScopeAll = "serviceaccounts:*" ScopeID = accesscontrol.Scope("serviceaccounts", "id", accesscontrol.Parameter(":serviceAccountId")) )
View Source
var (
ErrServiceAccountNotFound = errors.New("Service account not found")
)
Functions ¶
This section is empty.
Types ¶
type SearchServiceAccountsResult ¶
type SearchServiceAccountsResult struct { TotalCount int64 `json:"totalCount"` ServiceAccounts []*ServiceAccountDTO `json:"serviceAccounts"` Page int `json:"page"` PerPage int `json:"perPage"` }
type Service ¶
type Service interface { CreateServiceAccount(ctx context.Context, orgID int64, name string) (*ServiceAccountDTO, error) DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error }
this should reflect the api
type ServiceAccount ¶
type ServiceAccount struct {
Id int64
}
type ServiceAccountDTO ¶
type ServiceAccountDTO struct { Id int64 `json:"id" xorm:"user_id"` Name string `json:"name" xorm:"name"` Login string `json:"login" xorm:"login"` OrgId int64 `json:"orgId" xorm:"org_id"` IsDisabled bool `json:"isDisabled" xorm:"is_disabled"` Role string `json:"role" xorm:"role"` Tokens int64 `json:"tokens"` AvatarUrl string `json:"avatarUrl"` AccessControl map[string]bool `json:"accessControl,omitempty"` }
type ServiceAccountFilter ¶
type ServiceAccountFilter string // used for filtering
const ( FilterOnlyExpiredTokens ServiceAccountFilter = "expiredTokens" FilterIncludeAll ServiceAccountFilter = "all" )
type ServiceAccountProfileDTO ¶
type ServiceAccountProfileDTO struct { Id int64 `json:"id" xorm:"user_id"` Name string `json:"name" xorm:"name"` Login string `json:"login" xorm:"login"` OrgId int64 `json:"orgId" xorm:"org_id"` IsDisabled bool `json:"isDisabled" xorm:"is_disabled"` Created time.Time `json:"createdAt" xorm:"created"` Updated time.Time `json:"updatedAt" xorm:"updated"` AvatarUrl string `json:"avatarUrl" xorm:"-"` Role string `json:"role" xorm:"role"` Teams []string `json:"teams" xorm:"-"` AccessControl map[string]bool `json:"accessControl,omitempty" xorm:"-"` }
type Store ¶
type Store interface { CreateServiceAccount(ctx context.Context, orgID int64, name string) (*ServiceAccountDTO, error) SearchOrgServiceAccounts(ctx context.Context, orgID int64, query string, filter ServiceAccountFilter, page int, limit int, signedInUser *models.SignedInUser) (*SearchServiceAccountsResult, error) UpdateServiceAccount(ctx context.Context, orgID, serviceAccountID int64, saForm *UpdateServiceAccountForm) (*ServiceAccountProfileDTO, error) RetrieveServiceAccount(ctx context.Context, orgID, serviceAccountID int64) (*ServiceAccountProfileDTO, error) DeleteServiceAccount(ctx context.Context, orgID, serviceAccountID int64) error UpgradeServiceAccounts(ctx context.Context) error ConvertToServiceAccounts(ctx context.Context, keys []int64) error ListTokens(ctx context.Context, orgID int64, serviceAccount int64) ([]*models.ApiKey, error) DeleteServiceAccountToken(ctx context.Context, orgID, serviceAccountID, tokenID int64) error AddServiceAccountToken(ctx context.Context, serviceAccountID int64, cmd *AddServiceAccountTokenCommand) error GetUsageMetrics(ctx context.Context) (map[string]interface{}, error) }
Click to show internal directories.
Click to hide internal directories.