auth

package
v0.9.32 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package auth implements the basic auth for headers based on "https://github.com/abbot/go-http-auth".

How It Works

The filter accepts two parameters, the first mandatory one is the path to the htpasswd file usually used with Apache or nginx. The second one is the optional realm name that will be displayed in the browser. Each incoming request will be validated against the password file, for more information which formats are currently supported check "https://github.com/abbot/go-http-auth". Assuming you are going to use the MD5 version new entries can be generated like

htpasswd -nbm myName myPassword

Usage

basicAuth("/path/to/htpasswd")
basicAuth("/path/to/htpasswd", "My Website")

Index

Constants

View Source
const (
	Name                      = "basicAuth"
	ForceBasicAuthHeaderName  = "WWW-Authenticate"
	ForceBasicAuthHeaderValue = "Basic realm="
	DefaultRealmName          = "Basic Realm"
)

Variables

This section is empty.

Functions

func NewBasicAuth

func NewBasicAuth() *basicSpec

Types

This section is empty.

Jump to

Keyboard shortcuts

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