auth

package
v0.0.0-...-fce09a9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthDomain = "opensea.io"
	AuthURI    = "https://opensea.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// TODO: all in-memory state for now
	AuthState map[string]*common.Address
}

Service holds state for the auth.Service.

func (*Service) Authenticate

func (s *Service) Authenticate(_ context.Context, _ *connect.Request[v1.Empty]) (
	*connect.Response[v1.H160], error,
)

Authenticate checks if a given connection is authenticated, and returns the address which is authenticated for the nonce cookie.

func (*Service) Nonce

func (s *Service) Nonce(_ context.Context, _ *connect.Request[v1.Empty]) (
	*connect.Response[v1.NonceResponse], error,
)

Nonce returns an EIP-4361 nonce for session and invalidates existing session.

func (*Service) Verify

func (s *Service) Verify(_ context.Context, req *connect.Request[v1.VerifyRequest]) (
	*connect.Response[v1.H160], error,
)

Verify verifies the SignedMessage is valid and returns the verified address

Jump to

Keyboard shortcuts

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