Skip to content

Commit db1159b

Browse files
authored
feat: auth v2 - supersedes #2894 (#3476)
feat: auth v2 - supercedes #2894, metrics to follow later Signed-off-by: Dave Lee <[email protected]>
1 parent a9a3a07 commit db1159b

File tree

11 files changed

+264
-158
lines changed

11 files changed

+264
-158
lines changed

core/cli/run.go

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,34 @@ type RunCMD struct {
4141
Threads int `env:"LOCALAI_THREADS,THREADS" short:"t" help:"Number of threads used for parallel computation. Usage of the number of physical cores in the system is suggested" group:"performance"`
4242
ContextSize int `env:"LOCALAI_CONTEXT_SIZE,CONTEXT_SIZE" default:"512" help:"Default context size for models" group:"performance"`
4343

44-
Address string `env:"LOCALAI_ADDRESS,ADDRESS" default:":8080" help:"Bind address for the API server" group:"api"`
45-
CORS bool `env:"LOCALAI_CORS,CORS" help:"" group:"api"`
46-
CORSAllowOrigins string `env:"LOCALAI_CORS_ALLOW_ORIGINS,CORS_ALLOW_ORIGINS" group:"api"`
47-
LibraryPath string `env:"LOCALAI_LIBRARY_PATH,LIBRARY_PATH" help:"Path to the library directory (for e.g. external libraries used by backends)" default:"/usr/share/local-ai/libs" group:"backends"`
48-
CSRF bool `env:"LOCALAI_CSRF" help:"Enables fiber CSRF middleware" group:"api"`
49-
UploadLimit int `env:"LOCALAI_UPLOAD_LIMIT,UPLOAD_LIMIT" default:"15" help:"Default upload-limit in MB" group:"api"`
50-
APIKeys []string `env:"LOCALAI_API_KEY,API_KEY" help:"List of API Keys to enable API authentication. When this is set, all the requests must be authenticated with one of these API keys" group:"api"`
51-
DisableWebUI bool `env:"LOCALAI_DISABLE_WEBUI,DISABLE_WEBUI" default:"false" help:"Disable webui" group:"api"`
52-
DisablePredownloadScan bool `env:"LOCALAI_DISABLE_PREDOWNLOAD_SCAN" help:"If true, disables the best-effort security scanner before downloading any files." group:"hardening" default:"false"`
53-
OpaqueErrors bool `env:"LOCALAI_OPAQUE_ERRORS" default:"false" help:"If true, all error responses are replaced with blank 500 errors. This is intended only for hardening against information leaks and is normally not recommended." group:"hardening"`
54-
Peer2Peer bool `env:"LOCALAI_P2P,P2P" name:"p2p" default:"false" help:"Enable P2P mode" group:"p2p"`
55-
Peer2PeerDHTInterval int `env:"LOCALAI_P2P_DHT_INTERVAL,P2P_DHT_INTERVAL" default:"360" name:"p2p-dht-interval" help:"Interval for DHT refresh (used during token generation)" group:"p2p"`
56-
Peer2PeerOTPInterval int `env:"LOCALAI_P2P_OTP_INTERVAL,P2P_OTP_INTERVAL" default:"9000" name:"p2p-otp-interval" help:"Interval for OTP refresh (used during token generation)" group:"p2p"`
57-
Peer2PeerToken string `env:"LOCALAI_P2P_TOKEN,P2P_TOKEN,TOKEN" name:"p2ptoken" help:"Token for P2P mode (optional)" group:"p2p"`
58-
Peer2PeerNetworkID string `env:"LOCALAI_P2P_NETWORK_ID,P2P_NETWORK_ID" help:"Network ID for P2P mode, can be set arbitrarly by the user for grouping a set of instances" group:"p2p"`
59-
ParallelRequests bool `env:"LOCALAI_PARALLEL_REQUESTS,PARALLEL_REQUESTS" help:"Enable backends to handle multiple requests in parallel if they support it (e.g.: llama.cpp or vllm)" group:"backends"`
60-
SingleActiveBackend bool `env:"LOCALAI_SINGLE_ACTIVE_BACKEND,SINGLE_ACTIVE_BACKEND" help:"Allow only one backend to be run at a time" group:"backends"`
61-
PreloadBackendOnly bool `env:"LOCALAI_PRELOAD_BACKEND_ONLY,PRELOAD_BACKEND_ONLY" default:"false" help:"Do not launch the API services, only the preloaded models / backends are started (useful for multi-node setups)" group:"backends"`
62-
ExternalGRPCBackends []string `env:"LOCALAI_EXTERNAL_GRPC_BACKENDS,EXTERNAL_GRPC_BACKENDS" help:"A list of external grpc backends" group:"backends"`
63-
EnableWatchdogIdle bool `env:"LOCALAI_WATCHDOG_IDLE,WATCHDOG_IDLE" default:"false" help:"Enable watchdog for stopping backends that are idle longer than the watchdog-idle-timeout" group:"backends"`
64-
WatchdogIdleTimeout string `env:"LOCALAI_WATCHDOG_IDLE_TIMEOUT,WATCHDOG_IDLE_TIMEOUT" default:"15m" help:"Threshold beyond which an idle backend should be stopped" group:"backends"`
65-
EnableWatchdogBusy bool `env:"LOCALAI_WATCHDOG_BUSY,WATCHDOG_BUSY" default:"false" help:"Enable watchdog for stopping backends that are busy longer than the watchdog-busy-timeout" group:"backends"`
66-
WatchdogBusyTimeout string `env:"LOCALAI_WATCHDOG_BUSY_TIMEOUT,WATCHDOG_BUSY_TIMEOUT" default:"5m" help:"Threshold beyond which a busy backend should be stopped" group:"backends"`
67-
Federated bool `env:"LOCALAI_FEDERATED,FEDERATED" help:"Enable federated instance" group:"federated"`
68-
DisableGalleryEndpoint bool `env:"LOCALAI_DISABLE_GALLERY_ENDPOINT,DISABLE_GALLERY_ENDPOINT" help:"Disable the gallery endpoints" group:"api"`
44+
Address string `env:"LOCALAI_ADDRESS,ADDRESS" default:":8080" help:"Bind address for the API server" group:"api"`
45+
CORS bool `env:"LOCALAI_CORS,CORS" help:"" group:"api"`
46+
CORSAllowOrigins string `env:"LOCALAI_CORS_ALLOW_ORIGINS,CORS_ALLOW_ORIGINS" group:"api"`
47+
LibraryPath string `env:"LOCALAI_LIBRARY_PATH,LIBRARY_PATH" help:"Path to the library directory (for e.g. external libraries used by backends)" default:"/usr/share/local-ai/libs" group:"backends"`
48+
CSRF bool `env:"LOCALAI_CSRF" help:"Enables fiber CSRF middleware" group:"api"`
49+
UploadLimit int `env:"LOCALAI_UPLOAD_LIMIT,UPLOAD_LIMIT" default:"15" help:"Default upload-limit in MB" group:"api"`
50+
APIKeys []string `env:"LOCALAI_API_KEY,API_KEY" help:"List of API Keys to enable API authentication. When this is set, all the requests must be authenticated with one of these API keys" group:"api"`
51+
DisableWebUI bool `env:"LOCALAI_DISABLE_WEBUI,DISABLE_WEBUI" default:"false" help:"Disable webui" group:"api"`
52+
DisablePredownloadScan bool `env:"LOCALAI_DISABLE_PREDOWNLOAD_SCAN" help:"If true, disables the best-effort security scanner before downloading any files." group:"hardening" default:"false"`
53+
OpaqueErrors bool `env:"LOCALAI_OPAQUE_ERRORS" default:"false" help:"If true, all error responses are replaced with blank 500 errors. This is intended only for hardening against information leaks and is normally not recommended." group:"hardening"`
54+
UseSubtleKeyComparison bool `env:"LOCALAI_SUBTLE_KEY_COMPARISON" default:"false" help:"If true, API Key validation comparisons will be performed using constant-time comparisons rather than simple equality. This trades off performance on each request for resiliancy against timing attacks." group:"hardening"`
55+
DisableApiKeyRequirementForHttpGet bool `env:"LOCALAI_DISABLE_API_KEY_REQUIREMENT_FOR_HTTP_GET" default:"false" help:"If true, a valid API key is not required to issue GET requests to portions of the web ui. This should only be enabled in secure testing environments" group:"hardening"`
56+
HttpGetExemptedEndpoints []string `env:"LOCALAI_HTTP_GET_EXEMPTED_ENDPOINTS" default:"^/$,^/browse/?$,^/talk/?$,^/p2p/?$,^/chat/?$,^/text2image/?$,^/tts/?$,^/static/.*$,^/swagger.*$" help:"If LOCALAI_DISABLE_API_KEY_REQUIREMENT_FOR_HTTP_GET is overriden to true, this is the list of endpoints to exempt. Only adjust this in case of a security incident or as a result of a personal security posture review" group:"hardening"`
57+
Peer2Peer bool `env:"LOCALAI_P2P,P2P" name:"p2p" default:"false" help:"Enable P2P mode" group:"p2p"`
58+
Peer2PeerDHTInterval int `env:"LOCALAI_P2P_DHT_INTERVAL,P2P_DHT_INTERVAL" default:"360" name:"p2p-dht-interval" help:"Interval for DHT refresh (used during token generation)" group:"p2p"`
59+
Peer2PeerOTPInterval int `env:"LOCALAI_P2P_OTP_INTERVAL,P2P_OTP_INTERVAL" default:"9000" name:"p2p-otp-interval" help:"Interval for OTP refresh (used during token generation)" group:"p2p"`
60+
Peer2PeerToken string `env:"LOCALAI_P2P_TOKEN,P2P_TOKEN,TOKEN" name:"p2ptoken" help:"Token for P2P mode (optional)" group:"p2p"`
61+
Peer2PeerNetworkID string `env:"LOCALAI_P2P_NETWORK_ID,P2P_NETWORK_ID" help:"Network ID for P2P mode, can be set arbitrarly by the user for grouping a set of instances" group:"p2p"`
62+
ParallelRequests bool `env:"LOCALAI_PARALLEL_REQUESTS,PARALLEL_REQUESTS" help:"Enable backends to handle multiple requests in parallel if they support it (e.g.: llama.cpp or vllm)" group:"backends"`
63+
SingleActiveBackend bool `env:"LOCALAI_SINGLE_ACTIVE_BACKEND,SINGLE_ACTIVE_BACKEND" help:"Allow only one backend to be run at a time" group:"backends"`
64+
PreloadBackendOnly bool `env:"LOCALAI_PRELOAD_BACKEND_ONLY,PRELOAD_BACKEND_ONLY" default:"false" help:"Do not launch the API services, only the preloaded models / backends are started (useful for multi-node setups)" group:"backends"`
65+
ExternalGRPCBackends []string `env:"LOCALAI_EXTERNAL_GRPC_BACKENDS,EXTERNAL_GRPC_BACKENDS" help:"A list of external grpc backends" group:"backends"`
66+
EnableWatchdogIdle bool `env:"LOCALAI_WATCHDOG_IDLE,WATCHDOG_IDLE" default:"false" help:"Enable watchdog for stopping backends that are idle longer than the watchdog-idle-timeout" group:"backends"`
67+
WatchdogIdleTimeout string `env:"LOCALAI_WATCHDOG_IDLE_TIMEOUT,WATCHDOG_IDLE_TIMEOUT" default:"15m" help:"Threshold beyond which an idle backend should be stopped" group:"backends"`
68+
EnableWatchdogBusy bool `env:"LOCALAI_WATCHDOG_BUSY,WATCHDOG_BUSY" default:"false" help:"Enable watchdog for stopping backends that are busy longer than the watchdog-busy-timeout" group:"backends"`
69+
WatchdogBusyTimeout string `env:"LOCALAI_WATCHDOG_BUSY_TIMEOUT,WATCHDOG_BUSY_TIMEOUT" default:"5m" help:"Threshold beyond which a busy backend should be stopped" group:"backends"`
70+
Federated bool `env:"LOCALAI_FEDERATED,FEDERATED" help:"Enable federated instance" group:"federated"`
71+
DisableGalleryEndpoint bool `env:"LOCALAI_DISABLE_GALLERY_ENDPOINT,DISABLE_GALLERY_ENDPOINT" help:"Disable the gallery endpoints" group:"api"`
6972
}
7073

7174
func (r *RunCMD) Run(ctx *cliContext.Context) error {
@@ -97,6 +100,9 @@ func (r *RunCMD) Run(ctx *cliContext.Context) error {
97100
config.WithModelsURL(append(r.Models, r.ModelArgs...)...),
98101
config.WithOpaqueErrors(r.OpaqueErrors),
99102
config.WithEnforcedPredownloadScans(!r.DisablePredownloadScan),
103+
config.WithSubtleKeyComparison(r.UseSubtleKeyComparison),
104+
config.WithDisableApiKeyRequirementForHttpGet(r.DisableApiKeyRequirementForHttpGet),
105+
config.WithHttpGetExemptedEndpoints(r.HttpGetExemptedEndpoints),
100106
config.WithP2PNetworkID(r.Peer2PeerNetworkID),
101107
}
102108

core/config/application_config.go

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"embed"
66
"encoding/json"
7+
"regexp"
78
"time"
89

910
"github.com/mudler/LocalAI/pkg/xsysinfo"
@@ -16,7 +17,6 @@ type ApplicationConfig struct {
1617
ModelPath string
1718
LibPath string
1819
UploadLimitMB, Threads, ContextSize int
19-
DisableWebUI bool
2020
F16 bool
2121
Debug bool
2222
ImageDir string
@@ -31,11 +31,17 @@ type ApplicationConfig struct {
3131
PreloadModelsFromPath string
3232
CORSAllowOrigins string
3333
ApiKeys []string
34-
EnforcePredownloadScans bool
35-
OpaqueErrors bool
3634
P2PToken string
3735
P2PNetworkID string
3836

37+
DisableWebUI bool
38+
EnforcePredownloadScans bool
39+
OpaqueErrors bool
40+
UseSubtleKeyComparison bool
41+
DisableApiKeyRequirementForHttpGet bool
42+
HttpGetExemptedEndpoints []*regexp.Regexp
43+
DisableGalleryEndpoint bool
44+
3945
ModelLibraryURL string
4046

4147
Galleries []Gallery
@@ -57,8 +63,6 @@ type ApplicationConfig struct {
5763
ModelsURL []string
5864

5965
WatchDogBusyTimeout, WatchDogIdleTimeout time.Duration
60-
61-
DisableGalleryEndpoint bool
6266
}
6367

6468
type AppOption func(*ApplicationConfig)
@@ -327,6 +331,32 @@ func WithOpaqueErrors(opaque bool) AppOption {
327331
}
328332
}
329333

334+
func WithSubtleKeyComparison(subtle bool) AppOption {
335+
return func(o *ApplicationConfig) {
336+
o.UseSubtleKeyComparison = subtle
337+
}
338+
}
339+
340+
func WithDisableApiKeyRequirementForHttpGet(required bool) AppOption {
341+
return func(o *ApplicationConfig) {
342+
o.DisableApiKeyRequirementForHttpGet = required
343+
}
344+
}
345+
346+
func WithHttpGetExemptedEndpoints(endpoints []string) AppOption {
347+
return func(o *ApplicationConfig) {
348+
o.HttpGetExemptedEndpoints = []*regexp.Regexp{}
349+
for _, epr := range endpoints {
350+
r, err := regexp.Compile(epr)
351+
if err == nil && r != nil {
352+
o.HttpGetExemptedEndpoints = append(o.HttpGetExemptedEndpoints, r)
353+
} else {
354+
log.Warn().Err(err).Str("regex", epr).Msg("Error while compiling HTTP Get Exemption regex, skipping this entry.")
355+
}
356+
}
357+
}
358+
}
359+
330360
// ToConfigLoaderOptions returns a slice of ConfigLoader Option.
331361
// Some options defined at the application level are going to be passed as defaults for
332362
// all the configuration for the models.

core/http/app.go

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ package http
33
import (
44
"embed"
55
"errors"
6+
"fmt"
67
"net/http"
7-
"strings"
88

9+
"github.com/dave-gray101/v2keyauth"
910
"github.com/mudler/LocalAI/pkg/utils"
1011

1112
"github.com/mudler/LocalAI/core/http/endpoints/localai"
1213
"github.com/mudler/LocalAI/core/http/endpoints/openai"
14+
"github.com/mudler/LocalAI/core/http/middleware"
1315
"github.com/mudler/LocalAI/core/http/routes"
1416

1517
"github.com/mudler/LocalAI/core/config"
@@ -137,37 +139,14 @@ func App(cl *config.BackendConfigLoader, ml *model.ModelLoader, appConfig *confi
137139
})
138140
}
139141

140-
// Auth middleware checking if API key is valid. If no API key is set, no auth is required.
141-
auth := func(c *fiber.Ctx) error {
142-
if len(appConfig.ApiKeys) == 0 {
143-
return c.Next()
144-
}
145-
146-
if len(appConfig.ApiKeys) == 0 {
147-
return c.Next()
148-
}
149-
150-
authHeader := readAuthHeader(c)
151-
if authHeader == "" {
152-
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"message": "Authorization header missing"})
153-
}
154-
155-
// If it's a bearer token
156-
authHeaderParts := strings.Split(authHeader, " ")
157-
if len(authHeaderParts) != 2 || authHeaderParts[0] != "Bearer" {
158-
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"message": "Invalid Authorization header format"})
159-
}
160-
161-
apiKey := authHeaderParts[1]
162-
for _, key := range appConfig.ApiKeys {
163-
if apiKey == key {
164-
return c.Next()
165-
}
166-
}
167-
168-
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"message": "Invalid API key"})
142+
kaConfig, err := middleware.GetKeyAuthConfig(appConfig)
143+
if err != nil || kaConfig == nil {
144+
return nil, fmt.Errorf("failed to create key auth config: %w", err)
169145
}
170146

147+
// Auth is applied to _all_ endpoints. No exceptions. Filtering out endpoints to bypass is the role of the Filter property of the KeyAuth Configuration
148+
app.Use(v2keyauth.New(*kaConfig))
149+
171150
if appConfig.CORS {
172151
var c func(ctx *fiber.Ctx) error
173152
if appConfig.CORSAllowOrigins == "" {
@@ -192,13 +171,13 @@ func App(cl *config.BackendConfigLoader, ml *model.ModelLoader, appConfig *confi
192171
galleryService := services.NewGalleryService(appConfig)
193172
galleryService.Start(appConfig.Context, cl)
194173

195-
routes.RegisterElevenLabsRoutes(app, cl, ml, appConfig, auth)
196-
routes.RegisterLocalAIRoutes(app, cl, ml, appConfig, galleryService, auth)
197-
routes.RegisterOpenAIRoutes(app, cl, ml, appConfig, auth)
174+
routes.RegisterElevenLabsRoutes(app, cl, ml, appConfig)
175+
routes.RegisterLocalAIRoutes(app, cl, ml, appConfig, galleryService)
176+
routes.RegisterOpenAIRoutes(app, cl, ml, appConfig)
198177
if !appConfig.DisableWebUI {
199-
routes.RegisterUIRoutes(app, cl, ml, appConfig, galleryService, auth)
178+
routes.RegisterUIRoutes(app, cl, ml, appConfig, galleryService)
200179
}
201-
routes.RegisterJINARoutes(app, cl, ml, appConfig, auth)
180+
routes.RegisterJINARoutes(app, cl, ml, appConfig)
202181

203182
httpFS := http.FS(embedDirStatic)
204183

core/http/middleware/auth.go

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
package middleware
2+
3+
import (
4+
"crypto/subtle"
5+
"errors"
6+
7+
"github.com/dave-gray101/v2keyauth"
8+
"github.com/gofiber/fiber/v2"
9+
"github.com/gofiber/fiber/v2/middleware/keyauth"
10+
"github.com/mudler/LocalAI/core/config"
11+
)
12+
13+
// This file contains the configuration generators and handler functions that are used along with the fiber/keyauth middleware
14+
// Currently this requires an upstream patch - and feature patches are no longer accepted to v2
15+
// Therefore `dave-gray101/v2keyauth` contains the v2 backport of the middleware until v3 stabilizes and we migrate.
16+
17+
func GetKeyAuthConfig(applicationConfig *config.ApplicationConfig) (*v2keyauth.Config, error) {
18+
customLookup, err := v2keyauth.MultipleKeySourceLookup([]string{"header:Authorization", "header:x-api-key", "header:xi-api-key"}, keyauth.ConfigDefault.AuthScheme)
19+
if err != nil {
20+
return nil, err
21+
}
22+
23+
return &v2keyauth.Config{
24+
CustomKeyLookup: customLookup,
25+
Next: getApiKeyRequiredFilterFunction(applicationConfig),
26+
Validator: getApiKeyValidationFunction(applicationConfig),
27+
ErrorHandler: getApiKeyErrorHandler(applicationConfig),
28+
AuthScheme: "Bearer",
29+
}, nil
30+
}
31+
32+
func getApiKeyErrorHandler(applicationConfig *config.ApplicationConfig) fiber.ErrorHandler {
33+
return func(ctx *fiber.Ctx, err error) error {
34+
if errors.Is(err, v2keyauth.ErrMissingOrMalformedAPIKey) {
35+
if len(applicationConfig.ApiKeys) == 0 {
36+
return ctx.Next() // if no keys are set up, any error we get here is not an error.
37+
}
38+
if applicationConfig.OpaqueErrors {
39+
return ctx.SendStatus(403)
40+
}
41+
}
42+
if applicationConfig.OpaqueErrors {
43+
return ctx.SendStatus(500)
44+
}
45+
return err
46+
}
47+
}
48+
49+
func getApiKeyValidationFunction(applicationConfig *config.ApplicationConfig) func(*fiber.Ctx, string) (bool, error) {
50+
51+
if applicationConfig.UseSubtleKeyComparison {
52+
return func(ctx *fiber.Ctx, apiKey string) (bool, error) {
53+
if len(applicationConfig.ApiKeys) == 0 {
54+
return true, nil // If no keys are setup, accept everything
55+
}
56+
for _, validKey := range applicationConfig.ApiKeys {
57+
if subtle.ConstantTimeCompare([]byte(apiKey), []byte(validKey)) == 1 {
58+
return true, nil
59+
}
60+
}
61+
return false, v2keyauth.ErrMissingOrMalformedAPIKey
62+
}
63+
}
64+
65+
return func(ctx *fiber.Ctx, apiKey string) (bool, error) {
66+
if len(applicationConfig.ApiKeys) == 0 {
67+
return true, nil // If no keys are setup, accept everything
68+
}
69+
for _, validKey := range applicationConfig.ApiKeys {
70+
if apiKey == validKey {
71+
return true, nil
72+
}
73+
}
74+
return false, v2keyauth.ErrMissingOrMalformedAPIKey
75+
}
76+
}
77+
78+
func getApiKeyRequiredFilterFunction(applicationConfig *config.ApplicationConfig) func(*fiber.Ctx) bool {
79+
if applicationConfig.DisableApiKeyRequirementForHttpGet {
80+
return func(c *fiber.Ctx) bool {
81+
if c.Method() != "GET" {
82+
return false
83+
}
84+
for _, rx := range applicationConfig.HttpGetExemptedEndpoints {
85+
if rx.MatchString(c.Path()) {
86+
return true
87+
}
88+
}
89+
return false
90+
}
91+
}
92+
return func(c *fiber.Ctx) bool { return false }
93+
}

core/http/routes/elevenlabs.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ import (
1010
func RegisterElevenLabsRoutes(app *fiber.App,
1111
cl *config.BackendConfigLoader,
1212
ml *model.ModelLoader,
13-
appConfig *config.ApplicationConfig,
14-
auth func(*fiber.Ctx) error) {
13+
appConfig *config.ApplicationConfig) {
1514

1615
// Elevenlabs
17-
app.Post("/v1/text-to-speech/:voice-id", auth, elevenlabs.TTSEndpoint(cl, ml, appConfig))
16+
app.Post("/v1/text-to-speech/:voice-id", elevenlabs.TTSEndpoint(cl, ml, appConfig))
1817

19-
app.Post("/v1/sound-generation", auth, elevenlabs.SoundGenerationEndpoint(cl, ml, appConfig))
18+
app.Post("/v1/sound-generation", elevenlabs.SoundGenerationEndpoint(cl, ml, appConfig))
2019

2120
}

core/http/routes/jina.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import (
1111
func RegisterJINARoutes(app *fiber.App,
1212
cl *config.BackendConfigLoader,
1313
ml *model.ModelLoader,
14-
appConfig *config.ApplicationConfig,
15-
auth func(*fiber.Ctx) error) {
14+
appConfig *config.ApplicationConfig) {
1615

1716
// POST endpoint to mimic the reranking
1817
app.Post("/v1/rerank", jina.JINARerankEndpoint(cl, ml, appConfig))

0 commit comments

Comments
 (0)