Help us shape the future of Go! Take the 2026 Go Developer Survey

syncrec

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package syncrec provides a recording authz.RelationshipSyncer for tests.

Index

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 New

func New() *Recorder

New returns an empty Recorder.

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) Calls

func (r *Recorder) Calls() []string

Calls returns a copy of the recorded calls, formatted "Method:arg:arg".

func (*Recorder) RegisterOrganization

func (r *Recorder) RegisterOrganization(_ context.Context, orgID, ownerID uuid.UUID) error

RegisterOrganization records the call.

func (*Recorder) RegisterPrincipal

func (r *Recorder) RegisterPrincipal(_ context.Context, principalID uuid.UUID) error

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

func (r *Recorder) SetPlatformAdmin(_ context.Context, principalID uuid.UUID, isAdmin bool) error

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

func (r *Recorder) UnregisterOrganization(_ context.Context, orgID uuid.UUID) error

UnregisterOrganization records the call.

func (*Recorder) UnregisterPrincipal added in v0.21.0

func (r *Recorder) UnregisterPrincipal(_ context.Context, principalID uuid.UUID) error

UnregisterPrincipal records the call.

func (*Recorder) UpdateOrgMembership added in v0.21.0

func (r *Recorder) UpdateOrgMembership(_ context.Context, principalID, orgID uuid.UUID, oldRole, newRole string) error

UpdateOrgMembership records the call.

Jump to

Keyboard shortcuts

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