Documentation
¶
Overview ¶
Package fakes provides in-memory implementations of the domain interfaces for tests. Each method calls its function field when set and otherwise returns a harmless default. Calls are recorded and safe for concurrent use.
Index ¶
- type GitHub
- func (f *GitHub) CheckPRCompliance(ctx context.Context, owner, repo string, prNumber int) (*domain.PRComplianceResult, error)
- func (c *GitHub) Count(name string) int
- func (f *GitHub) GetAppSlug(ctx context.Context) (string, error)
- func (f *GitHub) GetTeamMembers(ctx context.Context, teamSlug string) ([]string, error)
- func (f *GitHub) ListOrgMembers(ctx context.Context) ([]string, error)
- func (f *GitHub) ListSecurityAlerts(ctx context.Context, minAgeDays int, minSeverity string) (*domain.SecurityAlertsReport, error)
- func (f *GitHub) ResolveTeam(ctx context.Context, name, privacy string, create bool) (string, error)
- func (f *GitHub) SyncTeamMembers(ctx context.Context, teamSlug string, desired []string, threshold float64) (*domain.TeamSyncResult, error)
- type Notifier
- func (c *Notifier) Count(name string) int
- func (f *Notifier) NotifyOktaSync(_ context.Context, reports []*domain.SyncReport, _ string) error
- func (f *Notifier) NotifyOrphanedUsers(_ context.Context, report *domain.OrphanedUsersReport) error
- func (f *Notifier) NotifyPRBypass(_ context.Context, result *domain.PRComplianceResult, _ string) error
- func (f *Notifier) NotifySecurityAlerts(_ context.Context, report *domain.SecurityAlertsReport, _ string) error
- type Okta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHub ¶
type GitHub struct {
CheckPRComplianceFn func(ctx context.Context, owner, repo string, prNumber int) (*domain.PRComplianceResult, error)
ResolveTeamFn func(ctx context.Context, name, privacy string, create bool) (string, error)
SyncTeamMembersFn func(ctx context.Context, teamSlug string, desired []string, threshold float64) (*domain.TeamSyncResult, error)
GetTeamMembersFn func(ctx context.Context, teamSlug string) ([]string, error)
ListOrgMembersFn func(ctx context.Context) ([]string, error)
GetAppSlugFn func(ctx context.Context) (string, error)
ListSecurityAlertsFn func(ctx context.Context, minAgeDays int, minSeverity string) (*domain.SecurityAlertsReport, error)
// contains filtered or unexported fields
}
GitHub is a fake domain.GitHubClient.
func (*GitHub) CheckPRCompliance ¶
func (*GitHub) GetTeamMembers ¶
func (*GitHub) ListOrgMembers ¶
func (*GitHub) ListSecurityAlerts ¶
func (*GitHub) ResolveTeam ¶
type Notifier ¶
type Notifier struct {
Err error
PRBypasses []*domain.PRComplianceResult
OktaSyncs [][]*domain.SyncReport
OrphanedUsers []*domain.OrphanedUsersReport
SecurityAlerts []*domain.SecurityAlertsReport
// contains filtered or unexported fields
}
Notifier is a fake domain.Notifier that keeps what it was asked to send.
func (*Notifier) NotifyOktaSync ¶
func (*Notifier) NotifyOrphanedUsers ¶
func (*Notifier) NotifyPRBypass ¶
func (*Notifier) NotifySecurityAlerts ¶
type Okta ¶
type Okta struct {
GetGroupsByPatternFn func(ctx context.Context, pattern string) ([]*domain.GroupInfo, error)
GetGroupInfoFn func(ctx context.Context, name string) (*domain.GroupInfo, error)
// contains filtered or unexported fields
}
Okta is a fake domain.OktaClient.