testutils

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 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) GetAllMembersOfOrganization added in v0.4.19

func (r RBACMock) GetAllMembersOfOrganization() ([]string, error)

func (RBACMock) GetAllMembersOfProject added in v0.5.14

func (r RBACMock) GetAllMembersOfProject(project string) ([]string, error)

func (RBACMock) GetAllProjectsForUser

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

func (*RBACMock) GetAllRoles

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

func (RBACMock) GetDomainRole added in v0.5.14

func (r RBACMock) GetDomainRole(domain string) (string, error)

func (*RBACMock) GetOwnerOfOrganization

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

func (RBACMock) GetProjectRole added in v0.5.14

func (r RBACMock) GetProjectRole(domain, project 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) InheritProjectRolesAcrossProjects added in v0.5.15

func (r RBACMock) InheritProjectRolesAcrossProjects(roleWhichGetsPermissions, roleWhichProvidesPermissions accesscontrol.ProjectRole) 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