googlegroups

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ReadOnlyScope = "https://www.googleapis.com/auth/cloud-identity.groups.readonly"
)

Variables

View Source
var ErrNotFound = errors.New("google group not found")

ErrNotFound allows alternate directory implementations and hermetic tests to report a deleted or unknown group without exposing provider response data.

Functions

func ErrorCode

func ErrorCode(err error) string

func IsNotFound

func IsNotFound(err error) bool

Types

type GoogleGroup

type GoogleGroup struct {
	ID         string
	CustomerID string
	Email      string
	Name       string
}

type GoogleGroupDirectory

type GoogleGroupDirectory interface {
	SearchGroups(ctx context.Context, query string, limit int) ([]GoogleGroup, error)
	LookupGroup(ctx context.Context, email string) (GoogleGroup, error)
	TransitiveGroupsForMember(ctx context.Context, userEmail string) ([]GoogleGroup, error)
}

type HTTPDirectory

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

func NewHTTPDirectory

func NewHTTPDirectory(cfg HTTPDirectoryConfig) (*HTTPDirectory, error)

func (*HTTPDirectory) LookupGroup

func (d *HTTPDirectory) LookupGroup(ctx context.Context, email string) (GoogleGroup, error)

func (*HTTPDirectory) SearchGroups

func (d *HTTPDirectory) SearchGroups(ctx context.Context, query string, limit int) ([]GoogleGroup, error)

func (*HTTPDirectory) TransitiveGroupsForMember

func (d *HTTPDirectory) TransitiveGroupsForMember(ctx context.Context, userEmail string) ([]GoogleGroup, error)

type HTTPDirectoryConfig

type HTTPDirectoryConfig struct {
	Client     *http.Client
	Endpoint   string
	CustomerID string
	Timeout    time.Duration
	Observer   RequestObserver
}

type MembershipObserver

type MembershipObserver func(event, outcome string)

type MembershipStore

type MembershipStore interface {
	GoogleGroupMembershipSnapshot(ctx context.Context, userID string) (repo.GoogleGroupMembershipSnapshot, error)
	ReplaceGoogleGroupMemberships(ctx context.Context, userID string, groups []repo.GoogleGroup, syncedAt time.Time) error
	RecordGoogleGroupMembershipFailure(ctx context.Context, userID, errorCode string, attemptedAt time.Time) error
}

type RequestObserver

type RequestObserver func(operation, outcome string, elapsed time.Duration)

type Resolver

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

func NewResolver

func NewResolver(cfg ResolverConfig) *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, principal *auth.Principal) *auth.Principal

type ResolverConfig

type ResolverConfig struct {
	Store         MembershipStore
	Directory     GoogleGroupDirectory
	TTL           time.Duration
	RetryCooldown time.Duration
	Now           func() time.Time
	Observer      MembershipObserver
}

Jump to

Keyboard shortcuts

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