auth

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Secret string `json:"secret"`
}

Claim describes the claim for the token

func (Claim) Valid

func (c Claim) Valid() error

Valid shows if the claim is valid or not

type JWT

type JWT interface {
	Validate(token string) (*jwt.Token, *Claim)
}

JWT interface describes how token validation looks like

type JWTProvider

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

JWTProvider implements the validate method

func NewJWTProvider

func NewJWTProvider(settings config.Auth) (*JWTProvider, error)

NewJWTProvider returns a new pointer for the created provider

func (JWTProvider) Validate

func (jp JWTProvider) Validate(tokenString string) (*jwt.Token, *Claim)

Validate is for validating if the given token is authenticated

Jump to

Keyboard shortcuts

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