mocks

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const InvalidValue = "invalid"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

type AuthClient struct {
	mock.Mock
}

func (*AuthClient) AddPolicies

func (*AuthClient) AddPolicy

func (*AuthClient) Authorize

func (*AuthClient) CountObjects

func (*AuthClient) CountSubjects

func (*AuthClient) DeletePolicies

func (*AuthClient) DeletePolicy

func (*AuthClient) Identify

func (*AuthClient) Issue

func (*AuthClient) ListAllObjects

func (*AuthClient) ListAllSubjects

func (*AuthClient) ListObjects

func (*AuthClient) ListPermissions

func (*AuthClient) ListSubjects

func (*AuthClient) Refresh

func (m *AuthClient) Refresh(ctx context.Context, in *magistrala.RefreshReq, opts ...grpc.CallOption) (*magistrala.Token, error)

type Authz

type Authz struct {
	mock.Mock
}

Authz is an autogenerated mock type for the Authz type

func NewAuthz

func NewAuthz(t interface {
	mock.TestingT
	Cleanup(func())
}) *Authz

NewAuthz creates a new instance of Authz. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Authz) AddPolicies

func (_m *Authz) AddPolicies(ctx context.Context, prs []auth.PolicyReq) error

AddPolicies provides a mock function with given fields: ctx, prs

func (*Authz) AddPolicy

func (_m *Authz) AddPolicy(ctx context.Context, pr auth.PolicyReq) error

AddPolicy provides a mock function with given fields: ctx, pr

func (*Authz) Authorize

func (_m *Authz) Authorize(ctx context.Context, pr auth.PolicyReq) error

Authorize provides a mock function with given fields: ctx, pr

func (*Authz) CountObjects

func (_m *Authz) CountObjects(ctx context.Context, pr auth.PolicyReq) (int, error)

CountObjects provides a mock function with given fields: ctx, pr

func (*Authz) CountSubjects

func (_m *Authz) CountSubjects(ctx context.Context, pr auth.PolicyReq) (int, error)

CountSubjects provides a mock function with given fields: ctx, pr

func (*Authz) DeletePolicies

func (_m *Authz) DeletePolicies(ctx context.Context, prs []auth.PolicyReq) error

DeletePolicies provides a mock function with given fields: ctx, prs

func (*Authz) DeletePolicy

func (_m *Authz) DeletePolicy(ctx context.Context, pr auth.PolicyReq) error

DeletePolicy provides a mock function with given fields: ctx, pr

func (*Authz) ListAllObjects

func (_m *Authz) ListAllObjects(ctx context.Context, pr auth.PolicyReq) (auth.PolicyPage, error)

ListAllObjects provides a mock function with given fields: ctx, pr

func (*Authz) ListAllSubjects

func (_m *Authz) ListAllSubjects(ctx context.Context, pr auth.PolicyReq) (auth.PolicyPage, error)

ListAllSubjects provides a mock function with given fields: ctx, pr

func (*Authz) ListObjects

func (_m *Authz) ListObjects(ctx context.Context, pr auth.PolicyReq, nextPageToken string, limit int32) (auth.PolicyPage, error)

ListObjects provides a mock function with given fields: ctx, pr, nextPageToken, limit

func (*Authz) ListPermissions

func (_m *Authz) ListPermissions(ctx context.Context, pr auth.PolicyReq, filterPermission []string) (auth.Permissions, error)

ListPermissions provides a mock function with given fields: ctx, pr, filterPermission

func (*Authz) ListSubjects

func (_m *Authz) ListSubjects(ctx context.Context, pr auth.PolicyReq, nextPageToken string, limit int32) (auth.PolicyPage, error)

ListSubjects provides a mock function with given fields: ctx, pr, nextPageToken, limit

type DomainsRepository

type DomainsRepository struct {
	mock.Mock
}

DomainsRepository is an autogenerated mock type for the DomainsRepository type

func NewDomainsRepository

func NewDomainsRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *DomainsRepository

NewDomainsRepository creates a new instance of DomainsRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*DomainsRepository) CheckPolicy

func (_m *DomainsRepository) CheckPolicy(ctx context.Context, pc auth.Policy) error

CheckPolicy provides a mock function with given fields: ctx, pc

func (*DomainsRepository) Delete

func (_m *DomainsRepository) Delete(ctx context.Context, id string) error

Delete provides a mock function with given fields: ctx, id

func (*DomainsRepository) DeletePolicies

func (_m *DomainsRepository) DeletePolicies(ctx context.Context, pcs ...auth.Policy) error

DeletePolicies provides a mock function with given fields: ctx, pcs

func (*DomainsRepository) ListDomains

func (_m *DomainsRepository) ListDomains(ctx context.Context, pm auth.Page) (auth.DomainsPage, error)

ListDomains provides a mock function with given fields: ctx, pm

func (*DomainsRepository) RetrieveAllByIDs

func (_m *DomainsRepository) RetrieveAllByIDs(ctx context.Context, pm auth.Page) (auth.DomainsPage, error)

RetrieveAllByIDs provides a mock function with given fields: ctx, pm

func (*DomainsRepository) RetrieveByID

func (_m *DomainsRepository) RetrieveByID(ctx context.Context, id string) (auth.Domain, error)

RetrieveByID provides a mock function with given fields: ctx, id

func (*DomainsRepository) RetrievePermissions

func (_m *DomainsRepository) RetrievePermissions(ctx context.Context, subject string, id string) ([]string, error)

RetrievePermissions provides a mock function with given fields: ctx, subject, id

func (*DomainsRepository) Save

Save provides a mock function with given fields: ctx, d

func (*DomainsRepository) SavePolicies

func (_m *DomainsRepository) SavePolicies(ctx context.Context, pcs ...auth.Policy) error

SavePolicies provides a mock function with given fields: ctx, pcs

func (*DomainsRepository) Update

func (_m *DomainsRepository) Update(ctx context.Context, id string, userID string, d auth.DomainReq) (auth.Domain, error)

Update provides a mock function with given fields: ctx, id, userID, d

type KeyRepository

type KeyRepository struct {
	mock.Mock
}

KeyRepository is an autogenerated mock type for the KeyRepository type

func NewKeyRepository

func NewKeyRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *KeyRepository

NewKeyRepository creates a new instance of KeyRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*KeyRepository) Remove

func (_m *KeyRepository) Remove(ctx context.Context, issuer string, id string) error

Remove provides a mock function with given fields: ctx, issuer, id

func (*KeyRepository) Retrieve

func (_m *KeyRepository) Retrieve(ctx context.Context, issuer string, id string) (auth.Key, error)

Retrieve provides a mock function with given fields: ctx, issuer, id

func (*KeyRepository) Save

func (_m *KeyRepository) Save(ctx context.Context, key auth.Key) (string, error)

Save provides a mock function with given fields: ctx, key

type PolicyAgent

type PolicyAgent struct {
	mock.Mock
}

PolicyAgent is an autogenerated mock type for the PolicyAgent type

func NewPolicyAgent

func NewPolicyAgent(t interface {
	mock.TestingT
	Cleanup(func())
}) *PolicyAgent

NewPolicyAgent creates a new instance of PolicyAgent. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*PolicyAgent) AddPolicies

func (_m *PolicyAgent) AddPolicies(ctx context.Context, prs []auth.PolicyReq) error

AddPolicies provides a mock function with given fields: ctx, prs

func (*PolicyAgent) AddPolicy

func (_m *PolicyAgent) AddPolicy(ctx context.Context, pr auth.PolicyReq) error

AddPolicy provides a mock function with given fields: ctx, pr

func (*PolicyAgent) CheckPolicy

func (_m *PolicyAgent) CheckPolicy(ctx context.Context, pr auth.PolicyReq) error

CheckPolicy provides a mock function with given fields: ctx, pr

func (*PolicyAgent) DeletePolicies

func (_m *PolicyAgent) DeletePolicies(ctx context.Context, pr []auth.PolicyReq) error

DeletePolicies provides a mock function with given fields: ctx, pr

func (*PolicyAgent) DeletePolicy

func (_m *PolicyAgent) DeletePolicy(ctx context.Context, pr auth.PolicyReq) error

DeletePolicy provides a mock function with given fields: ctx, pr

func (*PolicyAgent) RetrieveAllObjects

func (_m *PolicyAgent) RetrieveAllObjects(ctx context.Context, pr auth.PolicyReq) ([]auth.PolicyRes, error)

RetrieveAllObjects provides a mock function with given fields: ctx, pr

func (*PolicyAgent) RetrieveAllObjectsCount

func (_m *PolicyAgent) RetrieveAllObjectsCount(ctx context.Context, pr auth.PolicyReq) (int, error)

RetrieveAllObjectsCount provides a mock function with given fields: ctx, pr

func (*PolicyAgent) RetrieveAllSubjects

func (_m *PolicyAgent) RetrieveAllSubjects(ctx context.Context, pr auth.PolicyReq) ([]auth.PolicyRes, error)

RetrieveAllSubjects provides a mock function with given fields: ctx, pr

func (*PolicyAgent) RetrieveAllSubjectsCount

func (_m *PolicyAgent) RetrieveAllSubjectsCount(ctx context.Context, pr auth.PolicyReq) (int, error)

RetrieveAllSubjectsCount provides a mock function with given fields: ctx, pr

func (*PolicyAgent) RetrieveObjects

func (_m *PolicyAgent) RetrieveObjects(ctx context.Context, pr auth.PolicyReq, nextPageToken string, limit int32) ([]auth.PolicyRes, string, error)

RetrieveObjects provides a mock function with given fields: ctx, pr, nextPageToken, limit

func (*PolicyAgent) RetrievePermissions

func (_m *PolicyAgent) RetrievePermissions(ctx context.Context, pr auth.PolicyReq, filterPermission []string) (auth.Permissions, error)

RetrievePermissions provides a mock function with given fields: ctx, pr, filterPermission

func (*PolicyAgent) RetrieveSubjects

func (_m *PolicyAgent) RetrieveSubjects(ctx context.Context, pr auth.PolicyReq, nextPageToken string, limit int32) ([]auth.PolicyRes, string, error)

RetrieveSubjects provides a mock function with given fields: ctx, pr, nextPageToken, limit

type Service

type Service struct {
	mock.Mock
}

Service is an autogenerated mock type for the Service type

func NewService

func NewService(t interface {
	mock.TestingT
	Cleanup(func())
}) *Service

NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Service) AddPolicies

func (_m *Service) AddPolicies(ctx context.Context, prs []auth.PolicyReq) error

AddPolicies provides a mock function with given fields: ctx, prs

func (*Service) AddPolicy

func (_m *Service) AddPolicy(ctx context.Context, pr auth.PolicyReq) error

AddPolicy provides a mock function with given fields: ctx, pr

func (*Service) AssignUsers

func (_m *Service) AssignUsers(ctx context.Context, token string, id string, userIds []string, relation string) error

AssignUsers provides a mock function with given fields: ctx, token, id, userIds, relation

func (*Service) Authorize

func (_m *Service) Authorize(ctx context.Context, pr auth.PolicyReq) error

Authorize provides a mock function with given fields: ctx, pr

func (*Service) ChangeDomainStatus

func (_m *Service) ChangeDomainStatus(ctx context.Context, token string, id string, d auth.DomainReq) (auth.Domain, error)

ChangeDomainStatus provides a mock function with given fields: ctx, token, id, d

func (*Service) CountObjects

func (_m *Service) CountObjects(ctx context.Context, pr auth.PolicyReq) (int, error)

CountObjects provides a mock function with given fields: ctx, pr

func (*Service) CountSubjects

func (_m *Service) CountSubjects(ctx context.Context, pr auth.PolicyReq) (int, error)

CountSubjects provides a mock function with given fields: ctx, pr

func (*Service) CreateDomain

func (_m *Service) CreateDomain(ctx context.Context, token string, d auth.Domain) (auth.Domain, error)

CreateDomain provides a mock function with given fields: ctx, token, d

func (*Service) DeletePolicies

func (_m *Service) DeletePolicies(ctx context.Context, prs []auth.PolicyReq) error

DeletePolicies provides a mock function with given fields: ctx, prs

func (*Service) DeletePolicy

func (_m *Service) DeletePolicy(ctx context.Context, pr auth.PolicyReq) error

DeletePolicy provides a mock function with given fields: ctx, pr

func (*Service) Identify

func (_m *Service) Identify(ctx context.Context, token string) (auth.Key, error)

Identify provides a mock function with given fields: ctx, token

func (*Service) Issue

func (_m *Service) Issue(ctx context.Context, token string, key auth.Key) (auth.Token, error)

Issue provides a mock function with given fields: ctx, token, key

func (*Service) ListAllObjects

func (_m *Service) ListAllObjects(ctx context.Context, pr auth.PolicyReq) (auth.PolicyPage, error)

ListAllObjects provides a mock function with given fields: ctx, pr

func (*Service) ListAllSubjects

func (_m *Service) ListAllSubjects(ctx context.Context, pr auth.PolicyReq) (auth.PolicyPage, error)

ListAllSubjects provides a mock function with given fields: ctx, pr

func (*Service) ListDomains

func (_m *Service) ListDomains(ctx context.Context, token string, page auth.Page) (auth.DomainsPage, error)

ListDomains provides a mock function with given fields: ctx, token, page

func (*Service) ListObjects

func (_m *Service) ListObjects(ctx context.Context, pr auth.PolicyReq, nextPageToken string, limit int32) (auth.PolicyPage, error)

ListObjects provides a mock function with given fields: ctx, pr, nextPageToken, limit

func (*Service) ListPermissions

func (_m *Service) ListPermissions(ctx context.Context, pr auth.PolicyReq, filterPermission []string) (auth.Permissions, error)

ListPermissions provides a mock function with given fields: ctx, pr, filterPermission

func (*Service) ListSubjects

func (_m *Service) ListSubjects(ctx context.Context, pr auth.PolicyReq, nextPageToken string, limit int32) (auth.PolicyPage, error)

ListSubjects provides a mock function with given fields: ctx, pr, nextPageToken, limit

func (*Service) ListUserDomains

func (_m *Service) ListUserDomains(ctx context.Context, token string, userID string, page auth.Page) (auth.DomainsPage, error)

ListUserDomains provides a mock function with given fields: ctx, token, userID, page

func (*Service) RetrieveDomain

func (_m *Service) RetrieveDomain(ctx context.Context, token string, id string) (auth.Domain, error)

RetrieveDomain provides a mock function with given fields: ctx, token, id

func (*Service) RetrieveDomainPermissions

func (_m *Service) RetrieveDomainPermissions(ctx context.Context, token string, id string) (auth.Permissions, error)

RetrieveDomainPermissions provides a mock function with given fields: ctx, token, id

func (*Service) RetrieveKey

func (_m *Service) RetrieveKey(ctx context.Context, token string, id string) (auth.Key, error)

RetrieveKey provides a mock function with given fields: ctx, token, id

func (*Service) Revoke

func (_m *Service) Revoke(ctx context.Context, token string, id string) error

Revoke provides a mock function with given fields: ctx, token, id

func (*Service) UnassignUsers

func (_m *Service) UnassignUsers(ctx context.Context, token string, id string, userIds []string, relation string) error

UnassignUsers provides a mock function with given fields: ctx, token, id, userIds, relation

func (*Service) UpdateDomain

func (_m *Service) UpdateDomain(ctx context.Context, token string, id string, d auth.DomainReq) (auth.Domain, error)

UpdateDomain provides a mock function with given fields: ctx, token, id, d

Jump to

Keyboard shortcuts

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