File tree Expand file tree Collapse file tree 8 files changed +24
-14
lines changed
data/extension/init/templates/tinygo
envoy.access_loggers/default
envoy.filters.http/default
envoy.filters.network/default Expand file tree Collapse file tree 8 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 44
55require (
66 github.com/stretchr/testify v1.6.1
7- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8
7+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757
88)
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
66github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0 =
77github.com/stretchr/testify v1.6.1 /go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg =
8- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 h1:Epa+Lnq1Erqpsv8T9gQBUaIxIhn9iG2Orrqv/UuwrnQ =
9- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 /go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY =
8+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 h1:97z8twAIBLEll7HkPHVaMCLs/+OyzCJyazAFTCiHKhA =
9+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 /go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY =
1010gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
1111gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
1212gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo =
Original file line number Diff line number Diff line change 44
55require (
66 github.com/stretchr/testify v1.6.1
7- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8
7+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757
88)
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
66github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0 =
77github.com/stretchr/testify v1.6.1 /go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg =
8- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 h1:Epa+Lnq1Erqpsv8T9gQBUaIxIhn9iG2Orrqv/UuwrnQ =
9- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 /go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY =
8+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 h1:97z8twAIBLEll7HkPHVaMCLs/+OyzCJyazAFTCiHKhA =
9+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 /go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY =
1010gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
1111gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
1212gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo =
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ ENVOY=ISTIO`
2121 defer host .Done ()
2222
2323 // Call OnPluginStart -> the metric is initialized.
24- host .StartPlugin ()
24+ status := host .StartPlugin ()
25+ // Check the status returned by OnNewConnection is ActionContinue.
26+ require .Equal (t , types .OnPluginStartStatusOK , status )
2527
2628 // Create http context.
2729 contextID := host .InitializeHttpContext ()
@@ -31,10 +33,14 @@ ENVOY=ISTIO`
3133 {"key1" , "value1" },
3234 {"key2" , "value2" },
3335 }
34- host .CallOnRequestHeaders (contextID , hs , false )
36+ action := host .CallOnRequestHeaders (contextID , hs , false )
37+ // Check the action returned by OnRequestHeaders is Continue.
38+ require .Equal (t , types .ActionContinue , action )
3539
3640 // Call OnHttpResponseHeaders.
37- host .CallOnResponseHeaders (contextID , nil , false )
41+ action = host .CallOnResponseHeaders (contextID , nil , false )
42+ // Check the action returned by OnResponseHeaders is Continue.
43+ require .Equal (t , types .ActionContinue , action )
3844
3945 // Check Envoy logs.
4046 logs := host .GetLogs (types .LogLevelInfo )
Original file line number Diff line number Diff line change 44
55require (
66 github.com/stretchr/testify v1.6.1
7- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8
7+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757
88)
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
66github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0 =
77github.com/stretchr/testify v1.6.1 /go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg =
8- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 h1:Epa+Lnq1Erqpsv8T9gQBUaIxIhn9iG2Orrqv/UuwrnQ =
9- github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 /go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY =
8+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 h1:97z8twAIBLEll7HkPHVaMCLs/+OyzCJyazAFTCiHKhA =
9+ github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 /go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY =
1010gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
1111gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
1212gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo =
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ func TestNetworkFilter_OnNewConnection(t *testing.T) {
1919 defer host .Done ()
2020
2121 // Initialize the plugin and read the config.
22- host .StartPlugin ()
22+ status := host .StartPlugin ()
23+ // Check the status returned by OnPluginStart is OK.
24+ require .Equal (t , types .OnPluginStartStatusOK , status )
2325
2426 // OnNewConnection is called.
2527 host .InitializeConnection ()
@@ -41,7 +43,9 @@ func TestNetworkFilter_counter(t *testing.T) {
4143 host .StartPlugin ()
4244
4345 // Establish the connection.
44- contextID := host .InitializeConnection ()
46+ contextID , action := host .InitializeConnection ()
47+ // Check the status returned by OnNewConnection is ActionContinue.
48+ require .Equal (t , types .ActionContinue , action )
4549
4650 // Call OnDone on contextID -> increment the connection counter.
4751 host .CompleteConnection (contextID )
You can’t perform that action at this time.
0 commit comments