feat: secure service connections and login

This commit is contained in:
2026-11-06 21:14:49 +03:00
parent cb51354889
commit 48918e8b19
59 changed files with 1980 additions and 316 deletions
+10 -2
View File
@@ -11,7 +11,8 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/suite"
"gitea.privcloud.tech/dizi/mtusi2026lab6/internal/session"
"gitea.privcloud.tech/dizi/mtusi2026lab7/internal/security/tlsconfig"
"gitea.privcloud.tech/dizi/mtusi2026lab7/internal/session"
)
type SessionSuite struct {
@@ -34,7 +35,14 @@ func (s *SessionSuite) SetupSuite() {
s.Require().NoError(err)
rawURL = strings.TrimSpace(string(data))
}
store, err := session.New(rawURL)
tlsConfiguration, err := tlsconfig.LoadClient(tlsconfig.ClientConfig{
CAPath: os.Getenv("TEST_CACHE_TLS_CA_PATH"),
CertificatePath: os.Getenv("TEST_CACHE_TLS_CERTIFICATE_PATH"),
PrivateKeyPath: os.Getenv("TEST_CACHE_TLS_PRIVATE_KEY_PATH"),
ServerName: os.Getenv("TEST_CACHE_TLS_SERVER_NAME"),
})
s.Require().NoError(err)
store, err := session.New(rawURL, tlsConfiguration)
s.Require().NoError(err)
s.store = store
}