auth

package
v0.0.0-...-59b6e81 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizationHeader = "Authorization"
)

Variables

View Source
var (
	ErrForbidden = errors.New("forbidden")
)

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController(userRepository userRepo.UserRepository,
	authRepository authRepo.AuthRepository) Controller

func (Controller) DefaultLogin

func (ac Controller) DefaultLogin(w http.ResponseWriter, r *http.Request)

func (Controller) Logout

func (ac Controller) Logout(w http.ResponseWriter, r *http.Request)

func (Controller) Middleware

func (ac Controller) Middleware(next http.Handler) http.Handler

func (Controller) Revoke

func (ac Controller) Revoke(w http.ResponseWriter, r *http.Request)

func (Controller) SocialMediaCallback

func (ac Controller) SocialMediaCallback(w http.ResponseWriter, r *http.Request)

func (Controller) SocialMediaRedirect

func (ac Controller) SocialMediaRedirect(w http.ResponseWriter, r *http.Request)

type Kind

type Kind string
const (
	DefaultAuthKind Kind = "DefaultLogin"
	GithubAuthKind       = "Github"
)

type Request

type Request struct {
	Username string      `json:"username"`
	Password string      `json:"password"`
	Token    null.String `json:"token,omitempty"`
}

type Response

type Response struct {
	Token       string `json:"token"`
	RevokeToken string `json:"revoke_token"`
	AuthKind    Kind   `json:"auth_kind"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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