Documentation
¶
Index ¶
- Constants
- func LoadProviderConfigs(registry *oauth.Registry, configs []ProviderConfigInput)
- func MarshalProviderConfigs(registry *oauth.Registry) ([]byte, error)
- type ConfigHandler
- type Handler
- func (h *Handler) Authorize(c *gin.Context)
- func (h *Handler) Callback(c *gin.Context)
- func (h *Handler) GetToken(c *gin.Context)
- func (h *Handler) ListProviders(c *gin.Context)
- func (h *Handler) ListTokens(c *gin.Context)
- func (h *Handler) RegisterRoutes(r *gin.Engine)
- func (h *Handler) RevokeToken(c *gin.Context)
- type ProviderConfigInput
Constants ¶
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
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 ¶
NewHandler creates a new OAuth HTTP handler
func (*Handler) Authorize ¶
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 ¶
Callback handles the OAuth callback from the provider GET /oauth/callback?code=xxx&state=xxx&proxy_url=xxx
func (*Handler) GetToken ¶
GetToken returns the OAuth token for a user and provider GET /oauth/token?provider=anthropic&user_id=xxx&proxy_url=xxx
func (*Handler) ListProviders ¶
ListProviders returns all available OAuth providers GET /oauth/providers
func (*Handler) ListTokens ¶
ListTokens returns all tokens for a user GET /oauth/tokens?user_id=xxx
func (*Handler) RegisterRoutes ¶
RegisterRoutes registers OAuth routes with a Gin router group
func (*Handler) RevokeToken ¶
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