auth

package module
v0.0.0-...-953cc36 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: NCSA Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config = &authConfig{
		done: make(chan struct{}),
	}
)

Config ...

View Source
var (
	DefaultProfilePath string
)

DefaultProfilePath ...

Functions

This section is empty.

Types

type Profile

type Profile interface {
	// Create a profile using the provider specified
	Create() error
	// Delete a profile
	Delete() error
	// Information on the profile
	Info() ProfileBase
	// Verify the profile by looking
	// at the provider and checking if the
	// credentials match
	Verify() (bool, error)
	// Profile options
	Options() ProfileOptions
	// Get the role of the user
	// roles are essentially permission
	// groups
	GetRole() (acl.Role, error)
	// Find a profile by an email. The
	// profile is found by querying the
	// profile provier
	FindByEmail() error
}

Profiles are in effect users for rai each user has a profile that's backed by a profile provider

type ProfileBase

type ProfileBase struct {
	ProfileOptions `json:"-" bson:",inline" toml:"profile" yaml:"profile"`
}

ProfileBase ...

func NewProfileBase

func NewProfileBase(iopts ...ProfileOption) (*ProfileBase, error)

NewProfileBase ...

func (*ProfileBase) Info

func (p *ProfileBase) Info() ProfileBase

Info ...

func (*ProfileBase) Options

func (p *ProfileBase) Options() ProfileOptions

Options ...

func (ProfileBase) String

func (p ProfileBase) String() string

String ...

type ProfileOption

type ProfileOption func(*ProfileOptions)

ProfileOption ...

func AccessKey

func AccessKey(s string) ProfileOption

AccessKey ...

func Affiliation

func Affiliation(s string) ProfileOption

Affiliation ...

func AppSecret

func AppSecret(s string) ProfileOption

AppSecret ...

func Email

func Email(s string) ProfileOption

Email ...

func Firstname

func Firstname(s string) ProfileOption

Firstname ...

func Lastname

func Lastname(s string) ProfileOption

Lastname ...

func Password

func Password(s string) ProfileOption

Password ...

func ProfilePath

func ProfilePath(s string) ProfileOption

ProfilePath ...

func Role

func Role(s acl.Role) ProfileOption

Role ...

func SecretKey

func SecretKey(s string) ProfileOption

SecretKey ...

func TeamName

func TeamName(s string) ProfileOption

TeamName ...

func Username

func Username(s string) ProfileOption

Username ...

type ProfileOptions

type ProfileOptions struct {
	model.User  `toml:"" yaml:",inline" bson:",inline"`
	ProfilePath string          `json:"-" yaml:"-" toml:"-"`
	AppSecret   string          `json:"-" yaml:"-" toml:"-"`
	Context     context.Context `json:"-" yaml:"-" toml:"-"`
}

ProfileOptions ...

type Provider

type Provider string
const (
	Auth0Provider    Provider = "auth0"
	DatabaseProvider Provider = "database"
	SecretProvider   Provider = "secret"
)

Providers

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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