jwt

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClaimsInvalid = fmt.Errorf("claims invalid")
View Source
var ErrExpired = fmt.Errorf("token expired")
View Source
var ErrInvalid = fmt.Errorf("token invalid")
View Source
var ErrNoToken = fmt.Errorf("no token found")

Functions

func NewSession

func NewSession(sk libp2pc.PrivKey, pid peer.ID, proto protocol.ID, duration time.Duration, cafe *pb.Cafe) (*pb.CafeSession, error)

func Validate

func Validate(tokenString string, keyfunc jwt.Keyfunc, refreshing bool, audience string, subject *string) error

Types

type Scope

type Scope string
const (
	Access  Scope = "access"
	Refresh Scope = "refresh"
)

type SigningMethodEd25519

type SigningMethodEd25519 struct {
	Name string
}

Implements the Ed25519 signing method Expects *crypto.Ed25519PublicKey for signing and *crypto.Ed25519PublicKey for validation

var SigningMethodEd25519i *SigningMethodEd25519

Specific instance for Ed25519

func (*SigningMethodEd25519) Alg

func (m *SigningMethodEd25519) Alg() string

func (*SigningMethodEd25519) Sign

func (m *SigningMethodEd25519) Sign(signingString string, key interface{}) (string, error)

Implements the Sign method from SigningMethod For this signing method, must be a *crypto.Ed25519PublicKey structure.

func (*SigningMethodEd25519) Verify

func (m *SigningMethodEd25519) Verify(signingString, signature string, key interface{}) error

Implements the Verify method from SigningMethod For this signing method, must be a *crypto.Ed25519PublicKey structure.

type TextileClaims

type TextileClaims struct {
	Scope Scope `json:"scopes"`
	jwt.StandardClaims
}

func ParseClaims

func ParseClaims(claims jwt.Claims) (*TextileClaims, error)

Jump to

Keyboard shortcuts

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