userprofile

package
v0.0.0-...-3b7a03e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotFound = errors.New("user not found")

ErrUserNotFound is returned when the requested user has no identity mapping.

Functions

This section is empty.

Types

type DeleteUserHandle

type DeleteUserHandle interface {
	// Execute removes the external identity (e.g. Ory). It must be called
	// only after the caller has already deleted the database rows.
	Execute(ctx context.Context) error
}

DeleteUserHandle holds pre-fetched state needed to finalise user deletion after the database rows have been removed.

type Mode

type Mode string
const (
	ModeSupabase Mode = "supabase"
	ModeOry      Mode = "ory"
)

func ParseMode

func ParseMode(value string) (Mode, error)

func (Mode) RequiresOry

func (m Mode) RequiresOry() bool

type OryConfig

type OryConfig struct {
	HTTPClient *http.Client
	SDKURL     string
	Token      string
	Issuer     string
	Resolver   identityResolver
}

type Profile

type Profile struct {
	UserID            uuid.UUID
	Email             string
	Name              string
	ProfilePictureURL string
	Providers         []string
}

type Provider

type Provider interface {
	GetProfilesByUserID(ctx context.Context, userIDs []uuid.UUID) (map[uuid.UUID]Profile, error)
	FindProfilesByEmail(ctx context.Context, email string) ([]Profile, error)
	GetTeamCreatorContext(ctx context.Context, userID uuid.UUID) (*sharedteamprovision.CreatorContextV1, error)
	// PrepareDeleteUser resolves the external identity references for the
	// given user so they can be removed after the database rows are gone.
	PrepareDeleteUser(ctx context.Context, userID uuid.UUID) (DeleteUserHandle, error)
}

func NewOryProvider

func NewOryProvider(config OryConfig) (Provider, error)

func NewProvider

func NewProvider(mode Mode, supa Provider, ory Provider) (Provider, error)

func NewSupabaseProvider

func NewSupabaseProvider(db *supabasedb.Client) Provider

Jump to

Keyboard shortcuts

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