feat: remove test mode (X-Test-Sub), all functions stored in S3 via storagesvc

- Remove FISSION_TEST_MODE and X-Test-Sub bypass from authMiddleware
- Remove testMode field from Server/Config structs
- Remove TestAuthenticator branch from main.go
- Add uploadToStoragesvc/buildDeploySpec: all function code uploaded to S3
- Add deleteFromStoragesvc: archive deleted from S3 on function delete
- Add FISSION_STORAGESVC_URL env to main.go and deploy/console.yaml
- image: naeel/fission-console:v1.3.31
This commit is contained in:
“Naeel”
2026-05-03 13:37:12 +04:00
parent e8f06d4ab2
commit a09291e208
5 changed files with 141 additions and 40 deletions
+7 -5
View File
@@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strings"
@@ -36,10 +37,10 @@ type Server struct {
saTokenPath string
invokeTimeout time.Duration
testMode bool // FISSION_TEST_MODE=true — разрешает X-Test-Sub shortcut
authUser string
authPass string
authUser string
authPass string
storagesvcURL string // URL Fission storagesvc для загрузки архивов кода в S3
// --- ai/ask feature (удалить блок целиком чтобы выкосить) ---
llmURL string // FISSION_LLM_URL
@@ -68,7 +69,7 @@ type Config struct {
SATokenPath string
AuthUser string
AuthPass string
TestMode bool
StoragesvcURL string
Authenticator auth.Authenticator // слой аутентификации
LLMUrl string
LLMKey string
@@ -76,6 +77,7 @@ type Config struct {
// NewServer создаёт и настраивает HTTP Server со всеми зависимостями.
func NewServer(cfg Config) *Server {
log.Printf("NewServer: storagesvcURL=%q", cfg.StoragesvcURL)
return &Server{
dyn: cfg.Dyn,
ns: cfg.Namespace,
@@ -85,7 +87,7 @@ func NewServer(cfg Config) *Server {
invokeTimeout: cfg.InvokeTimeout,
authUser: cfg.AuthUser,
authPass: cfg.AuthPass,
testMode: cfg.TestMode,
storagesvcURL: cfg.StoragesvcURL,
authenticator: cfg.Authenticator,
llmURL: cfg.LLMUrl,
llmKey: cfg.LLMKey,