@@ -155,6 +155,62 @@ var configList = []TestConfig{
155155 unix : 1111 ,
156156 rateLimitKeyExpected : "nicktest:kong:customratelimit:111:qps:1111" ,
157157 },
158+ {
159+ input : Config {
160+ QPS : 30 ,
161+ Log : true ,
162+ LimitResourcesJson : jsonStr ,
163+ RedisHost : redisHostRight ,
164+ RedisAuth : redisAuthRight ,
165+ RedisTimeoutSecond : 2 ,
166+ RedisDB : 0 ,
167+ RedisLimitKeyPrefix : "nicktest" ,
168+ HideClientHeader : false ,
169+ },
170+ confExpected : "Key: 'Config.RedisPort' Error:Field validation for 'RedisPort' failed on the 'required' tag" ,
171+ prefixExpected : "nicktest:kong:customratelimit" ,
172+ identifier : "username-nick" ,
173+ unix : 1600067356 ,
174+ rateLimitKeyExpected : "nicktest:kong:customratelimit:username-nick:qps:1600067356" ,
175+ },
176+ {
177+ input : Config {
178+ QPS : 30 ,
179+ Log : true ,
180+ LimitResourcesJson : jsonStr ,
181+ RedisHost : redisHostRight ,
182+ RedisPort : 0 ,
183+ RedisAuth : redisAuthRight ,
184+ RedisTimeoutSecond : 2 ,
185+ RedisDB : 0 ,
186+ RedisLimitKeyPrefix : "nicktest" ,
187+ HideClientHeader : false ,
188+ },
189+ confExpected : "Key: 'Config.RedisPort' Error:Field validation for 'RedisPort' failed on the 'required' tag" ,
190+ prefixExpected : "nicktest:kong:customratelimit" ,
191+ identifier : "username-nick" ,
192+ unix : 1600067356 ,
193+ rateLimitKeyExpected : "nicktest:kong:customratelimit:username-nick:qps:1600067356" ,
194+ },
195+ {
196+ input : Config {
197+ QPS : 30 ,
198+ Log : true ,
199+ LimitResourcesJson : jsonStr ,
200+ RedisHost : redisHostRight ,
201+ RedisPort : 65536 ,
202+ RedisAuth : redisAuthRight ,
203+ RedisTimeoutSecond : 2 ,
204+ RedisDB : 0 ,
205+ RedisLimitKeyPrefix : "nicktest" ,
206+ HideClientHeader : false ,
207+ },
208+ confExpected : "Key: 'Config.RedisPort' Error:Field validation for 'RedisPort' failed on the 'lte' tag" ,
209+ prefixExpected : "nicktest:kong:customratelimit" ,
210+ identifier : "username-nick" ,
211+ unix : 1600067356 ,
212+ rateLimitKeyExpected : "nicktest:kong:customratelimit:username-nick:qps:1600067356" ,
213+ },
158214 {
159215 input : Config {
160216 QPS : 30 ,
0 commit comments