auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OffChainAuthSigExpiryAgeInSec int32 = 60 * 5 // in 300 seconds
)

Variables

This section is empty.

Functions

func Verify

func Verify(pk *PublicKey, signature, msg []byte) (bool, error)

Verify will Verify signature of a message with MiMC hash function

func VerifyEddsaSignature

func VerifyEddsaSignature(pubKey string, sig, message []byte) error

VerifyEddsaSignature EDDSA sig verification

Types

type AuthConfig

type AuthConfig struct {
	GRPCAddress       string
	SpDBConfig        *config.SQLDBConfig
	SpOperatorAddress string
}

AuthConfig is the auth service config

type AuthServer

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

AuthServer auth service

func NewAuthServer

func NewAuthServer(config *AuthConfig) (*AuthServer, error)

NewAuthServer return an instance of AuthServer

func (*AuthServer) GetAuthNonce

func (auth *AuthServer) GetAuthNonce(ctx context.Context, req *authtypes.GetAuthNonceRequest) (resp *authtypes.GetAuthNonceResponse, err error)

GetAuthNonce get the auth nonce for which the Dapp or client can generate EDDSA key pairs.

func (*AuthServer) Name

func (auth *AuthServer) Name() string

Name return the auth server name, for the lifecycle management

func (*AuthServer) Start

func (auth *AuthServer) Start(ctx context.Context) error

Start the auth gRPC service

func (*AuthServer) Stop

func (auth *AuthServer) Stop(ctx context.Context) error

Stop the auth gRPC service and recycle the resources

func (*AuthServer) UpdateUserPublicKey

UpdateUserPublicKey updates the user public key once the Dapp or client generates the EDDSA key pairs.

func (*AuthServer) VerifyOffChainSignature

VerifyOffChainSignature verifies the signature signed by user's EDDSA private key.

type PublicKey

type PublicKey = eddsa.PublicKey

func ParsePk

func ParsePk(pkStr string) (pk *PublicKey, err error)

ParsePk will parse eddsa public key from string

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

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