Documentation ¶
Index ¶
- Constants
- func ConcurrentBatch(workers, count, size int, eachFn func(start, end int) error) error
- type FakeAccessControl
- type FakePermissionsService
- func (f *FakePermissionsService) GetPermissions(ctx context.Context, user *user.SignedInUser, resourceID string) ([]accesscontrol.ResourcePermission, error)
- func (f *FakePermissionsService) MapActions(permission accesscontrol.ResourcePermission) string
- func (f *FakePermissionsService) SetBuiltInRolePermission(ctx context.Context, orgID int64, builtInRole string, resourceID string, ...) (*accesscontrol.ResourcePermission, error)
- func (f *FakePermissionsService) SetPermissions(ctx context.Context, orgID int64, resourceID string, ...) ([]accesscontrol.ResourcePermission, error)
- func (f *FakePermissionsService) SetTeamPermission(ctx context.Context, orgID, teamID int64, resourceID, permission string) (*accesscontrol.ResourcePermission, error)
- func (f *FakePermissionsService) SetUserPermission(ctx context.Context, orgID int64, user accesscontrol.User, ...) (*accesscontrol.ResourcePermission, error)
- type FakeService
- func (f FakeService) ClearUserPermissionCache(user *user.SignedInUser)
- func (f FakeService) DeclareFixedRoles(registrations ...accesscontrol.RoleRegistration) error
- func (f FakeService) DeleteExternalServiceRole(ctx context.Context, externalServiceID string) error
- func (f FakeService) DeleteUserPermissions(ctx context.Context, orgID, userID int64) error
- func (f FakeService) GetUsageStats(ctx context.Context) map[string]interface{}
- func (f FakeService) GetUserPermissions(ctx context.Context, user *user.SignedInUser, options accesscontrol.Options) ([]accesscontrol.Permission, error)
- func (f FakeService) IsDisabled() bool
- func (f FakeService) RegisterFixedRoles(ctx context.Context) error
- func (f FakeService) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error
- func (f FakeService) SearchUserPermissions(ctx context.Context, orgID int64, searchOptions accesscontrol.SearchOptions) ([]accesscontrol.Permission, error)
- func (f FakeService) SearchUsersPermissions(ctx context.Context, user *user.SignedInUser, orgID int64, ...) (map[int64][]accesscontrol.Permission, error)
- type FakeStore
- func (f FakeStore) DeleteExternalServiceRole(ctx context.Context, externalServiceID string) error
- func (f FakeStore) DeleteUserPermissions(ctx context.Context, orgID, userID int64) error
- func (f FakeStore) GetUserPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error)
- func (f FakeStore) GetUsersBasicRoles(ctx context.Context, userFilter []int64, orgID int64) (map[int64][]string, error)
- func (f FakeStore) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error
- func (f FakeStore) SearchUsersPermissions(ctx context.Context, orgID int64, options accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error)
- type MockStore
- func (_m *MockStore) DeleteExternalServiceRole(ctx context.Context, externalServiceID string) error
- func (_m *MockStore) DeleteUserPermissions(ctx context.Context, orgID int64, userID int64) error
- func (_m *MockStore) GetUserPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error)
- func (_m *MockStore) GetUsersBasicRoles(ctx context.Context, userFilter []int64, orgID int64) (map[int64][]string, error)
- func (_m *MockStore) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error
- func (_m *MockStore) SearchUsersPermissions(ctx context.Context, orgID int64, options accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error)
Constants ¶
const BatchSize = 1000
const Concurrency = 10
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FakeAccessControl ¶
func (FakeAccessControl) Evaluate ¶
func (f FakeAccessControl) Evaluate(ctx context.Context, user *user.SignedInUser, evaluator accesscontrol.Evaluator) (bool, error)
func (FakeAccessControl) IsDisabled ¶
func (f FakeAccessControl) IsDisabled() bool
func (FakeAccessControl) RegisterScopeAttributeResolver ¶
func (f FakeAccessControl) RegisterScopeAttributeResolver(prefix string, resolver accesscontrol.ScopeAttributeResolver)
type FakePermissionsService ¶
type FakePermissionsService struct { ExpectedErr error ExpectedPermission *accesscontrol.ResourcePermission ExpectedPermissions []accesscontrol.ResourcePermission ExpectedMappedAction string }
func (*FakePermissionsService) GetPermissions ¶
func (f *FakePermissionsService) GetPermissions(ctx context.Context, user *user.SignedInUser, resourceID string) ([]accesscontrol.ResourcePermission, error)
func (*FakePermissionsService) MapActions ¶
func (f *FakePermissionsService) MapActions(permission accesscontrol.ResourcePermission) string
func (*FakePermissionsService) SetBuiltInRolePermission ¶
func (f *FakePermissionsService) SetBuiltInRolePermission(ctx context.Context, orgID int64, builtInRole string, resourceID string, permission string) (*accesscontrol.ResourcePermission, error)
func (*FakePermissionsService) SetPermissions ¶
func (f *FakePermissionsService) SetPermissions(ctx context.Context, orgID int64, resourceID string, commands ...accesscontrol.SetResourcePermissionCommand) ([]accesscontrol.ResourcePermission, error)
func (*FakePermissionsService) SetTeamPermission ¶
func (f *FakePermissionsService) SetTeamPermission(ctx context.Context, orgID, teamID int64, resourceID, permission string) (*accesscontrol.ResourcePermission, error)
func (*FakePermissionsService) SetUserPermission ¶
func (f *FakePermissionsService) SetUserPermission(ctx context.Context, orgID int64, user accesscontrol.User, resourceID, permission string) (*accesscontrol.ResourcePermission, error)
type FakeService ¶
type FakeService struct { ExpectedErr error ExpectedDisabled bool ExpectedCachedPermissions bool ExpectedPermissions []accesscontrol.Permission ExpectedFilteredUserPermissions []accesscontrol.Permission ExpectedUsersPermissions map[int64][]accesscontrol.Permission }
func (FakeService) ClearUserPermissionCache ¶
func (f FakeService) ClearUserPermissionCache(user *user.SignedInUser)
func (FakeService) DeclareFixedRoles ¶
func (f FakeService) DeclareFixedRoles(registrations ...accesscontrol.RoleRegistration) error
func (FakeService) DeleteExternalServiceRole ¶
func (f FakeService) DeleteExternalServiceRole(ctx context.Context, externalServiceID string) error
func (FakeService) DeleteUserPermissions ¶
func (f FakeService) DeleteUserPermissions(ctx context.Context, orgID, userID int64) error
func (FakeService) GetUsageStats ¶
func (f FakeService) GetUsageStats(ctx context.Context) map[string]interface{}
func (FakeService) GetUserPermissions ¶
func (f FakeService) GetUserPermissions(ctx context.Context, user *user.SignedInUser, options accesscontrol.Options) ([]accesscontrol.Permission, error)
func (FakeService) IsDisabled ¶
func (f FakeService) IsDisabled() bool
func (FakeService) RegisterFixedRoles ¶
func (f FakeService) RegisterFixedRoles(ctx context.Context) error
func (FakeService) SaveExternalServiceRole ¶
func (f FakeService) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error
func (FakeService) SearchUserPermissions ¶
func (f FakeService) SearchUserPermissions(ctx context.Context, orgID int64, searchOptions accesscontrol.SearchOptions) ([]accesscontrol.Permission, error)
func (FakeService) SearchUsersPermissions ¶
func (f FakeService) SearchUsersPermissions(ctx context.Context, user *user.SignedInUser, orgID int64, options accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error)
type FakeStore ¶
type FakeStore struct { ExpectedUserPermissions []accesscontrol.Permission ExpectedUsersPermissions map[int64][]accesscontrol.Permission ExpectedUsersRoles map[int64][]string ExpectedErr error }
func (FakeStore) DeleteExternalServiceRole ¶
func (FakeStore) DeleteUserPermissions ¶
func (FakeStore) GetUserPermissions ¶
func (f FakeStore) GetUserPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error)
func (FakeStore) GetUsersBasicRoles ¶
func (FakeStore) SaveExternalServiceRole ¶
func (f FakeStore) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error
func (FakeStore) SearchUsersPermissions ¶
func (f FakeStore) SearchUsersPermissions(ctx context.Context, orgID int64, options accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error)
type MockStore ¶
MockStore is an autogenerated mock type for the store type
func NewMockStore ¶
func NewMockStore(t mockConstructorTestingTNewMockStore) *MockStore
NewMockStore creates a new instance of MockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockStore) DeleteExternalServiceRole ¶
DeleteExternalServiceRole provides a mock function with given fields: ctx, externalServiceID
func (*MockStore) DeleteUserPermissions ¶
DeleteUserPermissions provides a mock function with given fields: ctx, orgID, userID
func (*MockStore) GetUserPermissions ¶
func (_m *MockStore) GetUserPermissions(ctx context.Context, query accesscontrol.GetUserPermissionsQuery) ([]accesscontrol.Permission, error)
GetUserPermissions provides a mock function with given fields: ctx, query
func (*MockStore) GetUsersBasicRoles ¶
func (_m *MockStore) GetUsersBasicRoles(ctx context.Context, userFilter []int64, orgID int64) (map[int64][]string, error)
GetUsersBasicRoles provides a mock function with given fields: ctx, userFilter, orgID
func (*MockStore) SaveExternalServiceRole ¶
func (_m *MockStore) SaveExternalServiceRole(ctx context.Context, cmd accesscontrol.SaveExternalServiceRoleCommand) error
SaveExternalServiceRole provides a mock function with given fields: ctx, cmd
func (*MockStore) SearchUsersPermissions ¶
func (_m *MockStore) SearchUsersPermissions(ctx context.Context, orgID int64, options accesscontrol.SearchOptions) (map[int64][]accesscontrol.Permission, error)
SearchUsersPermissions provides a mock function with given fields: ctx, orgID, options