usersync

package
v0.0.0-...-6dc0b65 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Run

type Run struct {
	// contains filtered or unexported fields
}

func (*Run) CorrelationID

func (r *Run) CorrelationID() uuid.UUID

func (*Run) Error

func (r *Run) Error() error

func (*Run) Finish

func (r *Run) Finish()

func (*Run) FinishWithError

func (r *Run) FinishWithError(err error)

func (*Run) FinishedAt

func (r *Run) FinishedAt() *time.Time

func (*Run) StartedAt

func (r *Run) StartedAt() time.Time

func (*Run) Status

func (r *Run) Status() RunStatus

type RunStatus

type RunStatus int64
const (
	RunInProgress RunStatus = iota
	RunSuccess
	RunFailure
)

type RunsHandler

type RunsHandler struct {
	// contains filtered or unexported fields
}

func NewRunsHandler

func NewRunsHandler(maxEntries int) *RunsHandler

func (*RunsHandler) GetRuns

func (r *RunsHandler) GetRuns() []*Run

func (*RunsHandler) StartNewRun

func (r *RunsHandler) StartNewRun(correlationID uuid.UUID) *Run

type UserSynchronizer

type UserSynchronizer struct {
	// contains filtered or unexported fields
}

func New

func New(dbc database.Database, auditLogger auditlogger.AuditLogger, adminGroupPrefix, tenantDomain string, service *admin_directory_v1.Service, log logrus.FieldLogger, syncRuns *RunsHandler) *UserSynchronizer

func NewFromConfig

func NewFromConfig(ctx context.Context, serviceAccount, subjectEmail, tenantDomain, adminGroupPrefix string, db database.Database, log logrus.FieldLogger, syncRuns *RunsHandler) (*UserSynchronizer, error)

func (*UserSynchronizer) Sync

func (s *UserSynchronizer) Sync(ctx context.Context, correlationID uuid.UUID) error

Sync Fetch all users from the tenant and add them as local users in api. If a user already exists in api the local user will get the name potentially updated. After all users have been upserted, local users that matches the tenant domain that does not exist in the Google Directory will be removed.

Jump to

Keyboard shortcuts

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