jwt

package module
v0.0.0-...-b3a937a Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: MIT Imports: 6 Imported by: 0

README

jwt

jsonwebtoken-middleware for goa.

Build Status Codecov Go Doc Go Report

Installation

$ go get -u github.com/goa-go/jwt

Example

import (
  "github.com/goa-go/goa"
  "github.com/goa-go/jwt"
)

func main(){
  app = goa.New()
  app.Use(jwt.New(jwt.Options{
    Secret: "example-secret",
  }))

  ...
}

Options

Field Type Reqired Description
Secret interface{} true jwt secret
Unless []string false unless paths
GetToken func(*goa.Context) string false custom getToken function
Verify func(string, interface{}) bool false custom verify function

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ops Options) goa.Middleware

New returns a jwt middleware for goa.

Types

type Options

type Options struct {
	Secret   interface{}
	Unless   []string
	GetToken func(*goa.Context) string
	Verify   func(string, interface{}) bool
}

Options is used to declare options, use it by New(jwt.Options{...}).

Jump to

Keyboard shortcuts

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