syncrec

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 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 the recorded methods.
	Err error
	// contains filtered or unexported fields
}

Recorder records the registration and application-role calls made to it. All other syncer methods are no-ops from the embedded noop syncer.

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

func (r *Recorder) RemoveResourceGrant(_ context.Context, principalID uuid.UUID, ref authz.ResourceRef) error

RemoveResourceGrant 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.

Jump to

Keyboard shortcuts

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