server

package
v0.260224.1130 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUserID is the default user ID for single-user deployments
	DefaultUserID = "default"
)

Variables

This section is empty.

Functions

func LoadProviderConfigs

func LoadProviderConfigs(registry *oauth.Registry, configs []ProviderConfigInput)

LoadProviderConfigs loads provider configurations from a list

func MarshalProviderConfigs

func MarshalProviderConfigs(registry *oauth.Registry) ([]byte, error)

MarshalProviderConfigs marshals provider configs for storage (without secrets)

Types

type ConfigHandler

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

ConfigHandler handles OAuth configuration updates

func NewConfigHandler

func NewConfigHandler(manager *oauth.Manager, registry *oauth.Registry) *ConfigHandler

NewConfigHandler creates a new OAuth configuration handler

func (*ConfigHandler) DeleteProvider

func (h *ConfigHandler) DeleteProvider(c *gin.Context)

DeleteProvider removes an OAuth provider configuration DELETE /api/v1/oauth/providers/:type

func (*ConfigHandler) GetProvider

func (h *ConfigHandler) GetProvider(c *gin.Context)

GetProvider returns a specific OAuth provider configuration GET /api/v1/oauth/providers/:type

func (*ConfigHandler) ListProviders

func (h *ConfigHandler) ListProviders(c *gin.Context)

ListProviders returns all registered OAuth providers GET /api/v1/oauth/providers

func (*ConfigHandler) RegisterConfigRoutes

func (h *ConfigHandler) RegisterConfigRoutes(r *gin.Engine)

RegisterConfigRoutes registers OAuth configuration routes

func (*ConfigHandler) UpdateProvider

func (h *ConfigHandler) UpdateProvider(c *gin.Context)

UpdateProvider updates an OAuth provider configuration PUT /api/v1/oauth/providers/:type

type Handler

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

Handler provides HTTP handlers for OAuth endpoints

func NewHandler

func NewHandler(manager *oauth.Manager) *Handler

NewHandler creates a new OAuth HTTP handler

func (*Handler) Authorize

func (h *Handler) Authorize(c *gin.Context)

Authorize initiates the OAuth flow by redirecting to the provider's auth URL GET /oauth/authorize?provider=anthropic&user_id=xxx&redirect_to=xxx&name=xxx

func (*Handler) Callback

func (h *Handler) Callback(c *gin.Context)

Callback handles the OAuth callback from the provider GET /oauth/callback?code=xxx&state=xxx&proxy_url=xxx

func (*Handler) GetToken

func (h *Handler) GetToken(c *gin.Context)

GetToken returns the OAuth token for a user and provider GET /oauth/token?provider=anthropic&user_id=xxx&proxy_url=xxx

func (*Handler) ListProviders

func (h *Handler) ListProviders(c *gin.Context)

ListProviders returns all available OAuth providers GET /oauth/providers

func (*Handler) ListTokens

func (h *Handler) ListTokens(c *gin.Context)

ListTokens returns all tokens for a user GET /oauth/tokens?user_id=xxx

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(r *gin.Engine)

RegisterRoutes registers OAuth routes with a Gin router group

func (*Handler) RevokeToken

func (h *Handler) RevokeToken(c *gin.Context)

RevokeToken removes the OAuth token for a user and provider DELETE /oauth/token?provider=anthropic&user_id=xxx

type ProviderConfigInput

type ProviderConfigInput struct {
	ProviderType oauth.ProviderType `json:"provider_type" yaml:"provider_type"`
	ClientID     string             `json:"client_id" yaml:"client_id"`
	ClientSecret string             `json:"client_secret" yaml:"client_secret"`
	RedirectURL  string             `json:"redirect_url,omitempty" yaml:"redirect_url,omitempty"`
}

ProviderConfigInput represents provider configuration from environment or file

Jump to

Keyboard shortcuts

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