<commit_before>package main

import (
	"github.com/labstack/echo"
	"github.com/labstack/echo/middleware"
	"github.com/mailslurper/mailslurper/cmd/mailslurper/controllers"
	"github.com/mailslurper/mailslurper/pkg/auth/authfactory"
	"github.com/mailslurper/mailslurper/pkg/auth/authscheme"
	"github.com/mailslurper/mailslurper/pkg/auth/jwt"
	"github.com/mailslurper/mailslurper/pkg/mailslurper"
)

func setupServicesListener() {
	middlewares := make([]echo.MiddlewareFunc, 0, 5)

	/*
	 * Start the services server
	 */
	serviceController := &controllers.ServiceController{
		AuthFactory: &authfactory.AuthFactory{
			Config: config,
		},
		CacheService: cacheService,
		Config:       config,
		Database:     database,
		JWTService: &jwt.JWTService{
			Config: config,
		},
		Logger:        mailslurper.GetLogger(*logLevel, *logFormat, "ServiceController"),
		ServerVersion: SERVER_VERSION,
	}

	service = echo.New()
	service.HideBanner = true

	if config.AuthenticationScheme != authscheme.NONE {
		middlewares = append(middlewares, serviceAuthorization)
	}

	service.Use(middleware.CORSWithConfig(middleware.CORSConfig{
		AllowMethods: []string{echo.GET, echo.HEAD, echo.PUT, echo.POST, echo.DELETE, echo.OPTIONS},
	}))

	service.GET("/mail/:id", serviceController.GetMail, middlewares...)
	service.GET("/mail/:id/message", serviceController.GetMailMessage, middlewares...)
	service.DELETE("/mail", serviceController.DeleteMail, middlewares...)
	service.GET("/mail", serviceController.GetMailCollection, middlewares...)
	service.GET("/mailcount", serviceController.GetMailCount, middlewares...)
	service.GET("/mail/:mailID/attachment/:attachmentID", serviceController.DownloadAttachment, middlewares...)
	service.GET("/version", serviceController.Version, middlewares...)
	service.GET("/pruneoptions", serviceController.GetPruneOptions, middlewares...)

	if config.AuthenticationScheme != authscheme.NONE {
		service.POST("/login", serviceController.Login)
		service.DELETE("/logout", serviceController.Logout, middlewares...)<commit_msg>Removing JWT auth from attachments... cause I can't figure out how to get the lightbox to work with it for now<commit_after>package main

import (
	"github.com/labstack/echo"
	"github.com/labstack/echo/middleware"
	"github.com/mailslurper/mailslurper/cmd/mailslurper/controllers"
	"github.com/mailslurper/mailslurper/pkg/auth/authfactory"
	"github.com/mailslurper/mailslurper/pkg/auth/authscheme"
	"github.com/mailslurper/mailslurper/pkg/auth/jwt"
	"github.com/mailslurper/mailslurper/pkg/mailslurper"
)

func setupServicesListener() {
	middlewares := make([]echo.MiddlewareFunc, 0, 5)

	/*
	 * Start the services server
	 */
	serviceController := &controllers.ServiceController{
		AuthFactory: &authfactory.AuthFactory{
			Config: config,
		},
		CacheService: cacheService,
		Config:       config,
		Database:     database,
		JWTService: &jwt.JWTService{
			Config: config,
		},
		Logger:        mailslurper.GetLogger(*logLevel, *logFormat, "ServiceController"),
		ServerVersion: SERVER_VERSION,
	}

	service = echo.New()
	service.HideBanner = true

	if config.AuthenticationScheme != authscheme.NONE {
		middlewares = append(middlewares, serviceAuthorization)
	}

	service.Use(middleware.CORSWithConfig(middleware.CORSConfig{
		AllowMethods: []string{echo.GET, echo.HEAD, echo.PUT, echo.POST, echo.DELETE, echo.OPTIONS},
	}))

	service.GET("/mail/:id", serviceController.GetMail, middlewares...)
	service.GET("/mail/:id/message", serviceController.GetMailMessage, middlewares...)
	service.DELETE("/mail", serviceController.DeleteMail, middlewares...)
	service.GET("/mail", serviceController.GetMailCollection, middlewares...)
	service.GET("/mailcount", serviceController.GetMailCount, middlewares...)
	service.GET("/mail/:mailID/attachment/:attachmentID", serviceController.DownloadAttachment)
	service.GET("/version", serviceController.Version, middlewares...)
	service.GET("/pruneoptions", serviceController.GetPruneOptions, middlewares...)

	if config.AuthenticationScheme != authscheme.NONE {
		service.POST("/login", serviceController.Login)
		service.DELETE("/logout", serviceController.Logout, middlewares...)
{'fraction_non_alphanumeric': 0.13766546329723225, 'fraction_numerical': 0.0009626955475330926, 'mean_word_length': 5.316109422492401, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3856359', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1303, 'n_words': 202}