auth

package
v0.0.0-...-3b9fef2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

type AuthHandler struct {
	Ctx          context.Context
	ConfigDir    string
	ListenAddr   string
	Oauth2Config *oauth2.Config
	HttpClient   *http.Client
	HttpServer   *http.Server
	HttpMux      *http.ServeMux
	AccessToken  string
	AuthDoneCh   chan struct{}
}

func NewAuthHandler

func NewAuthHandler(configDirectory string, opts OauthHandlerOptions) *AuthHandler

func (*AuthHandler) Authenticate

func (h *AuthHandler) Authenticate() (string, error)

func (*AuthHandler) CallbackHandler

func (h *AuthHandler) CallbackHandler(w http.ResponseWriter, r *http.Request)

func (*AuthHandler) GetAuthenticationURL

func (h *AuthHandler) GetAuthenticationURL() string

func (*AuthHandler) LoadAccessToken

func (h *AuthHandler) LoadAccessToken() (string, bool)

func (*AuthHandler) SaveAccessToken

func (h *AuthHandler) SaveAccessToken(token string) error

type AuthVendor

type AuthVendor int
const (
	Azure  AuthVendor = iota
	Google AuthVendor = iota
)

type OauthHandlerOptions

type OauthHandlerOptions struct {
	Vendor              AuthVendor
	TenantID            string
	ClientID            string
	SkipTLSVerification bool
}

func NewOauthHandlerOptions

func NewOauthHandlerOptions(vendor AuthVendor, tenantID string, clientID string) OauthHandlerOptions

Jump to

Keyboard shortcuts

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