authprovider

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Internal = iota
	External
)
View Source
const (
	CurrentUser = "me"
)

Variables

This section is empty.

Functions

func RegisterAuthProvider

func RegisterAuthProvider(name string, factory ProvidersFactory)

RegisterPlugin registers a plugin by name. This is expected to happen during app startup.

Types

type AuthInterface

type AuthInterface interface {
	Login(rw http.ResponseWriter, req *http.Request, username string, password string) error
	Logout(rw http.ResponseWriter, req *http.Request) error
	Authorize(rw http.ResponseWriter, req *http.Request) error
	AuthorizeRole(rw http.ResponseWriter, req *http.Request, role string) error
	AddUser(user models.User, password string) error
	UpdateUser(username string, m map[string]interface{}, u string) error
	GetUser(username string, req *http.Request) (models.User, error)
	ListUsers() ([]models.User, error)
	DeleteUser(username string) error
	ListExternalUsers(searchstr string, page, no int) (models.ExternalUsers, error)
	SetDirectory(directory models.Directory) error
	GetDirectory() (models.Directory, error)
}

func GetAuthProvider

func GetAuthProvider(name string, config io.Reader) (AuthInterface, error)

func InitAuthProvider

func InitAuthProvider(name string, configFilePath string) (AuthInterface, error)

InitPlugin creates an instance of the named plugin.

type Plugin

type Plugin struct {
	Name       string
	AuthPlugin AuthInterface
}

type ProvidersFactory

type ProvidersFactory func(config io.Reader) (AuthInterface, error)

Directories

Path Synopsis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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