Documentation
¶
Index ¶
- Variables
- type Delivery
- type GitHub
- type GitHubClient
- type GitHubConfig
- type Group
- type IndexRequest
- type Installation
- type Job
- type JobCursor
- type Overview
- type Repository
- type RepositoryCursor
- type SCIPDependency
- type SCIPUpload
- type Service
- func (service *Service) AuditEvents(ctx context.Context, principal authn.Principal) ([]audit.Event, bool, error)
- func (service *Service) Deliveries(ctx context.Context, principal authn.Principal) ([]Delivery, bool, error)
- func (service *Service) GitHubInfo(ctx context.Context, principal authn.Principal) (GitHub, error)
- func (service *Service) Group(ctx context.Context, principal authn.Principal, id int64) (Group, error)
- func (service *Service) Groups(ctx context.Context, principal authn.Principal) ([]Group, bool, error)
- func (service *Service) Jobs(ctx context.Context, principal authn.Principal, cursor *JobCursor) ([]Job, bool, error)
- func (service *Service) Overview(ctx context.Context, principal authn.Principal) (Overview, error)
- func (service *Service) Reconcile(ctx context.Context, principal authn.Principal) error
- func (service *Service) RecordDeniedMutation(ctx context.Context, principal authn.Principal)
- func (service *Service) Reindex(ctx context.Context, principal authn.Principal, githubID int64) error
- func (service *Service) ReplaceGroupAccess(ctx context.Context, principal authn.Principal, id int64, administrator bool, ...) error
- func (service *Service) ReplaceUserAccess(ctx context.Context, principal authn.Principal, id int64, administrator bool, ...) error
- func (service *Service) Repositories(ctx context.Context, principal authn.Principal, cursor *RepositoryCursor) ([]Repository, bool, error)
- func (service *Service) Retry(ctx context.Context, principal authn.Principal, id int64) error
- func (service *Service) RevokeUserCredentials(ctx context.Context, principal authn.Principal, id int64) error
- func (service *Service) SCIPDependencies(ctx context.Context, principal authn.Principal) ([]SCIPDependency, bool, error)
- func (service *Service) SCIPUploads(ctx context.Context, principal authn.Principal) ([]SCIPUpload, bool, error)
- func (service *Service) SuspendUser(ctx context.Context, principal authn.Principal, id int64, suspended bool) error
- func (service *Service) User(ctx context.Context, principal authn.Principal, id int64) (User, error)
- func (service *Service) Users(ctx context.Context, principal authn.Principal) ([]User, bool, error)
- type Store
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalid = errors.New("invalid admin request") ErrSelfAdministration = errors.New("cannot remove your own administrator access") ErrFinalAdministrator = errors.New("cannot remove the final active administrator") )
View Source
var ErrForbidden = errors.New("administrator access required")
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct {
ID int64 `json:"id"`
DeliveryID string `json:"delivery_id"`
Event string `json:"event"`
State string `json:"state"`
ErrorCode string `json:"error_code"`
InstallationID int64 `json:"installation_id"`
ReceivedAt time.Time `json:"received_at"`
ProcessedAt *time.Time `json:"processed_at,omitempty"`
}
type GitHub ¶
type GitHub struct {
AppID int64 `json:"app_id"`
WebURL string `json:"web_url"`
APIURL string `json:"api_url"`
UploadURL string `json:"upload_url"`
GitURL string `json:"git_url"`
APIVersion string `json:"api_version"`
PrivateKeyConfigured bool `json:"private_key_configured"`
WebhookSecretConfigured bool `json:"webhook_secret_configured"`
CAConfigured bool `json:"ca_configured"`
Installations []Installation `json:"installations"`
Truncated bool `json:"truncated"`
}
type GitHubClient ¶
type GitHubConfig ¶
type IndexRequest ¶
type Installation ¶
type Job ¶
type Job struct {
ID int64 `json:"id"`
RepositoryID int64 `json:"repository_id"`
Repository string `json:"repository"`
TargetSHA string `json:"target_sha"`
TargetRef string `json:"target_ref"`
Reason string `json:"reason"`
State string `json:"state"`
ErrorCode string `json:"error_code"`
Attempt int `json:"attempt"`
MaxAttempts int `json:"max_attempts"`
Priority int `json:"priority"`
RunAfter time.Time `json:"run_after"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Repository ¶
type Repository struct {
ID int64 `json:"id"`
GitHubID int64 `json:"github_id"`
InstallationID int64 `json:"installation_id"`
Name string `json:"name"`
DefaultBranch string `json:"default_branch"`
DesiredSHA string `json:"desired_sha"`
IndexedSHA string `json:"indexed_sha"`
Status string `json:"status"`
ErrorCode string `json:"error_code"`
WebURL string `json:"web_url"`
Enabled bool `json:"enabled"`
Private bool `json:"private"`
Archived bool `json:"archived"`
LastIndexedAt *time.Time `json:"last_indexed_at,omitempty"`
}
type RepositoryCursor ¶
type RepositoryCursor struct{ Name string }
RepositoryCursor identifies the last repository of a page by full name.
type SCIPDependency ¶
type SCIPUpload ¶
type SCIPUpload struct {
ID int64 `json:"id"`
RepositoryID int64 `json:"repository_id"`
Repository string `json:"repository"`
Commit string `json:"commit"`
ProjectRoot string `json:"project_root"`
IndexerName string `json:"indexer_name"`
IndexerVersion string `json:"indexer_version"`
UploadedAt time.Time `json:"uploaded_at"`
}
type Service ¶
type Service struct {
Store Store
Audit audit.Recorder
GitHub GitHubClient
ReconcileAll func(context.Context) error
Config GitHubConfig
MaxItems int
}
func (*Service) AuditEvents ¶
func (*Service) Deliveries ¶
func (*Service) GitHubInfo ¶
func (*Service) RecordDeniedMutation ¶
func (*Service) ReplaceGroupAccess ¶
func (*Service) ReplaceUserAccess ¶
func (*Service) Repositories ¶
func (service *Service) Repositories(ctx context.Context, principal authn.Principal, cursor *RepositoryCursor) ([]Repository, bool, error)
func (*Service) RevokeUserCredentials ¶
func (*Service) SCIPDependencies ¶
func (*Service) SCIPUploads ¶
func (*Service) SuspendUser ¶
type Store ¶
type Store interface {
AuditEvents(context.Context, int) ([]audit.Event, bool, error)
AdminUsers(context.Context, int) ([]User, bool, error)
AdminUser(context.Context, int64) (User, error)
AdminGroups(context.Context, int) ([]Group, bool, error)
AdminGroup(context.Context, int64) (Group, error)
SuspendAdminUser(context.Context, int64, int64, bool) error
ReplaceAdminUserAccess(context.Context, int64, int64, bool, []int64) error
ReplaceAdminGroupAccess(context.Context, int64, int64, bool, []int64) error
RevokeAdminUserCredentials(context.Context, int64) error
AdminOverview(context.Context, int64, []int64) (Overview, error)
AdminRepositories(context.Context, int64, []int64, int, *RepositoryCursor) ([]Repository, bool, error)
AdminJobs(context.Context, int64, []int64, int, *JobCursor) ([]Job, bool, error)
AdminSCIPUploads(context.Context, int64, []int64, int) ([]SCIPUpload, bool, error)
AdminSCIPDependencies(context.Context, int64, []int64, int) ([]SCIPDependency, bool, error)
AdminDeliveries(context.Context, int64, []int64, int) ([]Delivery, bool, error)
AdminGitHub(context.Context, int64, []int64, GitHubConfig, int) (GitHub, error)
AdminRepository(context.Context, int64, []int64, int64) (repository.Repository, error)
AnyAuthorizedRepository(context.Context, int64) (repository.Repository, error)
EnqueueAdminIndex(context.Context, IndexRequest) error
RetryAdminJob(context.Context, int64, []int64, int64) error
ReconcileAdminRepositories(context.Context, int64, []int64, []githubapp.Repository) error
// contains filtered or unexported methods
}
type User ¶
type User struct {
ID int64 `json:"id"`
ExternalID string `json:"external_id"`
UserName string `json:"user_name"`
DisplayName string `json:"display_name"`
Source string `json:"source"`
SCIMActive bool `json:"scim_active"`
Suspended bool `json:"suspended"`
Administrator bool `json:"administrator"`
RepositoryIDs []int64 `json:"repository_ids"`
DirectAdministrator bool `json:"direct_administrator"`
DirectRepositoryIDs []int64 `json:"direct_repository_ids"`
GitHubRepositoryIDs []int64 `json:"github_repository_ids"`
}
Click to show internal directories.
Click to hide internal directories.