service

package
v0.0.0-...-ac88f99 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(Store), "*"),
	wire.Struct(new(Service), "*"),
)

Functions

This section is empty.

Types

type AnonymousIdentityProvider

type AnonymousIdentityProvider interface {
	New(userID string, keyID string, key []byte) *identity.Anonymous

	Get(ctx context.Context, userID, id string) (*identity.Anonymous, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.Anonymous, error)
	GetByKeyID(ctx context.Context, keyID string) (*identity.Anonymous, error)
	List(ctx context.Context, userID string) ([]*identity.Anonymous, error)
	Create(ctx context.Context, i *identity.Anonymous) error
	Delete(ctx context.Context, i *identity.Anonymous) error
}

type BiometricIdentityProvider

type BiometricIdentityProvider interface {
	New(userID string, keyID string, key []byte, deviceInfo map[string]interface{}) *identity.Biometric

	Get(ctx context.Context, userID, id string) (*identity.Biometric, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.Biometric, error)
	GetByKeyID(ctx context.Context, keyID string) (*identity.Biometric, error)
	List(ctx context.Context, userID string) ([]*identity.Biometric, error)
	Create(ctx context.Context, i *identity.Biometric) error
	Delete(ctx context.Context, i *identity.Biometric) error
}

type LDAPIdentityProvider

type LDAPIdentityProvider interface {
	New(
		userID string,
		serverName string,
		loginUserName *string,
		userIDAttributeName string,
		userIDAttributeValue []byte,
		claims map[string]interface{},
		rawEntryJSON map[string]interface{},
	) *identity.LDAP
	WithUpdate(iden *identity.LDAP, loginUserName *string, claims map[string]interface{}, rawEntryJSON map[string]interface{}) *identity.LDAP

	Get(ctx context.Context, userID, id string) (*identity.LDAP, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.LDAP, error)
	List(ctx context.Context, userID string) ([]*identity.LDAP, error)
	GetByServerUserID(ctx context.Context, serverName string, userIDAttributeName string, userIDAttributeValue []byte) (*identity.LDAP, error)
	ListByClaim(ctx context.Context, name string, value string) ([]*identity.LDAP, error)
	Create(ctx context.Context, i *identity.LDAP) error
	Update(ctx context.Context, i *identity.LDAP) error
	Delete(ctx context.Context, i *identity.LDAP) error
}

type LoginIDIdentityProvider

type LoginIDIdentityProvider interface {
	New(userID string, loginID identity.LoginIDSpec, options loginid.CheckerOptions) (*identity.LoginID, error)
	WithValue(iden *identity.LoginID, value string, options loginid.CheckerOptions) (*identity.LoginID, error)
	Normalize(typ model.LoginIDKeyType, value string) (normalized string, uniqueKey string, err error)

	Get(ctx context.Context, userID, id string) (*identity.LoginID, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.LoginID, error)
	List(ctx context.Context, userID string) ([]*identity.LoginID, error)
	GetByValue(ctx context.Context, loginIDValue string) ([]*identity.LoginID, error)
	GetByKeyAndValue(ctx context.Context, loginIDKey string, loginIDValue string) (*identity.LoginID, error)
	GetByUniqueKey(ctx context.Context, uniqueKey string) (*identity.LoginID, error)
	ListByClaim(ctx context.Context, name string, value string) ([]*identity.LoginID, error)
	Create(ctx context.Context, i *identity.LoginID) error
	Update(ctx context.Context, i *identity.LoginID) error
	Delete(ctx context.Context, i *identity.LoginID) error
}

type OAuthIdentityProvider

type OAuthIdentityProvider interface {
	New(
		userID string,
		providerID oauthrelyingparty.ProviderID,
		subjectID string,
		profile map[string]interface{},
		claims map[string]interface{},
	) *identity.OAuth
	WithUpdate(iden *identity.OAuth, rawProfile map[string]interface{}, claims map[string]interface{}) *identity.OAuth

	Get(ctx context.Context, userID, id string) (*identity.OAuth, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.OAuth, error)
	List(ctx context.Context, userID string) ([]*identity.OAuth, error)
	GetByProviderSubject(ctx context.Context, providerID oauthrelyingparty.ProviderID, subjectID string) (*identity.OAuth, error)
	GetByUserProvider(ctx context.Context, userID string, providerID oauthrelyingparty.ProviderID) (*identity.OAuth, error)
	ListByClaim(ctx context.Context, name string, value string) ([]*identity.OAuth, error)
	Create(ctx context.Context, i *identity.OAuth) error
	Update(ctx context.Context, i *identity.OAuth) error
	Delete(ctx context.Context, i *identity.OAuth) error
}

type PasskeyIdentityProvider

type PasskeyIdentityProvider interface {
	New(ctx context.Context, userID string, attestationResponse []byte) (*identity.Passkey, error)
	Get(ctx context.Context, userID, id string) (*identity.Passkey, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.Passkey, error)
	GetBySpec(ctx context.Context, spec *identity.PasskeySpec) (*identity.Passkey, error)
	List(ctx context.Context, userID string) ([]*identity.Passkey, error)
	Create(ctx context.Context, i *identity.Passkey) error
	Delete(ctx context.Context, i *identity.Passkey) error
}

type SIWEIdentityProvider

type SIWEIdentityProvider interface {
	New(ctx context.Context, userID string, msg string, signature string) (*identity.SIWE, error)

	Get(ctx context.Context, userID, id string) (*identity.SIWE, error)
	GetMany(ctx context.Context, ids []string) ([]*identity.SIWE, error)
	GetByMessage(ctx context.Context, msg string, signature string) (*identity.SIWE, error)
	List(ctx context.Context, userID string) ([]*identity.SIWE, error)
	Create(ctx context.Context, i *identity.SIWE) error
	Delete(ctx context.Context, i *identity.SIWE) error
}

type Service

func (*Service) AdminAPIGetByLoginIDKeyAndLoginIDValue

func (s *Service) AdminAPIGetByLoginIDKeyAndLoginIDValue(ctx context.Context, loginIDKey string, loginIDValue string) (*identity.Info, error)

func (*Service) AdminAPIGetByOAuthAliasAndSubject

func (s *Service) AdminAPIGetByOAuthAliasAndSubject(ctx context.Context, alias string, subjectID string) (*identity.Info, error)

func (*Service) CheckDuplicated

func (s *Service) CheckDuplicated(ctx context.Context, info *identity.Info) (dupeIdentity *identity.Info, err error)

func (*Service) CheckDuplicatedByUniqueKey

func (s *Service) CheckDuplicatedByUniqueKey(ctx context.Context, info *identity.Info) (dupeIdentity *identity.Info, err error)

func (*Service) Count

func (s *Service) Count(ctx context.Context, userID string) (uint64, error)

func (*Service) Create

func (s *Service) Create(ctx context.Context, info *identity.Info) error

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, info *identity.Info) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, id string) (*identity.Info, error)

func (*Service) GetMany

func (s *Service) GetMany(ctx context.Context, ids []string) ([]*identity.Info, error)

func (*Service) ListByClaim

func (s *Service) ListByClaim(ctx context.Context, name string, value string) ([]*identity.Info, error)

func (*Service) ListByUser

func (s *Service) ListByUser(ctx context.Context, userID string) ([]*identity.Info, error)

func (*Service) ListByUserIDs

func (s *Service) ListByUserIDs(ctx context.Context, userIDs []string) (map[string][]*identity.Info, error)

nolint:gocognit This method is actually simple

func (*Service) ListCandidates

func (s *Service) ListCandidates(ctx context.Context, userID string) (out []identity.Candidate, err error)

func (*Service) ListIdentitiesThatHaveStandardAttributes

func (s *Service) ListIdentitiesThatHaveStandardAttributes(ctx context.Context, userID string) ([]*identity.Info, error)

func (*Service) ListRefsByUsers

func (s *Service) ListRefsByUsers(ctx context.Context, userIDs []string, identityType *model.IdentityType) ([]*model.IdentityRef, error)

func (*Service) New

func (s *Service) New(ctx context.Context, userID string, spec *identity.Spec, options identity.NewIdentityOptions) (*identity.Info, error)

func (*Service) Normalize

func (s *Service) Normalize(ctx context.Context, typ model.LoginIDKeyType, value string) (normalized string, uniqueKey string, err error)

func (*Service) SearchBySpec

func (s *Service) SearchBySpec(ctx context.Context, spec *identity.Spec) (exactMatch *identity.Info, otherMatches []*identity.Info, err error)

SearchBySpec does not return api.ErrIdentityNotFound.

func (*Service) Update

func (s *Service) Update(ctx context.Context, info *identity.Info) error

func (*Service) UpdateWithSpec

func (s *Service) UpdateWithSpec(ctx context.Context, info *identity.Info, spec *identity.Spec, options identity.NewIdentityOptions) (*identity.Info, error)

type Store

type Store struct {
	SQLBuilder  *appdb.SQLBuilderApp
	SQLExecutor *appdb.SQLExecutor
}

func (*Store) Count

func (s *Store) Count(ctx context.Context, userID string) (uint64, error)

func (*Store) GetRefByID

func (s *Store) GetRefByID(ctx context.Context, id string) (*model.IdentityRef, error)

func (*Store) ListRefsByIDs

func (s *Store) ListRefsByIDs(ctx context.Context, ids []string) ([]*model.IdentityRef, error)

func (*Store) ListRefsByUsers

func (s *Store) ListRefsByUsers(ctx context.Context, userIDs []string, identityType *model.IdentityType) ([]*model.IdentityRef, error)

Jump to

Keyboard shortcuts

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