Add support for localhost unauthenticated requests
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled

- Introduced `AllowLocalhostUnauthenticated` flag allowing unauthenticated requests from localhost.
- Updated authentication middleware to bypass checks for localhost when enabled.

Add new Gemini CLI models and update model registry function

- Introduced `GetGeminiCLIModels` for updated Gemini CLI model definitions.
- Added new models: "Gemini 2.5 Flash Lite" and "Gemini 2.5 Pro".
- Updated `RegisterModels` to use `GetGeminiCLIModels` in Gemini client initialization.
This commit is contained in:
Luis Pater
2025-08-27 21:10:01 +08:00
parent dff31a7a4c
commit 1c4183d943
4 changed files with 58 additions and 1 deletions
+5
View File
@@ -233,6 +233,11 @@ func (s *Server) UpdateClients(clients []interfaces.Client, cfg *config.Config)
// - gin.HandlerFunc: The authentication middleware handler
func AuthMiddleware(cfg *config.Config) gin.HandlerFunc {
return func(c *gin.Context) {
if cfg.AllowLocalhostUnauthenticated && strings.HasPrefix(c.Request.RemoteAddr, "127.0.0.1:") {
c.Next()
return
}
if len(cfg.APIKeys) == 0 {
c.Next()
return