testutils

package
v0.4.18 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRBACProviderMock

func NewRBACProviderMock() accesscontrol.RBACProvider

func ReaderFromAny

func ReaderFromAny(v any) io.Reader

Types

type RBACMock

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

func (*RBACMock) AllowRole

func (r *RBACMock) AllowRole(role string, object string, action []accesscontrol.Action) error

func (*RBACMock) AllowRoleInProject

func (r *RBACMock) AllowRoleInProject(project, role string, object string, action []accesscontrol.Action) error

func (RBACMock) GetAllProjectsForUser

func (r RBACMock) GetAllProjectsForUser(user string) []string

func (*RBACMock) GetAllRoles

func (r *RBACMock) GetAllRoles(user string) []string

func (*RBACMock) GetOwnerOfOrganization

func (r *RBACMock) GetOwnerOfOrganization(organization string) (string, error)

func (*RBACMock) GetProjectRoleName

func (r *RBACMock) GetProjectRoleName(project string, role string) string

func (*RBACMock) GrantRole

func (r *RBACMock) GrantRole(subject, role string) error

func (*RBACMock) GrantRoleInProject

func (r *RBACMock) GrantRoleInProject(subject string, role string, project string) error

func (*RBACMock) HasAccess

func (r *RBACMock) HasAccess(subject string) bool

func (*RBACMock) InheritProjectRole

func (r *RBACMock) InheritProjectRole(roleWhichGetsPermissions, roleWhichProvidesPermissions, project string) error

func (*RBACMock) InheritRole

func (r *RBACMock) InheritRole(roleWhichGetsPermissions, roleWhichProvidesPermissions string) error

func (*RBACMock) IsAllowed

func (r *RBACMock) IsAllowed(subject, object string, action accesscontrol.Action) (bool, error)

func (*RBACMock) IsAllowedInProject

func (r *RBACMock) IsAllowedInProject(project, user, object string, action accesscontrol.Action) (bool, error)

func (*RBACMock) LinkDomainAndProjectRole

func (r *RBACMock) LinkDomainAndProjectRole(domainRoleWhichGetsPermission, projectRoleWhichProvidesPermissions, project string) error

func (*RBACMock) RevokeRole

func (r *RBACMock) RevokeRole(subject string, role string) error

func (*RBACMock) RevokeRoleInProject

func (r *RBACMock) RevokeRoleInProject(subject string, role string, project string) error

type RBACProviderMock

type RBACProviderMock struct {
}

func (RBACProviderMock) DomainsOfUser

func (r RBACProviderMock) DomainsOfUser(user string) ([]string, error)

func (RBACProviderMock) GetDomainRBAC

func (r RBACProviderMock) GetDomainRBAC(domain string) accesscontrol.AccessControl

type SessionMock

type SessionMock struct {
	UserID string
}

func NewSessionMock

func NewSessionMock(userID string) SessionMock

func (SessionMock) GetUserID

func (s SessionMock) GetUserID() string

Jump to

Keyboard shortcuts

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