Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEnvProxyMiddlewareWithParam ¶
func NewEnvProxyMiddlewareWithParam(localID, paramName string, resolver EnvResolver, envService *services.EnvironmentService, authValidator AuthValidator) gin.HandlerFunc
NewEnvProxyMiddlewareWithParam creates middleware that proxies requests to remote environments. - localID: the ID representing the local environment (requests to this ID are not proxied) - paramName: the URL parameter name containing the environment ID (e.g., "id") - resolver: function to resolve environment ID to connection details - envService: environment service for additional lookups - authValidator: function to validate authentication before proxying (required for security)
Types ¶
type ApiKeyValidator ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
func NewAuthMiddleware ¶
func NewAuthMiddleware(authService *services.AuthService, cfg *config.Config) *AuthMiddleware
func (*AuthMiddleware) Add ¶
func (m *AuthMiddleware) Add() gin.HandlerFunc
func (*AuthMiddleware) WithAdminNotRequired ¶
func (m *AuthMiddleware) WithAdminNotRequired() *AuthMiddleware
func (*AuthMiddleware) WithApiKeyValidator ¶
func (m *AuthMiddleware) WithApiKeyValidator(validator ApiKeyValidator) *AuthMiddleware
type AuthOptions ¶
type AuthValidator ¶
AuthValidator validates authentication for a request. Returns true if the request is authenticated, false otherwise.
type CORSMiddleware ¶
type CORSMiddleware struct {
// contains filtered or unexported fields
}
func NewCORSMiddleware ¶
func NewCORSMiddleware(cfg *config.Config) *CORSMiddleware
func (*CORSMiddleware) Add ¶
func (m *CORSMiddleware) Add() gin.HandlerFunc
type EnvResolver ¶
EnvResolver resolves an environment ID to its connection details. Returns: apiURL, accessToken, enabled, error
type EnvironmentMiddleware ¶
type EnvironmentMiddleware struct {
// contains filtered or unexported fields
}
EnvironmentMiddleware proxies requests for remote environments to their respective agents.
func (*EnvironmentMiddleware) Handle ¶
func (m *EnvironmentMiddleware) Handle(c *gin.Context)
Handle is the main middleware handler.