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
@@ -27,8 +27,8 @@ import (
"testing"
"time"
"RenewCMS/api/pkg/authtoken"
"github.com/go-chi/chi/v5"
"github.com/go-chi/jwtauth/v5"
)
const (
@@ -51,7 +51,7 @@ type apiKeyEnv struct {
mail *mockMailRepo
feed *fakeReleaseFeed
updates *fakeUpdateStore
token *jwtauth.JWTAuth
token *authtoken.Auth
generator *hashing.SHA256KeyGenerator
now time.Time
settings config.Settings
@@ -76,7 +76,7 @@ func newAPIKeyEnvRecording(t *testing.T, recorder audit.Recorder) *apiKeyEnv {
images: newMockImageRepo(),
invites: newInviteFakeRepo(),
updates: &fakeUpdateStore{},
token: jwtauth.New("HS256", []byte("test-secret"), nil),
token: authtoken.New([]byte("test-secret")),
generator: hashing.NewSHA256KeyGenerator(),
now: time.Date(2026, time.October, 4, 12, 0, 0, 0, time.UTC),
settings: config.Settings{AuthRateLimit: config.AuthRateLimitSettings{MaxAttempts: 1000, Window: time.Minute}},
@@ -172,7 +172,7 @@ type apiKeyRequest struct {
func (e *apiKeyEnv) cookie(t *testing.T, userId uint32, tokenVersion uint32) *http.Cookie {
t.Helper()
_, tokenString, err := e.token.Encode(map[string]any{"user_id": userId, "token_version": tokenVersion})
tokenString, err := e.token.Encode(map[string]any{"user_id": userId, "token_version": tokenVersion})
if err != nil {
t.Fatalf("failed to encode jwt: %v", err)
}