SEC-001: 移除硬编码"123456"测试码 - 修改DefaultSMSVerifier.Verify返回错误,强制要求配置真实SMS服务 - 添加ErrSMSServiceNotConfigured错误定义 - 更新相关测试使用mock SMS verifier SEC-003: 添加IP欺骗防护 - AuthConfig添加TrustedProxies配置项 - getClientIP添加可信代理验证参数 - 仅在请求来自可信代理时信任X-Forwarded-For头 - 添加isTrustedProxy和containsCIDR辅助函数 架构重构: - 创建internal/adapter包,包含存储适配器 - 创建internal/outbox包,包含OutboxProcessorRunner - 创建internal/compensation包,包含补偿执行器 - main.go从891行减少到349行 TDD方法: - 为每个修复编写测试用例 - 测试通过后再提交代码
45 lines
1.7 KiB
Modula-2
45 lines
1.7 KiB
Modula-2
module lijiaoqiao/supply-api
|
|
|
|
go 1.21
|
|
|
|
require (
|
|
github.com/DATA-DOG/go-sqlmock v1.5.2
|
|
github.com/golang-jwt/jwt/v5 v5.2.0
|
|
github.com/google/uuid v1.6.0
|
|
github.com/jackc/pgx/v5 v5.5.1
|
|
github.com/redis/go-redis/v9 v9.4.0
|
|
github.com/spf13/viper v1.18.2
|
|
github.com/stretchr/testify v1.8.4
|
|
)
|
|
|
|
require (
|
|
github.com/cespare/xxhash/v2 v2.2.0 // 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/fsnotify/fsnotify v1.7.0 // indirect
|
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
|
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
|
|
github.com/jackc/puddle/v2 v2.2.1 // indirect
|
|
github.com/magiconair/properties v1.8.7 // indirect
|
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
|
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
|
github.com/spf13/afero v1.11.0 // indirect
|
|
github.com/spf13/cast v1.6.0 // indirect
|
|
github.com/spf13/pflag v1.0.5 // indirect
|
|
github.com/subosito/gotenv v1.6.0 // indirect
|
|
go.uber.org/atomic v1.9.0 // indirect
|
|
go.uber.org/multierr v1.9.0 // indirect
|
|
golang.org/x/crypto v0.18.0 // indirect
|
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
|
golang.org/x/sync v0.6.0 // indirect
|
|
golang.org/x/sys v0.16.0 // indirect
|
|
golang.org/x/text v0.14.0 // indirect
|
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
)
|