credentials

package
v0.0.0-...-e2c280a Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package credentials defines a Checker to hold and validate credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker keeps track and validates credentials.

func NewChecker

func NewChecker() Checker

NewChecker returns a new Checker.

func (*Checker) AddCreds

func (c *Checker) AddCreds(creds map[string]string)

AddCreds adds username/password pairs to credentials.

func (*Checker) AddGroups

func (c *Checker) AddGroups(groups map[string][]string)

AddGroups adds username/groups mapping.

func (*Checker) Check

func (c *Checker) Check(form interface{}) bool

Check validates credentials.

func (*Checker) LoadCreds

func (c *Checker) LoadCreds(csvFile string) error

LoadCreds loads credentials from a CSV file.

func (*Checker) UserInGroups

func (c *Checker) UserInGroups(user string, groups []string) bool

UserInGroups checks if a user belongs to any of the specified groups.

Jump to

Keyboard shortcuts

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