Documentation
¶
Overview ¶
Package syncrec provides a recording authz.RelationshipSyncer for tests.
Index ¶
- type Recorder
- func (r *Recorder) AddAppRole(_ context.Context, principalID, orgID uuid.UUID, application, role string) error
- func (r *Recorder) AddOrgMembership(_ context.Context, principalID, orgID uuid.UUID, role string) error
- func (r *Recorder) AddPrincipalManager(_ context.Context, managedID, managerID uuid.UUID, role string) error
- func (r *Recorder) Calls() []string
- func (r *Recorder) RegisterOrganization(_ context.Context, orgID, ownerID uuid.UUID) error
- func (r *Recorder) RegisterPrincipal(_ context.Context, principalID uuid.UUID) error
- func (r *Recorder) RemoveAppRole(_ context.Context, principalID, orgID uuid.UUID, application, role string) error
- func (r *Recorder) RemoveOrgMembership(_ context.Context, principalID, orgID uuid.UUID, role string) error
- func (r *Recorder) RemovePrincipalManager(_ context.Context, managedID, managerID uuid.UUID, role string) error
- func (r *Recorder) RemoveResourceGrant(_ context.Context, principalID uuid.UUID, ref authz.ResourceRef) error
- func (r *Recorder) Reset()
- func (r *Recorder) SetPlatformAdmin(_ context.Context, principalID uuid.UUID, isAdmin bool) error
- func (r *Recorder) SetResourceGrant(_ context.Context, principalID uuid.UUID, ref authz.ResourceRef, role string) error
- func (r *Recorder) UnregisterOrganization(_ context.Context, orgID uuid.UUID) error
- func (r *Recorder) UnregisterPrincipal(_ context.Context, principalID uuid.UUID) error
- func (r *Recorder) UpdateOrgMembership(_ context.Context, principalID, orgID uuid.UUID, oldRole, newRole string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
*noop.Syncer
// Err, when set, is returned from every recorded method.
Err error
// RemoveErr, when set, is returned from the methods that remove a
// relationship (Remove*, Unregister*, UpdateOrgMembership, and
// SetPlatformAdmin with false), so a test can fail revocations while
// grants succeed.
RemoveErr error
// contains filtered or unexported fields
}
Recorder records the calls made to it.
func (*Recorder) AddAppRole ¶
func (r *Recorder) AddAppRole(_ context.Context, principalID, orgID uuid.UUID, application, role string) error
AddAppRole records the call.
func (*Recorder) AddOrgMembership ¶
func (r *Recorder) AddOrgMembership(_ context.Context, principalID, orgID uuid.UUID, role string) error
AddOrgMembership records the call.
func (*Recorder) AddPrincipalManager ¶ added in v0.21.0
func (r *Recorder) AddPrincipalManager(_ context.Context, managedID, managerID uuid.UUID, role string) error
AddPrincipalManager records the call.
func (*Recorder) RegisterOrganization ¶
RegisterOrganization records the call.
func (*Recorder) RegisterPrincipal ¶
RegisterPrincipal records the call.
func (*Recorder) RemoveAppRole ¶
func (r *Recorder) RemoveAppRole(_ context.Context, principalID, orgID uuid.UUID, application, role string) error
RemoveAppRole records the call.
func (*Recorder) RemoveOrgMembership ¶
func (r *Recorder) RemoveOrgMembership(_ context.Context, principalID, orgID uuid.UUID, role string) error
RemoveOrgMembership records the call.
func (*Recorder) RemovePrincipalManager ¶ added in v0.21.0
func (r *Recorder) RemovePrincipalManager(_ context.Context, managedID, managerID uuid.UUID, role string) error
RemovePrincipalManager records the call.
func (*Recorder) RemoveResourceGrant ¶
func (r *Recorder) RemoveResourceGrant(_ context.Context, principalID uuid.UUID, ref authz.ResourceRef) error
RemoveResourceGrant records the call.
func (*Recorder) Reset ¶ added in v0.21.0
func (r *Recorder) Reset()
Reset clears the recorded calls.
func (*Recorder) SetPlatformAdmin ¶ added in v0.21.0
SetPlatformAdmin records the call.
func (*Recorder) SetResourceGrant ¶
func (r *Recorder) SetResourceGrant(_ context.Context, principalID uuid.UUID, ref authz.ResourceRef, role string) error
SetResourceGrant records the call.
func (*Recorder) UnregisterOrganization ¶ added in v0.21.0
UnregisterOrganization records the call.
func (*Recorder) UnregisterPrincipal ¶ added in v0.21.0
UnregisterPrincipal records the call.
Click to show internal directories.
Click to hide internal directories.