auth

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizationHeader = "Authorization"
	BearerType          = "bearer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfigOutput

type APIConfigOutput struct {
	Local bool `json:"bool"`
	OIDC  bool `json:"oidc"`
}

type APILoginInput

type APILoginInput struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type APILoginOutput

type APILoginOutput struct {
	Successful bool `json:"successful"`
}

type APIMeOutput

type APIMeOutput struct {
	Username      string `json:"username" required:"true"`
	Authenticated bool   `json:"authenticated" required:"true"`
}

type APIToken

type APIToken struct {
	Key      string `json:"key" required:"true"`
	Username string `json:"username" required:"true"`
}

type APITokensDeleteInput

type APITokensDeleteInput struct {
	Key string `query:"key" required:"true"`
}

type APITokensGetOutput

type APITokensGetOutput struct {
	Tokens []APIToken `json:"tokens" required:"true"`
}

type APITokensPutInput

type APITokensPutInput struct {
	Username string `query:"username" required:"true"`
}

type APITokensPutOutput

type APITokensPutOutput struct {
	Key string `json:"key" required:"true"`
}

type APIUser

type APIUser struct {
	Username string `json:"username" required:"true"`
}

type APIUsersDeleteInput

type APIUsersDeleteInput struct {
	Username string `query:"username" required:"true"`
}

type APIUsersGetInput added in v0.4.6

type APIUsersGetInput struct {
	Username string `query:"username" description:"Optional username of a user to get"`
}

type APIUsersGetOutput

type APIUsersGetOutput struct {
	Users []APIUser `json:"users" required:"true"`
}

type APIUsersPutInput

type APIUsersPutInput struct {
	Username string `query:"username" required:"true"`

	Password string `json:"password" required:"true"`
}

type AuthProvider

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

func NewAuthProvider

func NewAuthProvider(r roles.Role, inst roles.Instance) *AuthProvider

func (*AuthProvider) APIConfig

func (ap *AuthProvider) APIConfig() usecase.Interactor

func (*AuthProvider) APILogin

func (ap *AuthProvider) APILogin() usecase.Interactor

func (*AuthProvider) APILogout

func (ap *AuthProvider) APILogout(w http.ResponseWriter, r *http.Request)

func (*AuthProvider) APIMe

func (ap *AuthProvider) APIMe() usecase.Interactor

func (*AuthProvider) APITokensDelete

func (ap *AuthProvider) APITokensDelete() usecase.Interactor

func (*AuthProvider) APITokensGet

func (ap *AuthProvider) APITokensGet() usecase.Interactor

func (*AuthProvider) APITokensPut

func (ap *AuthProvider) APITokensPut() usecase.Interactor

func (*AuthProvider) APIUsersDelete

func (ap *AuthProvider) APIUsersDelete() usecase.Interactor

func (*AuthProvider) APIUsersGet

func (ap *AuthProvider) APIUsersGet() usecase.Interactor

func (*AuthProvider) APIUsersPut

func (ap *AuthProvider) APIUsersPut() usecase.Interactor

func (*AuthProvider) AsMiddleware

func (ap *AuthProvider) AsMiddleware() func(http.Handler) http.Handler

func (*AuthProvider) ConfigureOpenIDConnect

func (ap *AuthProvider) ConfigureOpenIDConnect(ctx context.Context, config *types.OIDCConfig) error

func (*AuthProvider) CreateUser

func (ap *AuthProvider) CreateUser(ctx context.Context, username, password string) error

func (*AuthProvider) FirstStart

func (ap *AuthProvider) FirstStart(ev *roles.Event)

func (*AuthProvider) ServeHTTP

func (ap *AuthProvider) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type Token

type Token struct {
	Key string `json:"-"`

	Username string `json:"username"`
	// contains filtered or unexported fields
}

type User

type User struct {
	Username string `json:"-"`
	Password string `json:"password"`
	// contains filtered or unexported fields
}

func (*User) String

func (u *User) String() string

Jump to

Keyboard shortcuts

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