accounts

package
v0.0.0-...-8b5928e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMType

type AMType string
const (
	GAEAMType AMType = "GCP"
)
const HTTPBasicAMType AMType = "http-basic"
const UnixAMType AMType = "unix"

type Config

type Config struct {
	Type   AMType
	OAuth2 appOAuth2.OAuth2Config
}

type GAEUser

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

func (*GAEUser) Email

func (u *GAEUser) Email() string

func (*GAEUser) Username

func (u *GAEUser) Username() string

type GAEUsersAccountManager

type GAEUsersAccountManager struct{}

func NewGAEUsersAccountManager

func NewGAEUsersAccountManager() *GAEUsersAccountManager

func (*GAEUsersAccountManager) UserFromRequest

func (g *GAEUsersAccountManager) UserFromRequest(r *http.Request) (User, error)

type HTTPBasicAccountManager

type HTTPBasicAccountManager struct{}

Implements the AccountManager interfaces using the RFC 2617 HTTP Basic Authentication, where the user-ID and password are provided in the HTTP request header.

func NewHTTPBasicAccountManager

func NewHTTPBasicAccountManager() *HTTPBasicAccountManager

func (*HTTPBasicAccountManager) UserFromRequest

func (m *HTTPBasicAccountManager) UserFromRequest(r *http.Request) (User, error)

type HTTPBasicUser

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

func (*HTTPBasicUser) Email

func (u *HTTPBasicUser) Email() string

func (*HTTPBasicUser) Username

func (u *HTTPBasicUser) Username() string

type Manager

type Manager interface {
	// Gets the user from the http request, typically from a cookie or another header.
	UserFromRequest(r *http.Request) (User, error)
}

type UnixAccountManager

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

Implements the Manager interface taking the username from the environment and authorizing all requests

func NewUnixAccountManager

func NewUnixAccountManager() *UnixAccountManager

func (*UnixAccountManager) UserFromRequest

func (m *UnixAccountManager) UserFromRequest(r *http.Request) (User, error)

type UnixUser

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

func (*UnixUser) Email

func (i *UnixUser) Email() string

func (*UnixUser) Username

func (i *UnixUser) Username() string

type User

type User interface {
	Username() string

	Email() string
}

Jump to

Keyboard shortcuts

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