auth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2014 License: Apache-2.0, BSD-3-Clause, Zlib Imports: 2 Imported by: 1

Documentation

Overview

Package auth is a middleware handler for Lagann to authenticate users over the UUID they specified in the X-Lagann-Auth header.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	BasePath   string
	HeaderName string
	// contains filtered or unexported fields
}

Struct Auth is a negroni middleware for checking X-Lagann-Auth for the correct uuid

func NewAuth

func NewAuth(machine, path string) (*Auth, error)

NewAuth returns a new Auth instance and an error or nil based on the machine and the base path in etcd to look through. A sane default for Flitter is:

/flitter/lagann/apikeys/

func (*Auth) ServeHTTP

func (a *Auth) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

This middleware will set the X-Lagann-User to the correct value out of etcd based on the API key in X-Lagann-Auth.

Jump to

Keyboard shortcuts

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