siwe

package
v0.0.0-...-ef76644 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Store *Store
	Clock clock.Clock
	SIWE  SIWEService
}

func (*Provider) Create

func (p *Provider) Create(ctx context.Context, i *identity.SIWE) error

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, i *identity.SIWE) error

func (*Provider) Get

func (p *Provider) Get(ctx context.Context, userID, id string) (*identity.SIWE, error)

func (*Provider) GetByMessage

func (p *Provider) GetByMessage(ctx context.Context, msg string, signature string) (*identity.SIWE, error)

func (*Provider) GetMany

func (p *Provider) GetMany(ctx context.Context, ids []string) ([]*identity.SIWE, error)

func (*Provider) List

func (p *Provider) List(ctx context.Context, userID string) ([]*identity.SIWE, error)

func (*Provider) New

func (p *Provider) New(
	ctx context.Context,
	userID string,
	msg string,
	signature string,
) (*identity.SIWE, error)

type SIWEService

type SIWEService interface {
	VerifyMessage(ctx context.Context, msg string, signature string) (*model.SIWEWallet, *ecdsa.PublicKey, error)
}

nolint: golint

type Store

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

func (*Store) Create

func (s *Store) Create(ctx context.Context, i *identity.SIWE) error

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, i *identity.SIWE) error

func (*Store) Get

func (s *Store) Get(ctx context.Context, userID, id string) (*identity.SIWE, error)

func (*Store) GetByAddress

func (s *Store) GetByAddress(ctx context.Context, chainID int, address web3.EIP55) (*identity.SIWE, error)

func (*Store) GetMany

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

func (*Store) List

func (s *Store) List(ctx context.Context, userID string) ([]*identity.SIWE, error)

Jump to

Keyboard shortcuts

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