traefik_github_oauth_server

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiSecretKeyMiddleware

func NewApiSecretKeyMiddleware(apiSecretKey string) gin.HandlerFunc

NewApiSecretKeyMiddleware returns a middleware that checks the api secret key.

func NewLoggerMiddleware added in v0.2.0

func NewLoggerMiddleware(logger *zerolog.Logger) gin.HandlerFunc

NewLoggerMiddleware returns a middleware that logs the request.

Types

type App

type App struct {
	Config             *Config
	Server             *http.Server
	Engine             *gin.Engine
	GitHubOAuthConfig  *oauth2.Config
	AuthRequestManager *AuthRequestManager
	Logger             *zerolog.Logger
}

App the Traefik GitHub OAuth server application.

func NewApp

func NewApp(
	config *Config,
	server *http.Server,
	engine *gin.Engine,
	authRequestManager *AuthRequestManager,
	logger *zerolog.Logger,
) *App

func NewDefaultApp

func NewDefaultApp() *App

func (*App) Run

func (app *App) Run()

type AuthRequestManager

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

func NewAuthRequestManager

func NewAuthRequestManager(cache *cache.Cache) *AuthRequestManager

func (*AuthRequestManager) Get

func (*AuthRequestManager) Insert

func (m *AuthRequestManager) Insert(aq *model.AuthRequest) string

func (*AuthRequestManager) Pop

type Config

type Config struct {
	ApiBaseURL              string
	ApiSecretKey            string
	ServerAddress           string
	DebugMode               bool
	LogLevel                string
	GitHubOAuthClientID     string
	GitHubOAuthClientSecret string
}

func NewConfigFromEnv

func NewConfigFromEnv() *Config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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