auth

package
v0.0.0-...-91de99a Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2013 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SESSION_KEY = "BasicAuthSessionId"
)

Variables

View Source
var SessionAuthenticationFilter = func(c *revel.Controller, fc []revel.Filter) {
	SessionId = c.Session.Id()

	fc[0](c, fc[1:])
}

The actual filter added to the resource. It checks for valid session information and redirects the response to create a new session if it is not available or valid.

View Source
var (
	SessionId string
)

Functions

func Apply

func Apply(m []AuthenticatedResource)

Apply is run by the developer in the init.go file for his/her project. It loops over the slice for all AuthenticatedResources the developer wishes to be protected with authentication.

func CheckSession

func CheckSession(c *revel.Controller)

CheckSession is called by SessionAuthenticationFilter to check for a valid session.

func InvalidateSession

func InvalidateSession()

func RegisterSession

func RegisterSession(c *revel.Controller, hash string, password string) error

func SetSession

func SetSession(c *revel.Controller)

func VerifySession

func VerifySession(sid string) bool

VerifySession checks stored session id against stored value

Types

type AuthenticatedResource

type AuthenticatedResource struct {
	Resource interface{}
	Role     string // TODO: allow role-based ACL config
}

defines resource that needs authentication

type Session

type Session struct {
	Id        string
	Data      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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