handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionUserID   = "user_id"
	SessionUsername = "username"
)
View Source
const (
	GrantTypeDeviceCode = "urn:ietf:params:oauth:grant-type:device_code"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

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

func NewAuthHandler

func NewAuthHandler(us *services.UserService) *AuthHandler

func (*AuthHandler) Login

func (h *AuthHandler) Login(c *gin.Context)

Login handles the login form submission

func (*AuthHandler) LoginPage

func (h *AuthHandler) LoginPage(c *gin.Context)

LoginPage renders the login page

func (*AuthHandler) Logout

func (h *AuthHandler) Logout(c *gin.Context)

Logout clears the session and redirects to login

type DeviceHandler

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

func NewDeviceHandler

func NewDeviceHandler(ds *services.DeviceService, cfg *config.Config) *DeviceHandler

func (*DeviceHandler) DeviceCodeRequest

func (h *DeviceHandler) DeviceCodeRequest(c *gin.Context)

DeviceCodeRequest handles POST /oauth/device/code This is called by the CLI to start the device flow

func (*DeviceHandler) DevicePage

func (h *DeviceHandler) DevicePage(c *gin.Context)

DevicePage renders the device code input page

func (*DeviceHandler) DeviceVerify

func (h *DeviceHandler) DeviceVerify(c *gin.Context)

DeviceVerify handles the user code verification and authorization

type TokenHandler

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

func NewTokenHandler

func NewTokenHandler(ts *services.TokenService, cfg *config.Config) *TokenHandler

func (*TokenHandler) Token

func (h *TokenHandler) Token(c *gin.Context)

Token handles POST /oauth/token This is called by the CLI to poll for the access token

func (*TokenHandler) TokenInfo

func (h *TokenHandler) TokenInfo(c *gin.Context)

TokenInfo handles GET /oauth/tokeninfo (optional endpoint to validate tokens)

Jump to

Keyboard shortcuts

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