idp

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDirectoryServiceNil is returned when the GoogleProviderService is nil.
	ErrDirectoryServiceNil = errors.New("provider: directory service is nil")

	// ErrGroupIDNil is returned when the groupID is nil.
	ErrGroupIDNil = errors.New("provider: group id is nil")

	// ErrGroupResultNil is returned when the group result is nil.
	ErrGroupResultNil = errors.New("provider: group result is nil")
)

Functions

This section is empty.

Types

type GoogleProviderService

type GoogleProviderService interface {
	ListUsers(ctx context.Context, query []string) ([]*admin.User, error)
	ListGroups(ctx context.Context, query []string) ([]*admin.Group, error)
	ListGroupMembers(ctx context.Context, groupID string, queries ...google.GetGroupMembersOption) ([]*admin.Member, error)
	GetUser(ctx context.Context, userID string) (*admin.User, error)
}

GoogleProviderService is the interface that wraps the Google Provider Service methods.

type IdentityProvider

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

IdentityProvider is the Identity Provider service that implements the core.IdentityProvider interface and consumes the pkg.google methods.

func NewIdentityProvider

func NewIdentityProvider(gps GoogleProviderService) (*IdentityProvider, error)

NewIdentityProvider returns a new instance of the Identity Provider service.

func (*IdentityProvider) GetGroupMembers

func (i *IdentityProvider) GetGroupMembers(ctx context.Context, groupID string) (*model.MembersResult, error)

GetGroupMembers returns a list of members from the Identity Provider API.

func (*IdentityProvider) GetGroups

func (i *IdentityProvider) GetGroups(ctx context.Context, filter []string) (*model.GroupsResult, error)

GetGroups returns a list of groups from the Identity Provider API.

The filter parameter is a list of strings that can be used to filter the groups according to the Identity Provider API.

This method checks the names of the groups and avoid the second, third, etc repetition of the same group name.

func (*IdentityProvider) GetGroupsMembers

GetGroupsMembers return the members of the groups

func (*IdentityProvider) GetUsers

func (i *IdentityProvider) GetUsers(ctx context.Context, filter []string) (*model.UsersResult, error)

GetUsers returns a list of users from the Identity Provider API.

The filter parameter is a list of strings that can be used to filter the users according to the Identity Provider API.

func (*IdentityProvider) GetUsersByGroupsMembers added in v0.0.4

func (i *IdentityProvider) GetUsersByGroupsMembers(ctx context.Context, gmr *model.GroupsMembersResult) (*model.UsersResult, error)

GetUsersByGroupsMembers returns a list of users from the Identity Provider API.

Jump to

Keyboard shortcuts

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