jws

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidAgentAddrErr = errors.New("invalid agent address")
	InvalidRequesterErr = errors.New("invalid requester")
	InvalidTokenErr     = errors.New("invalid token")
	TokenExpiredErr     = errors.New("token expired")
)
View Source
var EXPIRATION_EPOCH_BUFFER = big.NewInt(5)

signatures last approx 2.5 minutes

Functions

func SignJWS

func SignJWS(ctx context.Context, agentAddr common.Address, target address.Address, value *big.Int, method constants.Method, key *ecdsa.PrivateKey, query types.FEVMQueries) (string, error)

Types

type RequestClaims

type RequestClaims struct {
	jwt.MapClaims
	AgentAddr       common.Address
	RequesterPubKey []byte
	Target          address.Address
	Value           *big.Int
	Method          constants.Method
	EpochHeight     *big.Int
}

func VerifyJWS

func VerifyJWS(ctx context.Context, jws string, query types.FEVMQueries, useStrVal bool) (*RequestClaims, error)

useStrVal is a boolean that informs the jwt parser to use a specific version of the claims type

Jump to

Keyboard shortcuts

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