From 2c9c7ee89dc911debb02edd2ee882161129a4b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Nowak?= Date: Fri, 22 Nov 2024 14:34:12 +0100 Subject: [PATCH] WIP 4 --- tests/integration/sync_test.go | 316 +++++++++++++++++---------------- 1 file changed, 159 insertions(+), 157 deletions(-) diff --git a/tests/integration/sync_test.go b/tests/integration/sync_test.go index 1c21fdfac..44ef593d0 100644 --- a/tests/integration/sync_test.go +++ b/tests/integration/sync_test.go @@ -1388,170 +1388,172 @@ var ( Enabled: kong.Bool(true), Protocols: []*string{kong.String("http"), kong.String("https")}, }, - consumerGroupScopedPluginsKonnect = []*kong.Plugin{ - { - Name: kong.String("rate-limiting-advanced"), - ConsumerGroup: &kong.ConsumerGroup{ - ID: kong.String("77e6691d-67c0-446a-9401-27be2b141aae"), - }, - Config: kong.Configuration{ - "consumer_groups": nil, - "dictionary_name": string("kong_rate_limiting_counters"), - "disable_penalty": bool(false), - "enforce_consumer_groups": bool(false), - "error_code": float64(429), - "error_message": string("API rate limit exceeded"), - "header_name": nil, - "hide_client_headers": bool(false), - "identifier": string("consumer"), - "limit": []any{float64(10)}, - "lock_dictionary_name": string("kong_locks"), - "namespace": string("gold"), - "path": nil, - "redis": map[string]any{ - "cluster_addresses": nil, - "connect_timeout": nil, - "database": float64(0), - "host": nil, - "keepalive_backlog": nil, - "keepalive_pool_size": float64(256), - "password": nil, - "port": nil, - "read_timeout": nil, - "send_timeout": nil, - "sentinel_addresses": nil, - "sentinel_master": nil, - "sentinel_password": nil, - "sentinel_role": nil, - "sentinel_username": nil, - "server_name": nil, - "ssl": false, - "ssl_verify": false, - "timeout": float64(2000), - "username": nil, - }, - "retry_after_jitter_max": float64(1), - "strategy": string("local"), - "sync_rate": float64(-1), - "window_size": []any{float64(60)}, - "window_type": string("sliding"), - }, - Enabled: kong.Bool(true), - Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + + consumerGroupScopedPluginsKonnect = []*kong.Plugin{ + { + Name: kong.String("rate-limiting-advanced"), + ConsumerGroup: &kong.ConsumerGroup{ + ID: kong.String("77e6691d-67c0-446a-9401-27be2b141aae"), }, - { - Name: kong.String("rate-limiting-advanced"), - ConsumerGroup: &kong.ConsumerGroup{ - ID: kong.String("5bcbd3a7-030b-4310-bd1d-2721ff85d236"), - }, - Config: kong.Configuration{ - "consumer_groups": nil, - "dictionary_name": string("kong_rate_limiting_counters"), - "disable_penalty": bool(false), - "enforce_consumer_groups": bool(false), - "error_code": float64(429), - "error_message": string("API rate limit exceeded"), - "header_name": nil, - "hide_client_headers": bool(false), - "identifier": string("consumer"), - "limit": []any{float64(7)}, - "lock_dictionary_name": string("kong_locks"), - "namespace": string("silver"), - "path": nil, - "redis": map[string]any{ - "cluster_addresses": nil, - "connect_timeout": nil, - "database": float64(0), - "host": nil, - "keepalive_backlog": nil, - "keepalive_pool_size": float64(256), - "password": nil, - "port": nil, - "read_timeout": nil, - "send_timeout": nil, - "sentinel_addresses": nil, - "sentinel_master": nil, - "sentinel_password": nil, - "sentinel_role": nil, - "sentinel_username": nil, - "server_name": nil, - "ssl": false, - "ssl_verify": false, - "timeout": float64(2000), - "username": nil, - }, - "retry_after_jitter_max": float64(1), - "strategy": string("local"), - "sync_rate": float64(-1), - "window_size": []any{float64(60)}, - "window_type": string("sliding"), + Config: kong.Configuration{ + "consumer_groups": nil, + "dictionary_name": string("kong_rate_limiting_counters"), + "disable_penalty": bool(false), + "enforce_consumer_groups": bool(false), + "error_code": float64(429), + "error_message": string("API rate limit exceeded"), + "header_name": nil, + "hide_client_headers": bool(false), + "identifier": string("consumer"), + "limit": []any{float64(10)}, + "lock_dictionary_name": string("kong_locks"), + "namespace": string("gold"), + "path": nil, + "redis": map[string]any{ + "cluster_addresses": nil, + "connect_timeout": nil, + "database": float64(0), + "host": nil, + "keepalive_backlog": nil, + "keepalive_pool_size": float64(256), + "password": nil, + "port": nil, + "read_timeout": nil, + "send_timeout": nil, + "sentinel_addresses": nil, + "sentinel_master": nil, + "sentinel_password": nil, + "sentinel_role": nil, + "sentinel_username": nil, + "server_name": nil, + "ssl": false, + "ssl_verify": false, + "timeout": float64(2000), + "username": nil, }, - Enabled: kong.Bool(true), - Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + "retry_after_jitter_max": float64(1), + "strategy": string("local"), + "sync_rate": float64(-1), + "window_size": []any{float64(60)}, + "window_type": string("sliding"), }, - { - Name: kong.String("rate-limiting-advanced"), - Config: kong.Configuration{ - "consumer_groups": nil, - "dictionary_name": string("kong_rate_limiting_counters"), - "disable_penalty": bool(false), - "enforce_consumer_groups": bool(false), - "error_code": float64(429), - "error_message": string("API rate limit exceeded"), - "header_name": nil, - "hide_client_headers": bool(false), - "identifier": string("consumer"), - "limit": []any{float64(5)}, - "lock_dictionary_name": string("kong_locks"), - "namespace": string("silver"), - "path": nil, - "redis": map[string]any{ - "cluster_addresses": nil, - "connect_timeout": nil, - "database": float64(0), - "host": nil, - "keepalive_backlog": nil, - "keepalive_pool_size": float64(256), - "password": nil, - "port": nil, - "read_timeout": nil, - "send_timeout": nil, - "sentinel_addresses": nil, - "sentinel_master": nil, - "sentinel_password": nil, - "sentinel_role": nil, - "sentinel_username": nil, - "server_name": nil, - "ssl": false, - "ssl_verify": false, - "timeout": float64(2000), - "username": nil, - }, - "retry_after_jitter_max": float64(1), - "strategy": string("local"), - "sync_rate": float64(-1), - "window_size": []any{float64(60)}, - "window_type": string("sliding"), + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + { + Name: kong.String("rate-limiting-advanced"), + ConsumerGroup: &kong.ConsumerGroup{ + ID: kong.String("5bcbd3a7-030b-4310-bd1d-2721ff85d236"), + }, + Config: kong.Configuration{ + "consumer_groups": nil, + "dictionary_name": string("kong_rate_limiting_counters"), + "disable_penalty": bool(false), + "enforce_consumer_groups": bool(false), + "error_code": float64(429), + "error_message": string("API rate limit exceeded"), + "header_name": nil, + "hide_client_headers": bool(false), + "identifier": string("consumer"), + "limit": []any{float64(7)}, + "lock_dictionary_name": string("kong_locks"), + "namespace": string("silver"), + "path": nil, + "redis": map[string]any{ + "cluster_addresses": nil, + "connect_timeout": nil, + "database": float64(0), + "host": nil, + "keepalive_backlog": nil, + "keepalive_pool_size": float64(256), + "password": nil, + "port": nil, + "read_timeout": nil, + "send_timeout": nil, + "sentinel_addresses": nil, + "sentinel_master": nil, + "sentinel_password": nil, + "sentinel_role": nil, + "sentinel_username": nil, + "server_name": nil, + "ssl": false, + "ssl_verify": false, + "timeout": float64(2000), + "username": nil, }, - Enabled: kong.Bool(true), - Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + "retry_after_jitter_max": float64(1), + "strategy": string("local"), + "sync_rate": float64(-1), + "window_size": []any{float64(60)}, + "window_type": string("sliding"), }, - { - Name: kong.String("key-auth"), - Config: kong.Configuration{ - "anonymous": nil, - "hide_credentials": false, - "key_in_body": false, - "key_in_header": true, - "key_in_query": true, - "key_names": []interface{}{"apikey"}, - "realm": nil, // This is present on 3.7.x+ - "run_on_preflight": true, + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + { + Name: kong.String("rate-limiting-advanced"), + Config: kong.Configuration{ + "consumer_groups": nil, + "dictionary_name": string("kong_rate_limiting_counters"), + "disable_penalty": bool(false), + "enforce_consumer_groups": bool(false), + "error_code": float64(429), + "error_message": string("API rate limit exceeded"), + "header_name": nil, + "hide_client_headers": bool(false), + "identifier": string("consumer"), + "limit": []any{float64(5)}, + "lock_dictionary_name": string("kong_locks"), + "namespace": string("silver"), + "path": nil, + "redis": map[string]any{ + "cluster_addresses": nil, + "connect_timeout": nil, + "database": float64(0), + "host": nil, + "keepalive_backlog": nil, + "keepalive_pool_size": float64(256), + "password": nil, + "port": nil, + "read_timeout": nil, + "send_timeout": nil, + "sentinel_addresses": nil, + "sentinel_master": nil, + "sentinel_password": nil, + "sentinel_role": nil, + "sentinel_username": nil, + "server_name": nil, + "ssl": false, + "ssl_verify": false, + "timeout": float64(2000), + "username": nil, }, - Enabled: kong.Bool(true), - Protocols: []*string{kong.String("http"), kong.String("https")}, + "retry_after_jitter_max": float64(1), + "strategy": string("local"), + "sync_rate": float64(-1), + "window_size": []any{float64(60)}, + "window_type": string("sliding"), }, - } + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + { + Name: kong.String("key-auth"), + Config: kong.Configuration{ + "anonymous": nil, + "hide_credentials": false, + "key_in_body": false, + "key_in_header": true, + "key_in_query": true, + "key_names": []interface{}{"apikey"}, + "realm": nil, // This is present on 3.7.x+ + "run_on_preflight": true, + }, + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("http"), kong.String("https")}, + }, + }, consumerGroupScopedPlugins381x = []*kong.Plugin{ {