Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(cfg *Config) gin.HandlerFunc
AuthMiddleware creates a Gin middleware for JWT authentication
Types ¶
type Config ¶
type Config struct {
Port int // HTTP server port
JWTSecret string // JWT secret for token validation
UserToken string // User token from main service (legacy auth)
DBPath string // SQLite database path for remote-coder
SessionTimeout time.Duration // Session timeout duration
MessageRetention time.Duration // How long to retain messages
RateLimitMax int // Max auth attempts before block
RateLimitWindow time.Duration // Time window for rate limiting
RateLimitBlock time.Duration // Block duration after exceeding limit
// contains filtered or unexported fields
}
Config holds the configuration for remote-coder service Remote-coder specific configuration only - AgentBoot config is loaded directly by agentboot
func LoadFromAppConfig ¶
func LoadFromAppConfig(appCfg *serverconfig.Config, opts Options) (*Config, error)
LoadFromAppConfig builds remote-coder config from the main app config with env/override support.
func (*Config) GenerateToken ¶
GenerateToken generates a new API token for a client
func (*Config) NewRateLimiter ¶
func (cfg *Config) NewRateLimiter() *middleware.RateLimiter
NewRateLimiter creates a rate limiter from config
type ConfigError ¶
ConfigError represents a configuration error
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
Click to show internal directories.
Click to hide internal directories.