authmiddleware

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: Apache-2.0 Imports: 12 Imported by: 5

README

authmiddleware

CircleCI 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.

Installation

go get github.com/byuoitav/authmiddleware

Example Usage

import "github.com/byuoitav/authmiddleware"
func main() {
	router := echo.New()
	router.Use(echo.WrapMiddleware(authmiddleware.ValidateJWT))

	router.Start()
}

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"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate added in v1.1.2

func Authenticate(next http.Handler) http.Handler

Authenticate is the generalized middleware function No CAS check for non-user access

func AuthenticateUser added in v1.1.2

func AuthenticateUser(next http.Handler) http.Handler

AuthenticateUser is the middleware function for user access.

func MachineChecks added in v1.1.2

func MachineChecks(request *http.Request, user bool) (bool, error)

MachineChecks is a boolean function for the standard automated checks that need to pass for any request.

func PassActiveDirectory added in v1.1.2

func PassActiveDirectory(user string, control []string) bool

PassActiveDirectory is the check for a user's Active Directory groups against some control groups to allow access based on the needs for the request.

Types

This section is empty.

Directories

Path Synopsis
helpers

Jump to

Keyboard shortcuts

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