resolvers

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildResolverOptions

type BuildResolverOptions struct {
	Config          *config.Config
	Store           OrgStore
	Log             logrus.FieldLogger
	Cache           cache.OrganizationCache
	MembershipCache cache.Membership
}

type DefaultResolver

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

DefaultResolver is a shim over the default organization, and treats it as the only organization a user can be a member of.

func NewDefaultResolver

func NewDefaultResolver(store OrgStore, cache cache.OrganizationCache) *DefaultResolver

func (*DefaultResolver) EnsureExists

func (r *DefaultResolver) EnsureExists(ctx context.Context, id uuid.UUID) error

func (*DefaultResolver) GetUserOrganizations

func (r *DefaultResolver) GetUserOrganizations(ctx context.Context, identity common.Identity) ([]*model.Organization, error)

func (*DefaultResolver) IsMemberOf

func (r *DefaultResolver) IsMemberOf(ctx context.Context, identity common.Identity, orgID uuid.UUID) (bool, error)

type ExternalResolver

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

ExternalResolver caches organization ID validation.

func NewExternalResolver

func NewExternalResolver(store OrgStore, cache cache.OrganizationCache, externalOrgProvider providers.ExternalOrganizationProvider, log logrus.FieldLogger) *ExternalResolver

NewExternalResolver constructs a new resolver. A TTL of zero disables expiration.

func (*ExternalResolver) EnsureExists

func (r *ExternalResolver) EnsureExists(ctx context.Context, id uuid.UUID) error

func (*ExternalResolver) GetUserOrganizations

func (r *ExternalResolver) GetUserOrganizations(ctx context.Context, identity common.Identity) ([]*model.Organization, error)

func (*ExternalResolver) IsMemberOf

func (r *ExternalResolver) IsMemberOf(ctx context.Context, identity common.Identity, id uuid.UUID) (bool, error)

type OrgStore

type OrgStore interface {
	GetByID(ctx context.Context, id uuid.UUID) (*model.Organization, error)
	ListByExternalIDs(ctx context.Context, externalIDs []string) ([]*model.Organization, error)
	UpsertMany(ctx context.Context, orgs []*model.Organization) ([]*model.Organization, error)
}

type Resolver

type Resolver interface {
	EnsureExists(ctx context.Context, id uuid.UUID) error
	IsMemberOf(ctx context.Context, identity common.Identity, id uuid.UUID) (bool, error)
	GetUserOrganizations(ctx context.Context, identity common.Identity) ([]*model.Organization, error)
}

func BuildResolver

func BuildResolver(opts BuildResolverOptions) (Resolver, error)

Jump to

Keyboard shortcuts

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