mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 02:51:34 +00:00
The integration tests for admin-only mutations were failing due to an authorization issue. The root cause was that the JWT token used in the tests did not reflect the user's admin role, which was being set directly in the database. This commit fixes the issue by: 1. Updating the `CreateAuthenticatedUser` test helper to generate a new JWT token after a user's role is changed. This ensures the token contains the correct, up-to-date role. 2. Removing all uses of `auth.ContextWithAdminUser` from the integration tests, making the JWT token the single source of truth for authorization. This change also removes unused imports and variables that were causing build failures after the refactoring. All integration tests now pass.
142 lines
6.4 KiB
Modula-2
142 lines
6.4 KiB
Modula-2
module tercul
|
|
|
|
go 1.24.3
|
|
|
|
require (
|
|
github.com/99designs/gqlgen v0.17.78
|
|
github.com/DATA-DOG/go-sqlmock v1.5.2
|
|
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
|
|
github.com/go-playground/validator/v10 v10.27.0
|
|
github.com/golang-jwt/jwt/v5 v5.3.0
|
|
github.com/google/uuid v1.6.0
|
|
github.com/hashicorp/golang-lru/v2 v2.0.7
|
|
github.com/hibiken/asynq v0.25.1
|
|
github.com/jonreiter/govader v0.0.0-20250429093935-f6505c8d03cc
|
|
github.com/pemistahl/lingua-go v1.4.0
|
|
github.com/pressly/goose/v3 v3.21.1
|
|
github.com/prometheus/client_golang v1.20.5
|
|
github.com/redis/go-redis/v9 v9.13.0
|
|
github.com/rs/zerolog v1.34.0
|
|
github.com/stretchr/testify v1.11.1
|
|
github.com/vektah/gqlparser/v2 v2.5.30
|
|
github.com/weaviate/weaviate v1.33.0-rc.1
|
|
github.com/weaviate/weaviate-go-client/v5 v5.5.0
|
|
go.opentelemetry.io/otel v1.38.0
|
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.38.0
|
|
go.opentelemetry.io/otel/sdk v1.38.0
|
|
go.opentelemetry.io/otel/trace v1.38.0
|
|
golang.org/x/crypto v0.41.0
|
|
gorm.io/driver/postgres v1.6.0
|
|
gorm.io/driver/sqlite v1.6.0
|
|
gorm.io/gorm v1.30.3
|
|
)
|
|
|
|
require (
|
|
filippo.io/edwards25519 v1.1.0 // indirect
|
|
github.com/ClickHouse/ch-go v0.61.1 // indirect
|
|
github.com/ClickHouse/clickhouse-go/v2 v2.17.1 // indirect
|
|
github.com/agnivade/levenshtein v1.2.1 // indirect
|
|
github.com/andybalholm/brotli v1.2.0 // indirect
|
|
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
|
|
github.com/beorn7/perks v1.0.1 // indirect
|
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
|
github.com/coder/websocket v1.8.12 // indirect
|
|
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
|
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
|
github.com/elastic/go-sysinfo v1.15.4 // indirect
|
|
github.com/elastic/go-windows v1.0.2 // indirect
|
|
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
|
|
github.com/go-faster/city v1.0.1 // indirect
|
|
github.com/go-faster/errors v0.7.1 // indirect
|
|
github.com/go-logr/logr v1.4.3 // indirect
|
|
github.com/go-logr/stdr v1.2.2 // indirect
|
|
github.com/go-openapi/analysis v0.23.0 // indirect
|
|
github.com/go-openapi/errors v0.22.0 // indirect
|
|
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
|
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
|
github.com/go-openapi/loads v0.22.0 // indirect
|
|
github.com/go-openapi/runtime v0.24.2 // indirect
|
|
github.com/go-openapi/spec v0.21.0 // indirect
|
|
github.com/go-openapi/strfmt v0.23.0 // indirect
|
|
github.com/go-openapi/swag v0.23.0 // indirect
|
|
github.com/go-openapi/validate v0.24.0 // indirect
|
|
github.com/go-playground/locales v0.14.1 // indirect
|
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
|
github.com/go-sql-driver/mysql v1.9.3 // indirect
|
|
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
|
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
|
|
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
|
|
github.com/golang-sql/sqlexp v0.1.0 // indirect
|
|
github.com/gorilla/websocket v1.5.0 // indirect
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
|
github.com/jackc/pgx/v5 v5.7.5 // indirect
|
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
|
github.com/jinzhu/now v1.1.5 // indirect
|
|
github.com/jonboulle/clockwork v0.5.0 // indirect
|
|
github.com/josharian/intern v1.0.0 // indirect
|
|
github.com/klauspost/compress v1.18.0 // indirect
|
|
github.com/leodido/go-urn v1.4.0 // indirect
|
|
github.com/mailru/easyjson v0.7.7 // indirect
|
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/mattn/go-sqlite3 v1.14.22 // indirect
|
|
github.com/mfridman/interpolate v0.0.2 // indirect
|
|
github.com/microsoft/go-mssqldb v1.9.2 // indirect
|
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
|
github.com/ncruces/go-strftime v0.1.9 // indirect
|
|
github.com/oklog/ulid v1.3.1 // indirect
|
|
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
|
github.com/paulmach/orb v0.11.1 // indirect
|
|
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
|
github.com/pkg/errors v0.9.1 // indirect
|
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
|
github.com/prometheus/client_model v0.6.2 // indirect
|
|
github.com/prometheus/common v0.65.0 // indirect
|
|
github.com/prometheus/procfs v0.15.1 // indirect
|
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
|
github.com/robfig/cron/v3 v3.0.1 // indirect
|
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
|
github.com/segmentio/asm v1.2.0 // indirect
|
|
github.com/sethvargo/go-retry v0.3.0 // indirect
|
|
github.com/shopspring/decimal v1.4.0 // indirect
|
|
github.com/sosodev/duration v1.3.1 // indirect
|
|
github.com/spf13/cast v1.7.0 // indirect
|
|
github.com/stretchr/objx v0.5.2 // indirect
|
|
github.com/tursodatabase/libsql-client-go v0.0.0-20240902231107-85af5b9d094d // indirect
|
|
github.com/urfave/cli/v2 v2.27.7 // indirect
|
|
github.com/vertica/vertica-sql-go v1.3.3 // indirect
|
|
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
|
|
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77 // indirect
|
|
github.com/ydb-platform/ydb-go-sdk/v3 v3.108.1 // indirect
|
|
github.com/ziutek/mymysql v1.5.4 // indirect
|
|
go.mongodb.org/mongo-driver v1.14.0 // indirect
|
|
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
|
go.opentelemetry.io/otel/metric v1.38.0 // indirect
|
|
go.uber.org/multierr v1.11.0 // indirect
|
|
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
|
|
golang.org/x/mod v0.26.0 // indirect
|
|
golang.org/x/net v0.42.0 // indirect
|
|
golang.org/x/oauth2 v0.30.0 // indirect
|
|
golang.org/x/sync v0.16.0 // indirect
|
|
golang.org/x/sys v0.35.0 // indirect
|
|
golang.org/x/text v0.28.0 // indirect
|
|
golang.org/x/time v0.12.0 // indirect
|
|
golang.org/x/tools v0.35.0 // indirect
|
|
gonum.org/v1/gonum v0.15.1 // indirect
|
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect
|
|
google.golang.org/grpc v1.74.2 // indirect
|
|
google.golang.org/protobuf v1.36.6 // indirect
|
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
howett.net/plist v1.0.1 // indirect
|
|
modernc.org/libc v1.66.3 // indirect
|
|
modernc.org/mathutil v1.7.1 // indirect
|
|
modernc.org/memory v1.11.0 // indirect
|
|
modernc.org/sqlite v1.38.2 // indirect
|
|
)
|