accounts

package
v0.0.0-...-ccabec2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleUsernameOnlyLogging

func HandleUsernameOnlyLogging(w http.ResponseWriter, r *http.Request) error

func UsernameOnlyLoggingForm

func UsernameOnlyLoggingForm(w http.ResponseWriter, r *http.Request) error

Types

type AMType

type AMType string
const (
	GAEAMType AMType = "GCP"
)
const UnixAMType AMType = "unix"
const (
	UsernameOnlyAMType AMType = "username-only"
)

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 LoggingData

type LoggingData struct {
	Username string
	Error    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
}

type UsernameOnlyAccountManager

type UsernameOnlyAccountManager struct{}

Implements the AccountManager interfaces for closed deployed cloud orchestrators. This AccountManager first gets the account information from HTTP cookies, and leverages the RFC 2617 HTTP Basic Authentication if the cookie does not present. Note that only username is used for both cases.

func NewUsernameOnlyAccountManager

func NewUsernameOnlyAccountManager() *UsernameOnlyAccountManager

func (*UsernameOnlyAccountManager) UserFromRequest

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

type UsernameOnlyUser

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

func (*UsernameOnlyUser) Email

func (u *UsernameOnlyUser) Email() string

func (*UsernameOnlyUser) Username

func (u *UsernameOnlyUser) Username() string

Jump to

Keyboard shortcuts

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