Clean up codebase: remove unused demos and test files

- Remove dan-eden-portfolio and devigo-web demo sites
- Clean up demo testing infrastructure and scripts
- Remove frontend test files (html-preservation, style-detection tests)
- Update configuration and auth improvements
- Simplify demo structure to focus on core functionality

This cleanup reduces repository size and focuses on essential demos.
This commit is contained in:
2025-10-19 22:38:17 +02:00
parent dbdd4361b7
commit 74de64c66b
67 changed files with 56 additions and 6026 deletions

View File

@@ -25,20 +25,15 @@ type UserInfo struct {
Provider string `json:"iss,omitempty"`
}
// Type aliases for backward compatibility
type AuthConfig = config.AuthConfig
type OAuthConfig = config.OAuthConfig
type OIDCConfig = config.OIDCConfig
// AuthService handles authentication operations
type AuthService struct {
config *AuthConfig
config *config.AuthConfig
provider *oidc.Provider
oauth2 *oauth2.Config
}
// NewAuthService creates a new authentication service
func NewAuthService(config *AuthConfig) (*AuthService, error) {
func NewAuthService(config *config.AuthConfig) (*AuthService, error) {
service := &AuthService{config: config}
// Initialize OIDC provider if configured
@@ -176,7 +171,7 @@ func (a *AuthService) parseOIDCToken(tokenString string) (*UserInfo, error) {
// parseHMACToken parses and validates a JWT token using HMAC signing
func (a *AuthService) parseHMACToken(tokenString string) (*UserInfo, error) {
// Parse the token
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (any, error) {
// Validate signing method
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
@@ -336,7 +331,7 @@ func (a *AuthService) RequireAuth(next http.Handler) http.Handler {
func (a *AuthService) HandleOAuthLogin(w http.ResponseWriter, r *http.Request) {
// Handle mock authentication in dev mode
if a.config.DevMode && a.config.Provider == "mock" {
response := map[string]interface{}{
response := map[string]any{
"message": "Mock OAuth login",
"redirect_url": "/auth/callback?code=mock_code&state=mock_state",
"dev_mode": true,