rbac

package
v1.0.2003 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package rbac is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound indicates that a user cannot be found in the database
	ErrUserNotFound = errors.New("The user can't be found")
)

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(config *api.APIConfig, service Service, databaseClient database.Client, bitbucketapiClient bitbucketapi.Client, githubapiClient githubapi.Client) Handler

NewHandler returns a new rbac.Handler

func (*Handler) BatchUpdateClients

func (h *Handler) BatchUpdateClients(c *gin.Context)

func (*Handler) BatchUpdateGroups

func (h *Handler) BatchUpdateGroups(c *gin.Context)

func (*Handler) BatchUpdateOrganizations

func (h *Handler) BatchUpdateOrganizations(c *gin.Context)

func (*Handler) BatchUpdatePipelines

func (h *Handler) BatchUpdatePipelines(c *gin.Context)

func (*Handler) BatchUpdateUsers

func (h *Handler) BatchUpdateUsers(c *gin.Context)

func (*Handler) CreateClient

func (h *Handler) CreateClient(c *gin.Context)

func (*Handler) CreateGroup

func (h *Handler) CreateGroup(c *gin.Context)

func (*Handler) CreateOrganization

func (h *Handler) CreateOrganization(c *gin.Context)

func (*Handler) CreateUser

func (h *Handler) CreateUser(c *gin.Context)

func (*Handler) DeleteClient

func (h *Handler) DeleteClient(c *gin.Context)

func (*Handler) DeleteGroup

func (h *Handler) DeleteGroup(c *gin.Context)

func (*Handler) DeleteOrganization

func (h *Handler) DeleteOrganization(c *gin.Context)

func (*Handler) DeleteUser

func (h *Handler) DeleteUser(c *gin.Context)

func (*Handler) GetClient

func (h *Handler) GetClient(c *gin.Context)

func (*Handler) GetClients

func (h *Handler) GetClients(c *gin.Context)

func (*Handler) GetGroup

func (h *Handler) GetGroup(c *gin.Context)

func (*Handler) GetGroups

func (h *Handler) GetGroups(c *gin.Context)

func (*Handler) GetIntegrations added in v1.0.5

func (h *Handler) GetIntegrations(c *gin.Context)

func (*Handler) GetLoggedInUser

func (h *Handler) GetLoggedInUser(c *gin.Context)

func (*Handler) GetOrganization

func (h *Handler) GetOrganization(c *gin.Context)

func (*Handler) GetOrganizations

func (h *Handler) GetOrganizations(c *gin.Context)

func (*Handler) GetPipeline

func (h *Handler) GetPipeline(c *gin.Context)

func (*Handler) GetPipelines

func (h *Handler) GetPipelines(c *gin.Context)

func (*Handler) GetProviders

func (h *Handler) GetProviders(c *gin.Context)

func (*Handler) GetRoles

func (h *Handler) GetRoles(c *gin.Context)

func (*Handler) GetUser

func (h *Handler) GetUser(c *gin.Context)

func (*Handler) GetUsers

func (h *Handler) GetUsers(c *gin.Context)

func (*Handler) HandleClientLoginProviderAuthenticator

func (h *Handler) HandleClientLoginProviderAuthenticator() func(c *gin.Context) (interface{}, error)

func (*Handler) HandleImpersonateAuthenticator

func (h *Handler) HandleImpersonateAuthenticator() func(c *gin.Context) (interface{}, error)

func (*Handler) HandleOAuthLoginProviderAuthenticator

func (h *Handler) HandleOAuthLoginProviderAuthenticator() func(c *gin.Context) (interface{}, error)

func (*Handler) LoginProvider

func (h *Handler) LoginProvider(c *gin.Context)

func (*Handler) UpdateBitbucketInstallation added in v1.0.6

func (h *Handler) UpdateBitbucketInstallation(c *gin.Context)

func (*Handler) UpdateClient

func (h *Handler) UpdateClient(c *gin.Context)

func (*Handler) UpdateGithubInstallation added in v1.0.6

func (h *Handler) UpdateGithubInstallation(c *gin.Context)

func (*Handler) UpdateGroup

func (h *Handler) UpdateGroup(c *gin.Context)

func (*Handler) UpdateOrganization

func (h *Handler) UpdateOrganization(c *gin.Context)

func (*Handler) UpdatePipeline

func (h *Handler) UpdatePipeline(c *gin.Context)

func (*Handler) UpdateUser

func (h *Handler) UpdateUser(c *gin.Context)

type MockService

type MockService struct {
	// contains filtered or unexported fields
}

MockService is a mock of Service interface.

func NewMockService

func NewMockService(ctrl *gomock.Controller) *MockService

NewMockService creates a new mock instance.

func (*MockService) CreateClient

func (m *MockService) CreateClient(ctx context.Context, client contracts.Client) (*contracts.Client, error)

CreateClient mocks base method.

func (*MockService) CreateGroup

func (m *MockService) CreateGroup(ctx context.Context, group contracts.Group) (*contracts.Group, error)

CreateGroup mocks base method.

func (*MockService) CreateOrganization

func (m *MockService) CreateOrganization(ctx context.Context, organization contracts.Organization) (*contracts.Organization, error)

CreateOrganization mocks base method.

func (*MockService) CreateUser

func (m *MockService) CreateUser(ctx context.Context, user contracts.User) (*contracts.User, error)

CreateUser mocks base method.

func (*MockService) CreateUserFromIdentity

func (m *MockService) CreateUserFromIdentity(ctx context.Context, identity contracts.UserIdentity) (*contracts.User, error)

CreateUserFromIdentity mocks base method.

func (*MockService) DeleteClient

func (m *MockService) DeleteClient(ctx context.Context, id string) error

DeleteClient mocks base method.

func (*MockService) DeleteGroup

func (m *MockService) DeleteGroup(ctx context.Context, id string) error

DeleteGroup mocks base method.

func (*MockService) DeleteOrganization

func (m *MockService) DeleteOrganization(ctx context.Context, id string) error

DeleteOrganization mocks base method.

func (*MockService) DeleteUser

func (m *MockService) DeleteUser(ctx context.Context, id string) error

DeleteUser mocks base method.

func (*MockService) EXPECT

func (m *MockService) EXPECT() *MockServiceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockService) GetInheritedOrganizationsForUser

func (m *MockService) GetInheritedOrganizationsForUser(ctx context.Context, user contracts.User) ([]*contracts.Organization, error)

GetInheritedOrganizationsForUser mocks base method.

func (*MockService) GetInheritedRolesForUser

func (m *MockService) GetInheritedRolesForUser(ctx context.Context, user contracts.User) ([]*string, error)

GetInheritedRolesForUser mocks base method.

func (*MockService) GetProviderByName

func (m *MockService) GetProviderByName(ctx context.Context, organization, name string) (*api.OAuthProvider, error)

GetProviderByName mocks base method.

func (*MockService) GetProviders

func (m *MockService) GetProviders(ctx context.Context) ([]*api.OAuthProvider, error)

GetProviders mocks base method.

func (*MockService) GetRoles

func (m *MockService) GetRoles(ctx context.Context) ([]string, error)

GetRoles mocks base method.

func (*MockService) GetUserByIdentity

func (m *MockService) GetUserByIdentity(ctx context.Context, identity contracts.UserIdentity) (*contracts.User, error)

GetUserByIdentity mocks base method.

func (*MockService) UpdateClient

func (m *MockService) UpdateClient(ctx context.Context, client contracts.Client) error

UpdateClient mocks base method.

func (*MockService) UpdateGroup

func (m *MockService) UpdateGroup(ctx context.Context, group contracts.Group) error

UpdateGroup mocks base method.

func (*MockService) UpdateOrganization

func (m *MockService) UpdateOrganization(ctx context.Context, organization contracts.Organization) error

UpdateOrganization mocks base method.

func (*MockService) UpdatePipeline

func (m *MockService) UpdatePipeline(ctx context.Context, pipeline contracts.Pipeline) error

UpdatePipeline mocks base method.

func (*MockService) UpdateUser

func (m *MockService) UpdateUser(ctx context.Context, user contracts.User) error

UpdateUser mocks base method.

type MockServiceMockRecorder

type MockServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockServiceMockRecorder is the mock recorder for MockService.

func (*MockServiceMockRecorder) CreateClient

func (mr *MockServiceMockRecorder) CreateClient(ctx, client interface{}) *gomock.Call

CreateClient indicates an expected call of CreateClient.

func (*MockServiceMockRecorder) CreateGroup

func (mr *MockServiceMockRecorder) CreateGroup(ctx, group interface{}) *gomock.Call

CreateGroup indicates an expected call of CreateGroup.

func (*MockServiceMockRecorder) CreateOrganization

func (mr *MockServiceMockRecorder) CreateOrganization(ctx, organization interface{}) *gomock.Call

CreateOrganization indicates an expected call of CreateOrganization.

func (*MockServiceMockRecorder) CreateUser

func (mr *MockServiceMockRecorder) CreateUser(ctx, user interface{}) *gomock.Call

CreateUser indicates an expected call of CreateUser.

func (*MockServiceMockRecorder) CreateUserFromIdentity

func (mr *MockServiceMockRecorder) CreateUserFromIdentity(ctx, identity interface{}) *gomock.Call

CreateUserFromIdentity indicates an expected call of CreateUserFromIdentity.

func (*MockServiceMockRecorder) DeleteClient

func (mr *MockServiceMockRecorder) DeleteClient(ctx, id interface{}) *gomock.Call

DeleteClient indicates an expected call of DeleteClient.

func (*MockServiceMockRecorder) DeleteGroup

func (mr *MockServiceMockRecorder) DeleteGroup(ctx, id interface{}) *gomock.Call

DeleteGroup indicates an expected call of DeleteGroup.

func (*MockServiceMockRecorder) DeleteOrganization

func (mr *MockServiceMockRecorder) DeleteOrganization(ctx, id interface{}) *gomock.Call

DeleteOrganization indicates an expected call of DeleteOrganization.

func (*MockServiceMockRecorder) DeleteUser

func (mr *MockServiceMockRecorder) DeleteUser(ctx, id interface{}) *gomock.Call

DeleteUser indicates an expected call of DeleteUser.

func (*MockServiceMockRecorder) GetInheritedOrganizationsForUser

func (mr *MockServiceMockRecorder) GetInheritedOrganizationsForUser(ctx, user interface{}) *gomock.Call

GetInheritedOrganizationsForUser indicates an expected call of GetInheritedOrganizationsForUser.

func (*MockServiceMockRecorder) GetInheritedRolesForUser

func (mr *MockServiceMockRecorder) GetInheritedRolesForUser(ctx, user interface{}) *gomock.Call

GetInheritedRolesForUser indicates an expected call of GetInheritedRolesForUser.

func (*MockServiceMockRecorder) GetProviderByName

func (mr *MockServiceMockRecorder) GetProviderByName(ctx, organization, name interface{}) *gomock.Call

GetProviderByName indicates an expected call of GetProviderByName.

func (*MockServiceMockRecorder) GetProviders

func (mr *MockServiceMockRecorder) GetProviders(ctx interface{}) *gomock.Call

GetProviders indicates an expected call of GetProviders.

func (*MockServiceMockRecorder) GetRoles

func (mr *MockServiceMockRecorder) GetRoles(ctx interface{}) *gomock.Call

GetRoles indicates an expected call of GetRoles.

func (*MockServiceMockRecorder) GetUserByIdentity

func (mr *MockServiceMockRecorder) GetUserByIdentity(ctx, identity interface{}) *gomock.Call

GetUserByIdentity indicates an expected call of GetUserByIdentity.

func (*MockServiceMockRecorder) UpdateClient

func (mr *MockServiceMockRecorder) UpdateClient(ctx, client interface{}) *gomock.Call

UpdateClient indicates an expected call of UpdateClient.

func (*MockServiceMockRecorder) UpdateGroup

func (mr *MockServiceMockRecorder) UpdateGroup(ctx, group interface{}) *gomock.Call

UpdateGroup indicates an expected call of UpdateGroup.

func (*MockServiceMockRecorder) UpdateOrganization

func (mr *MockServiceMockRecorder) UpdateOrganization(ctx, organization interface{}) *gomock.Call

UpdateOrganization indicates an expected call of UpdateOrganization.

func (*MockServiceMockRecorder) UpdatePipeline

func (mr *MockServiceMockRecorder) UpdatePipeline(ctx, pipeline interface{}) *gomock.Call

UpdatePipeline indicates an expected call of UpdatePipeline.

func (*MockServiceMockRecorder) UpdateUser

func (mr *MockServiceMockRecorder) UpdateUser(ctx, user interface{}) *gomock.Call

UpdateUser indicates an expected call of UpdateUser.

type Service

type Service interface {
	GetRoles(ctx context.Context) (roles []string, err error)

	GetProviders(ctx context.Context) (providers []*api.OAuthProvider, err error)
	GetProviderByName(ctx context.Context, organization, name string) (provider *api.OAuthProvider, err error)

	GetUserByIdentity(ctx context.Context, identity contracts.UserIdentity) (user *contracts.User, err error)
	CreateUserFromIdentity(ctx context.Context, identity contracts.UserIdentity) (user *contracts.User, err error)
	CreateUser(ctx context.Context, user contracts.User) (insertedUser *contracts.User, err error)
	UpdateUser(ctx context.Context, user contracts.User) (err error)
	DeleteUser(ctx context.Context, id string) (err error)

	CreateGroup(ctx context.Context, group contracts.Group) (insertedGroup *contracts.Group, err error)
	UpdateGroup(ctx context.Context, group contracts.Group) (err error)
	DeleteGroup(ctx context.Context, id string) (err error)

	CreateOrganization(ctx context.Context, organization contracts.Organization) (insertedOrganization *contracts.Organization, err error)
	UpdateOrganization(ctx context.Context, organization contracts.Organization) (err error)
	DeleteOrganization(ctx context.Context, id string) (err error)

	CreateClient(ctx context.Context, client contracts.Client) (insertedClient *contracts.Client, err error)
	UpdateClient(ctx context.Context, client contracts.Client) (err error)
	DeleteClient(ctx context.Context, id string) (err error)

	UpdatePipeline(ctx context.Context, pipeline contracts.Pipeline) (err error)

	GetInheritedRolesForUser(ctx context.Context, user contracts.User) (roles []*string, err error)
	GetInheritedOrganizationsForUser(ctx context.Context, user contracts.User) (organizations []*contracts.Organization, err error)
}

Service handles http requests for role-based-access-control

func NewLoggingService

func NewLoggingService(s Service) Service

NewLoggingService returns a new instance of a logging Service.

func NewMetricsService

func NewMetricsService(s Service, requestCount metrics.Counter, requestLatency metrics.Histogram) Service

NewMetricsService returns a new instance of a metrics Service.

func NewService

func NewService(config *api.APIConfig, databaseClient database.Client) Service

NewService returns a github.Service to handle incoming webhook events

func NewTracingService

func NewTracingService(s Service) Service

NewTracingService returns a new instance of a tracing Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL