mock

package
v2.16.6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeServer added in v2.3.1

type AuthorizeServer struct {
	mock.Mock
	// contains filtered or unexported fields
}

func NewServer added in v2.3.1

func NewServer() (server *AuthorizeServer, err error)

func NewServerOnHostPort added in v2.5.0

func NewServerOnHostPort(host, port string) (server *AuthorizeServer, err error)

func (*AuthorizeServer) AddAction added in v2.3.1

func (*AuthorizeServer) AddResource added in v2.3.1

func (*AuthorizeServer) AddResourceRelation added in v2.3.1

func (s *AuthorizeServer) AddResourceRelation(ctx context.Context, in *authorize.AddResourceRelationInput) (*common.Void, error)

func (*AuthorizeServer) AddResourceRelations added in v2.3.1

func (s *AuthorizeServer) AddResourceRelations(ctx context.Context, in *authorize.AddResourceRelationsInput) (*common.Void, error)

func (*AuthorizeServer) AddResources added in v2.3.1

func (*AuthorizeServer) AddUserRole added in v2.3.1

func (s *AuthorizeServer) AddUserRole(ctx context.Context, in *authorize.UserRole) (*common.Void, error)

func (*AuthorizeServer) ApplyRolesForUserOnResources added in v2.8.0

func (s *AuthorizeServer) ApplyRolesForUserOnResources(ctx context.Context, in *authorize.ApplyRolesForUserOnResourcesInput) (*common.Void, error)

func (*AuthorizeServer) ApplyUserAction added in v2.3.1

func (s *AuthorizeServer) ApplyUserAction(ctx context.Context, in *authorize.ApplyUserActionInput) (*common.Void, error)

func (*AuthorizeServer) AssertExpectations added in v2.3.1

func (s *AuthorizeServer) AssertExpectations(t *testing.T)

func (*AuthorizeServer) DeepPing added in v2.3.1

func (s *AuthorizeServer) DeepPing(ctx context.Context, void *common.Void) (*common.PrimitiveString, error)

func (*AuthorizeServer) GetAction added in v2.3.1

func (*AuthorizeServer) GetActionsByUserRole added in v2.3.1

func (*AuthorizeServer) GetAllActions added in v2.3.1

func (*AuthorizeServer) GetResource added in v2.3.1

func (*AuthorizeServer) GetResourceChildren added in v2.3.1

func (*AuthorizeServer) GetResourceParents added in v2.3.1

func (*AuthorizeServer) GetResourcesAndActionsByUser added in v2.3.1

func (*AuthorizeServer) GetResourcesByOriginAndType added in v2.3.1

func (*AuthorizeServer) GetResourcesByType added in v2.3.1

func (*AuthorizeServer) GetResourcesByUserAction added in v2.3.1

func (*AuthorizeServer) GetResourcesWithActionsAccess added in v2.3.1

func (*AuthorizeServer) GetUserActions added in v2.3.1

func (*AuthorizeServer) GetUserIDsWithAccessToResource added in v2.3.1

func (*AuthorizeServer) GetUserRole added in v2.3.1

func (*AuthorizeServer) HostPort added in v2.3.1

func (s *AuthorizeServer) HostPort() (string, string)

func (*AuthorizeServer) IsAuthorized added in v2.3.1

func (*AuthorizeServer) IsAuthorizedBulk added in v2.3.1

func (*AuthorizeServer) IsAuthorizedByEndpoint added in v2.3.1

func (*AuthorizeServer) IsAuthorizedWithReason added in v2.9.2

func (*AuthorizeServer) LogClientState added in v2.3.1

func (s *AuthorizeServer) LogClientState(ctx context.Context, clientInfo *authorize.LogClientStateInput) (*common.Void, error)

func (*AuthorizeServer) RemoveAction added in v2.3.1

func (*AuthorizeServer) RemoveResource added in v2.3.1

func (s *AuthorizeServer) RemoveResource(ctx context.Context, in *authorize.RemoveResourceInput) (*common.Void, error)

func (*AuthorizeServer) RemoveResourceRelation added in v2.3.1

func (s *AuthorizeServer) RemoveResourceRelation(ctx context.Context, in *authorize.RemoveResourceRelationInput) (*common.Void, error)

func (*AuthorizeServer) RemoveResourceRelations added in v2.3.1

func (s *AuthorizeServer) RemoveResourceRelations(ctx context.Context, in *authorize.RemoveResourceRelationsInput) (*common.Void, error)

func (*AuthorizeServer) RemoveResources added in v2.3.1

func (s *AuthorizeServer) RemoveResources(ctx context.Context, in *authorize.RemoveResourcesInput) (*common.Void, error)

func (*AuthorizeServer) RemoveUserAction added in v2.3.1

func (s *AuthorizeServer) RemoveUserAction(ctx context.Context, in *authorize.RemoveUserActionInput) (*common.Void, error)

func (*AuthorizeServer) RemoveUserRole added in v2.3.1

func (s *AuthorizeServer) RemoveUserRole(ctx context.Context, in *authorize.RemoveUserRoleInput) (*common.Void, error)

type Client added in v2.9.4

type Client struct {
	mock.Mock
}

func Create

func Create() *Client

func (*Client) AddAction added in v2.9.4

func (mock *Client) AddAction(action grpcapi.Action) error

func (*Client) AddActionWithContext added in v2.9.4

func (mock *Client) AddActionWithContext(ctx context.Context, action grpcapi.Action) error

func (*Client) AddResource added in v2.9.4

func (mock *Client) AddResource(resource common.Origin) error

func (*Client) AddResourceRelation added in v2.9.4

func (mock *Client) AddResourceRelation(resource common.Origin, parent common.Origin) error

func (*Client) AddResourceRelationWithContext added in v2.9.4

func (mock *Client) AddResourceRelationWithContext(ctx context.Context, resource common.Origin, parent common.Origin) error

func (*Client) AddResourceRelations added in v2.9.4

func (mock *Client) AddResourceRelations(resources grpcapi.AddResourceRelationsInput) error

func (*Client) AddResourceRelationsWithContext added in v2.9.4

func (mock *Client) AddResourceRelationsWithContext(ctx context.Context, resources grpcapi.AddResourceRelationsInput) error

func (*Client) AddResourceWithContext added in v2.9.4

func (mock *Client) AddResourceWithContext(ctx context.Context, resource common.Origin) error

func (*Client) AddResources added in v2.9.4

func (mock *Client) AddResources(resources []common.Origin) error

func (*Client) AddResourcesWithContext added in v2.9.4

func (mock *Client) AddResourcesWithContext(ctx context.Context, resources []common.Origin) error

func (*Client) AddUserRole added in v2.9.4

func (mock *Client) AddUserRole(role grpcapi.UserRole) error

func (*Client) AddUserRoleWithContext added in v2.9.4

func (mock *Client) AddUserRoleWithContext(ctx context.Context, role grpcapi.UserRole) error

func (*Client) ApplyRolesForUserOnResources added in v2.9.4

func (mock *Client) ApplyRolesForUserOnResources(userID string, roles []string, resources []common.Origin) error

func (*Client) ApplyRolesForUserOnResourcesWithContext added in v2.9.4

func (mock *Client) ApplyRolesForUserOnResourcesWithContext(ctx context.Context, userID string, roles []string, resources []common.Origin) error

func (*Client) ApplyUserAction added in v2.9.4

func (mock *Client) ApplyUserAction(userID, action string, resource *common.Origin) error

func (*Client) ApplyUserActionWithContext added in v2.9.4

func (mock *Client) ApplyUserActionWithContext(ctx context.Context, userID, action string, resource *common.Origin) error

func (*Client) Close added in v2.9.4

func (mock *Client) Close() error

func (*Client) DeepPing added in v2.9.4

func (mock *Client) DeepPing() error

func (*Client) DeepPingWithContext added in v2.9.4

func (mock *Client) DeepPingWithContext(ctx context.Context) error

func (*Client) Dial added in v2.9.4

func (mock *Client) Dial(host, port string, opts ...grpc.DialOption) error

func (*Client) DialUsingCredentials added in v2.9.4

func (mock *Client) DialUsingCredentials(sess *session.Session, host, port, secretKey string, opts ...grpc.DialOption) error

func (*Client) DialUsingCredentialsManager added in v2.15.0

func (mock *Client) DialUsingCredentialsManager(ctx context.Context, cf credentialsmanager.CredentialsFetcher, host, port, secretKey string, opts ...grpc.DialOption) error

func (*Client) DialUsingCredentialsWithContext added in v2.9.4

func (mock *Client) DialUsingCredentialsWithContext(ctx context.Context, sess *session.Session, host, port, secretKey string, opts ...grpc.DialOption) error

func (*Client) DialWithContext added in v2.9.4

func (mock *Client) DialWithContext(ctx context.Context, host, port string, opts ...grpc.DialOption) error

func (*Client) GetAction added in v2.9.4

func (mock *Client) GetAction(name string) (grpcapi.Action, error)

func (*Client) GetActionWithContext added in v2.9.4

func (mock *Client) GetActionWithContext(ctx context.Context, name string) (grpcapi.Action, error)

func (*Client) GetActionsByUserRole added in v2.9.4

func (mock *Client) GetActionsByUserRole(userRole string) ([]grpcapi.Action, error)

func (*Client) GetActionsByUserRoleWithContext added in v2.9.4

func (mock *Client) GetActionsByUserRoleWithContext(ctx context.Context, userRole string) ([]grpcapi.Action, error)

func (*Client) GetAllActions added in v2.9.4

func (mock *Client) GetAllActions() ([]grpcapi.Action, error)

func (*Client) GetAllActionsWithContext added in v2.9.4

func (mock *Client) GetAllActionsWithContext(ctx context.Context) ([]grpcapi.Action, error)

func (*Client) GetResource added in v2.9.4

func (mock *Client) GetResource(id string, originType string) (common.Origin, error)

func (*Client) GetResourceChildren added in v2.9.4

func (mock *Client) GetResourceChildren(resource common.Origin, childOriginType string) (resources []common.Origin, err error)

func (*Client) GetResourceChildrenWithContext added in v2.9.4

func (mock *Client) GetResourceChildrenWithContext(ctx context.Context, resource common.Origin, childOriginType string) (resources []common.Origin, err error)

func (*Client) GetResourceParents added in v2.9.4

func (mock *Client) GetResourceParents(resource common.Origin, parentOriginType string) (resources []common.Origin, err error)

func (*Client) GetResourceParentsWithContext added in v2.9.4

func (mock *Client) GetResourceParentsWithContext(ctx context.Context, resource common.Origin, parentOriginType string) (resources []common.Origin, err error)

func (*Client) GetResourceWithContext added in v2.9.4

func (mock *Client) GetResourceWithContext(ctx context.Context, id string, originType string) (common.Origin, error)

func (*Client) GetResourcesAndActionsByUser added in v2.9.4

func (mock *Client) GetResourcesAndActionsByUser(userID string) ([]grpcapi.ActionResource, error)

func (*Client) GetResourcesAndActionsByUserAndResource added in v2.9.4

func (mock *Client) GetResourcesAndActionsByUserAndResource(userID string, resource *common.Origin) ([]grpcapi.ActionResource, error)

func (*Client) GetResourcesAndActionsByUserAndResourceWithContext added in v2.9.4

func (mock *Client) GetResourcesAndActionsByUserAndResourceWithContext(ctx context.Context, userID string, resource *common.Origin) ([]grpcapi.ActionResource, error)

func (*Client) GetResourcesAndActionsByUserWithContext added in v2.9.4

func (mock *Client) GetResourcesAndActionsByUserWithContext(ctx context.Context, userID string) ([]grpcapi.ActionResource, error)

func (*Client) GetResourcesByOriginAndType added in v2.9.4

func (mock *Client) GetResourcesByOriginAndType(resource common.Origin, resourceType string, depth int32) (resources []common.Origin, err error)

func (*Client) GetResourcesByOriginAndTypeWithContext added in v2.9.4

func (mock *Client) GetResourcesByOriginAndTypeWithContext(ctx context.Context, resource common.Origin, resourceType string, depth int32) (resources []common.Origin, err error)

func (*Client) GetResourcesByType added in v2.9.4

func (mock *Client) GetResourcesByType(resourceType string) (resources []common.Origin, err error)

func (*Client) GetResourcesByTypeWithContext added in v2.9.4

func (mock *Client) GetResourcesByTypeWithContext(ctx context.Context, resourceType string) (resources []common.Origin, err error)

func (*Client) GetResourcesByUserAction added in v2.9.4

func (mock *Client) GetResourcesByUserAction(userID, actionName, resourceType string) ([]common.Origin, error)

func (*Client) GetResourcesByUserActionWithContext added in v2.9.4

func (mock *Client) GetResourcesByUserActionWithContext(ctx context.Context, userID, actionName, resourceType string) ([]common.Origin, error)

func (*Client) GetResourcesWithActionsAccess added in v2.9.4

func (mock *Client) GetResourcesWithActionsAccess(actions []string, resourceType string, resource *common.Origin) ([]common.Origin, error)

func (*Client) GetResourcesWithActionsAccessWithContext added in v2.9.4

func (mock *Client) GetResourcesWithActionsAccessWithContext(ctx context.Context, actions []string, resourceType string, resource *common.Origin) ([]common.Origin, error)

func (*Client) GetUserActions added in v2.9.4

func (mock *Client) GetUserActions(userID string) ([]grpcapi.Action, error)

func (*Client) GetUserActionsWithContext added in v2.9.4

func (mock *Client) GetUserActionsWithContext(ctx context.Context, userID string) ([]grpcapi.Action, error)

func (*Client) GetUserIDsWithAccessToResource added in v2.9.4

func (mock *Client) GetUserIDsWithAccessToResource(resource common.Origin) (resources []string, err error)

func (*Client) GetUserIDsWithAccessToResourceWithContext added in v2.9.4

func (mock *Client) GetUserIDsWithAccessToResourceWithContext(ctx context.Context, resource common.Origin) (resources []string, err error)

func (*Client) GetUserRole added in v2.9.4

func (mock *Client) GetUserRole(roleName string) (grpcapi.UserRole, error)

func (*Client) GetUserRoleWithContext added in v2.9.4

func (mock *Client) GetUserRoleWithContext(ctx context.Context, roleName string) (grpcapi.UserRole, error)

func (*Client) IsAuthorized added in v2.9.4

func (mock *Client) IsAuthorized(userID, action string, resource *common.Origin) (bool, error)

func (*Client) IsAuthorizedBulk added in v2.9.4

func (mock *Client) IsAuthorizedBulk(userID, action string, resources []common.Origin) ([]string, []bool, error)

func (*Client) IsAuthorizedBulkWithContext added in v2.9.4

func (mock *Client) IsAuthorizedBulkWithContext(ctx context.Context, userID, action string, resources []common.Origin) ([]string, []bool, error)

func (*Client) IsAuthorizedBulkWithResources added in v2.9.4

func (mock *Client) IsAuthorizedBulkWithResources(ctx context.Context, userID, action string, resources []common.Origin) ([]common.Origin, []bool, error)

func (*Client) IsAuthorizedByEndpoint added in v2.9.4

func (mock *Client) IsAuthorizedByEndpoint(api, method, endpoint, userID string) (bool, error)

func (*Client) IsAuthorizedByEndpointWithContext added in v2.9.4

func (mock *Client) IsAuthorizedByEndpointWithContext(ctx context.Context, api, method, endpoint, userID string) (bool, error)

func (*Client) IsAuthorizedWithContext added in v2.9.4

func (mock *Client) IsAuthorizedWithContext(ctx context.Context, userID, action string, resource *common.Origin) (bool, error)

func (*Client) IsAuthorizedWithReason added in v2.9.4

func (mock *Client) IsAuthorizedWithReason(userID, action string, resource *common.Origin) (bool, string, error)

func (*Client) IsAuthorizedWithReasonWithContext added in v2.9.4

func (mock *Client) IsAuthorizedWithReasonWithContext(ctx context.Context, userID, action string, resource *common.Origin) (bool, string, error)

func (*Client) RemoveAction added in v2.9.4

func (mock *Client) RemoveAction(name string) error

func (*Client) RemoveActionWithContext added in v2.9.4

func (mock *Client) RemoveActionWithContext(ctx context.Context, name string) error

func (*Client) RemoveResource added in v2.9.4

func (mock *Client) RemoveResource(resource common.Origin) error

func (*Client) RemoveResourceRelation added in v2.9.4

func (mock *Client) RemoveResourceRelation(resource common.Origin, parent common.Origin) error

func (*Client) RemoveResourceRelationWithContext added in v2.9.4

func (mock *Client) RemoveResourceRelationWithContext(ctx context.Context, resource common.Origin, parent common.Origin) error

func (*Client) RemoveResourceRelations added in v2.9.4

func (mock *Client) RemoveResourceRelations(resources grpcapi.RemoveResourceRelationsInput) error

func (*Client) RemoveResourceRelationsWithContext added in v2.9.4

func (mock *Client) RemoveResourceRelationsWithContext(ctx context.Context, resources grpcapi.RemoveResourceRelationsInput) error

func (*Client) RemoveResourceWithContext added in v2.9.4

func (mock *Client) RemoveResourceWithContext(ctx context.Context, resource common.Origin) error

func (*Client) RemoveResources added in v2.9.4

func (mock *Client) RemoveResources(resources []common.Origin) error

func (*Client) RemoveResourcesWithContext added in v2.9.4

func (mock *Client) RemoveResourcesWithContext(ctx context.Context, resources []common.Origin) error

func (*Client) RemoveUserAction added in v2.9.4

func (mock *Client) RemoveUserAction(userID, action string, resource *common.Origin) error

func (*Client) RemoveUserActionWithContext added in v2.9.4

func (mock *Client) RemoveUserActionWithContext(ctx context.Context, userID, action string, resource *common.Origin) error

func (*Client) RemoveUserRole added in v2.9.4

func (mock *Client) RemoveUserRole(roleName string) error

func (*Client) RemoveUserRoleWithContext added in v2.9.4

func (mock *Client) RemoveUserRoleWithContext(ctx context.Context, roleName string) error

func (*Client) SetRequestTimeout added in v2.9.4

func (mock *Client) SetRequestTimeout(d time.Duration)

Jump to

Keyboard shortcuts

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