refac: removed 7 direct and 12 indirect go modules for custom code instead

This commit is contained in:
Florian Sylvain committed 2026-10-21 23:13:46 +02:00
1 parent cfcf108488
commit c68e9a7858
73 files changed
+2455 -428

No files matched your search

+4 -4
View File
@@ -30,8 +30,8 @@ import (
"testing"
"time"
"RenewCMS/api/pkg/authtoken"
"github.com/go-chi/chi/v5"
"github.com/go-chi/jwtauth/v5"
)
const (
@@ -71,7 +71,7 @@ type hardeningEnv struct {
settings *mockPurgeSettingsRepo
logs *bytes.Buffer
users *mockUserRepo
token *jwtauth.JWTAuth
token *authtoken.Auth
router http.Handler
}
@@ -90,7 +90,7 @@ func newHardeningEnv(t *testing.T) *hardeningEnv {
settings: newMockPurgeSettingsRepo(),
logs: &bytes.Buffer{},
users: newMockUserRepo(),
token: jwtauth.New("HS256", []byte("test-secret"), nil),
token: authtoken.New([]byte("test-secret")),
}
env.users.users[hardeningAdminID] = user.User{ID: hardeningAdminID, Username: "marta", IsVerified: true, Role: user.RoleAdmin}
env.transactor = newMergeTransactor(env.images, env.articles, env.sites, env.authors, env.entries)
@@ -124,7 +124,7 @@ func (e *hardeningEnv) send(t *testing.T, method string, path string, body strin
if body != "" {
req.Header.Set("Content-Type", "application/json")
}
_, tokenString, err := e.token.Encode(map[string]any{"user_id": hardeningAdminID, "token_version": 0})
tokenString, err := e.token.Encode(map[string]any{"user_id": hardeningAdminID, "token_version": 0})
if err != nil {
t.Fatalf("failed to encode jwt: %v", err)
}