auth

package
v0.0.0-...-c1d3742 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2013 License: MIT Imports: 3 Imported by: 0

README

auth

Martini middleware/handler for http basic authentication.

API Reference

Usage

import (
  "github.com/codegangsta/martini"
  "github.com/codegangsta/martini-contrib/auth"
)

func main() {
  m := martini.Classic()
  // authenticate every request
  m.Use(auth.Basic("username", "secretpassword"))
  m.Run()
}

Authors

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basic

func Basic(username string, password string) http.HandlerFunc

Basic returns a Handler that authenticates via Basic Auth. Writes a http.StatusUnauthorized if authentication fails

func SecureCompare

func SecureCompare(given string, actual string) bool

SecureCompare performs a constant time compare of two strings to limit timing attacks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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