auth

package
v0.0.0-...-b13ab0d Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Gorilla Sessions backend for MySQL.

Copyright (c) 2013 Contributors. See the list of contributors in the CONTRIBUTORS file for details.

This software is licensed under a MIT style license available in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	CNPattern  = regexp.MustCompile(`CN=([^,]+)\,OU=DLM\sDistribution\sGroups`)
	AccountKey = "account"
	MLKey      = "ml"
)
View Source
var SessionStore, _ = NewMySQLStore(config.SC.DBEndpoint, "user_session", "/", 31536000, []byte(config.SC.DBConf.Keypairs))

Functions

This section is empty.

Types

type AuthResult

type AuthResult struct {
	ML []string
}

func Auth

func Auth(username, password string) (*AuthResult, error)

type MySQLStore

type MySQLStore struct {
	Codecs  []securecookie.Codec
	Options *sessions.Options
	// contains filtered or unexported fields
}

func NewMySQLStore

func NewMySQLStore(endpoint string, tableName string, path string, maxAge int, keyPairs ...[]byte) (*MySQLStore, error)

func NewMySQLStoreFromConnection

func NewMySQLStoreFromConnection(db *sql.DB, tableName string, path string, maxAge int, keyPairs ...[]byte) (*MySQLStore, error)

func (*MySQLStore) Close

func (m *MySQLStore) Close()

func (*MySQLStore) Delete

func (m *MySQLStore) Delete(r *http.Request, w http.ResponseWriter, session *sessions.Session) error

func (*MySQLStore) Get

func (m *MySQLStore) Get(r *http.Request, name string) (*sessions.Session, error)

func (*MySQLStore) New

func (m *MySQLStore) New(r *http.Request, name string) (*sessions.Session, error)

func (*MySQLStore) Save

func (m *MySQLStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error

Jump to

Keyboard shortcuts

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