feat: deepseek is insanly good
This commit is contained in:
1 parent
be9d6b610f
commit
56da3bae61
5 files changed
+112
-51
No files matched your search
@@ -41,6 +41,12 @@ func main() {
|
||||
|
||||
store.bootstrapAdmin(context.Background(), logger)
|
||||
|
||||
hmacKeyFile := envOrDefault("HMAC_KEY_FILE", ".secret")
|
||||
hmacKey, err := loadHMACKey(hmacKeyFile, logger)
|
||||
if err != nil {
|
||||
logger.Fatal("failed to load HMAC key", zap.Error(err))
|
||||
}
|
||||
|
||||
searchEngine := createSearchEngine(logger, store, openAIKey)
|
||||
|
||||
mcpServer := server.NewMCPServer(
|
||||
@@ -59,7 +65,7 @@ func main() {
|
||||
streamableServer := server.NewStreamableHTTPServer(mcpServer)
|
||||
|
||||
withAuth := func(next http.Handler) http.Handler {
|
||||
return authMiddleware(store, logger, next)
|
||||
return authMiddleware(store, hmacKey, logger, next)
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
@@ -78,8 +84,8 @@ func main() {
|
||||
|
||||
mux.Handle("/mcp", withAuth(streamableServer))
|
||||
|
||||
mux.HandleFunc("/api/v1/auth/login", loginHandler(store, logger))
|
||||
mux.HandleFunc("/api/v1/auth/logout", logoutHandler(store))
|
||||
mux.HandleFunc("/api/v1/auth/login", loginHandler(store, hmacKey, logger))
|
||||
mux.HandleFunc("/api/v1/auth/logout", logoutHandler())
|
||||
mux.HandleFunc("/api/v1/auth/me", withAuth(getUserHandler(store, logger)).ServeHTTP)
|
||||
mux.HandleFunc("/api/v1/auth/password", withAuth(changePasswordHandler(store, logger)).ServeHTTP)
|
||||
|
||||
|
||||
Reference in new issue
Block a user