Help us shape the future of Go! Take the 2026 Go Developer Survey

wso2jwt

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: Apache-2.0 Imports: 10 Imported by: 6

README

wso2jwt

CircleCI Codecov Apache 2 License

Validating JWT tokens with BYU's implementation of WSO2 isn't the easiest thing on the planet. We wanted to make sure that we protected every route with a JWT check and, as part of that check, pull in the latest signing key.

Dependencies

Installation

go get github.com/byuoitav/wso2jwt

Usage

import "github.com/byuoitav/wso2jwt"
func main() {
  port := ":8000"
  router := echo.New()
  router.Use(wso2jwt.ValidateJWT())

  router.Run(fasthttp.New(port))
}

Local Development

The WSO2 JWT checking "pipeline" will not work from your local box. To enable local development without headaches, be sure to set the LOCAL_ENVIRONMENT variable in you shell environment.

Example (using /etc/environment):

export LOCAL_ENVIRONMENT="true"

Notes

If you're not interested in protecting every single route (putting /health behind authentication just seems silly), you can use Echo Groups instead of router.Use():

router.Group("/command", wso2jwt.ValidateJWT())

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateJWT

func ValidateJWT() echo.MiddlewareFunc

ValidateJWT is the middleware function

Types

This section is empty.

Jump to

Keyboard shortcuts

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