groupauth

package
v0.0.0-...-3ed2260 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserDirectory

type UserDirectory struct {
	// contains filtered or unexported fields
}

UserDirectory is for authorizing users against Google's Gsuite

func NewUserDirectory

func NewUserDirectory(authJSON []byte, adminUsername, domain string, authorizedGroups []string, redisHost string, duration time.Duration) (*UserDirectory, error)

NewUserDirectory returns a user directory

func (*UserDirectory) Authorize

func (d *UserDirectory) Authorize(userFunc func(context.Context) (string, bool)) middlewares.Middleware

Authorize is a middleware for authenticating handlers. It accepts a func that takes a context and provides a username

func (*UserDirectory) AuthorizeUser

func (d *UserDirectory) AuthorizeUser(user string) (bool, error)

AuthorizeUser checks the authorization for a given user

Jump to

Keyboard shortcuts

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