store

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package store provides SCIM Store implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BaseURL is the base URL for SCIM resources.
	BaseURL string

	// DefaultRole is the default role for new group members.
	DefaultRole string
}

Config holds configuration for the Ent store.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default store configuration.

type EntStore

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

EntStore implements the scim.Store interface using Ent ORM.

func NewEntStore

func NewEntStore(client *ent.Client, config *Config) *EntStore

NewEntStore creates a new Ent-backed SCIM store.

func (*EntStore) AddMemberToGroup

func (s *EntStore) AddMemberToGroup(ctx context.Context, groupID, userID string) error

AddMemberToGroup adds a user to a group.

func (*EntStore) CreateGroup

func (s *EntStore) CreateGroup(ctx context.Context, scimGroup *scim.Group) (*scim.Group, error)

CreateGroup creates a new group.

func (*EntStore) CreateUser

func (s *EntStore) CreateUser(ctx context.Context, scimUser *scim.User) (*scim.User, error)

CreateUser creates a new user.

func (*EntStore) DeleteGroup

func (s *EntStore) DeleteGroup(ctx context.Context, id string) error

DeleteGroup deletes a group.

func (*EntStore) DeleteUser

func (s *EntStore) DeleteUser(ctx context.Context, id string) error

DeleteUser deletes a user.

func (*EntStore) GetGroupByDisplayName

func (s *EntStore) GetGroupByDisplayName(ctx context.Context, displayName string) (*scim.Group, error)

GetGroupByDisplayName retrieves a group by displayName.

func (*EntStore) GetGroupByExternalID

func (s *EntStore) GetGroupByExternalID(ctx context.Context, externalID string) (*scim.Group, error)

GetGroupByExternalID retrieves a group by externalId.

func (*EntStore) GetGroupByID

func (s *EntStore) GetGroupByID(ctx context.Context, id string) (*scim.Group, error)

GetGroupByID retrieves a group by SCIM ID.

func (*EntStore) GetGroupsForUser

func (s *EntStore) GetGroupsForUser(ctx context.Context, userID string) ([]scim.GroupRef, error)

GetGroupsForUser returns all groups a user belongs to.

func (*EntStore) GetMembersForGroup

func (s *EntStore) GetMembersForGroup(ctx context.Context, groupID string) ([]scim.MemberRef, error)

GetMembersForGroup returns all members of a group.

func (*EntStore) GetUserByExternalID

func (s *EntStore) GetUserByExternalID(ctx context.Context, externalID string) (*scim.User, error)

GetUserByExternalID retrieves a user by externalId. Since CoreForge doesn't have an externalId field, we return not found.

func (*EntStore) GetUserByID

func (s *EntStore) GetUserByID(ctx context.Context, id string) (*scim.User, error)

GetUserByID retrieves a user by SCIM ID.

func (*EntStore) GetUserByUserName

func (s *EntStore) GetUserByUserName(ctx context.Context, userName string) (*scim.User, error)

GetUserByUserName retrieves a user by userName (email).

func (*EntStore) ListGroups

func (s *EntStore) ListGroups(ctx context.Context, opts scim.ListOptions) ([]*scim.Group, int, error)

ListGroups lists groups with filtering and pagination.

func (*EntStore) ListUsers

func (s *EntStore) ListUsers(ctx context.Context, opts scim.ListOptions) ([]*scim.User, int, error)

ListUsers lists users with filtering and pagination.

func (*EntStore) RemoveMemberFromGroup

func (s *EntStore) RemoveMemberFromGroup(ctx context.Context, groupID, userID string) error

RemoveMemberFromGroup removes a user from a group.

func (*EntStore) UpdateGroup

func (s *EntStore) UpdateGroup(ctx context.Context, id string, scimGroup *scim.Group) (*scim.Group, error)

UpdateGroup updates an existing group.

func (*EntStore) UpdateUser

func (s *EntStore) UpdateUser(ctx context.Context, id string, scimUser *scim.User) (*scim.User, error)

UpdateUser updates an existing user.

Jump to

Keyboard shortcuts

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