auth

package module
v0.0.0-...-3f96c83 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2014 License: MIT Imports: 8 Imported by: 1

README

auth wercker status

Martini middleware/handler for http basic authentication.

API Reference

Usage

import (
  "github.com/go-martini/martini"
  "github.com/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 GitHub

func GitHub(secret string) http.HandlerFunc

GitHub returns a Handler that authenticates via GitHub's Authorization for Webhooks scheme (https://developer.github.com/webhooks/securing/#validating-payloads-from-github)

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.

func TravisCI

func TravisCI(token string) http.HandlerFunc

TravisCI returns a Handler that authenticates via Travis's Authorization for Webhooks scheme (http://docs.travis-ci.com/user/notifications/#Authorization-for-Webhooks)

Writes a http.StatusUnauthorized if authentication fails

Types

This section is empty.

Jump to

Keyboard shortcuts

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