You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GetProperty call returns no output. This is in a network WASM filter.
I can tell the WASM filter is receiving data, because GetDownstreamData returns the data from downstream.
What is your Envoy/Istio version?
Envoy 1.26
What is the SDK version?
v0.22.0
What is your TinyGo version?
tinygo version 0.27.0 darwin/amd64 (using go version go1.20.3 and LLVM version 15.0.0)
URL or snippet of your code including Envoy configuration
package main
import (
"github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm""github.com/tetratelabs/proxy-wasm-go-sdk/proxywasm/types"
)
funcmain() {
proxywasm.SetVMContext(&vmContext{})
}
typevmContextstruct {
types.DefaultVMContext
}
func (c*vmContext) NewPluginContext(contextIDuint32) types.PluginContext {
return&pluginContext{}
}
typepluginContextstruct {
// Embed the default plugin context here,// so that we don't need to reimplement all the methods.
types.DefaultPluginContext
}
typenetworkContextstruct {
types.DefaultTcpContext
}
// Override types.DefaultPluginContext.func (ctx*pluginContext) NewTcpContext(contextIDuint32) types.TcpContext {
return&networkContext{}
}
func (ctx*networkContext) OnNewConnection() types.Action {
proxywasm.LogInfo("New connection!")
returntypes.ActionContinue
}
func (ctx*networkContext) OnDownstreamData(dataSizeint, endOfStreambool) types.Action {
ifdataSize==0 {
returntypes.ActionContinue
}
data, err:=proxywasm.GetDownstreamData(0, dataSize)
iferr!=nil&&err!=types.ErrorStatusNotFound {
proxywasm.LogCriticalf("failed to get downstream data: %v", err)
returntypes.ActionContinue
}
proxywasm.LogInfof(">>>>>> downstream data received >>>>>>\n%s", string(data))
vmConfiguration, err:=proxywasm.GetVMConfiguration()
proxywasm.LogInfof("vm configuration: %v", vmConfiguration)
certFound:=false// Connection attributes at:// https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes#connection-attributesrequestScheme, err:=proxywasm.GetProperty([]string{"request", "scheme"})
proxywasm.LogInfof("Request scheme: %s", string(requestScheme))
connectionId, err:=proxywasm.GetProperty([]string{"connection", "id"})
proxywasm.LogInfof("mTLS?: %s", connectionId)
connectionMtls, err:=proxywasm.GetProperty([]string{"connection", "mtls"})
proxywasm.LogInfof("mTLS?: %v", connectionMtls)
subjectPeerCert, err:=proxywasm.GetProperty([]string{"connection", "subject_peer_certificate"})
iferr!=nil {
proxywasm.LogWarnf("Failed to get downstream subject peer cert: %v", err)
} else {
proxywasm.LogInfof("subject peer cert: %s", string(subjectPeerCert))
certFound=true
}
dnsSanPeerCert, err:=proxywasm.GetProperty([]string{"connection", "dns_san_peer_certificate"})
iferr!=nil {
proxywasm.LogWarnf("Failed to get downstream DNS SAN peer cert: %v", err)
} else {
proxywasm.LogInfof("DNS SAN peer cert: %s", string(dnsSanPeerCert))
certFound=true
}
uriSanPeerCert, err:=proxywasm.GetProperty([]string{"connection", "uri_san_peer_certificate"})
iferr!=nil {
proxywasm.LogWarnf("Failed to get downstream URI SAN peer cert: %v", err)
} else {
proxywasm.LogInfof("URI SAN peer cert: %s", string(uriSanPeerCert))
certFound=true
}
pluginVmId, err:=proxywasm.GetProperty([]string{"plugin_vm_id"})
proxywasm.LogInfof("plugin vm id: %v", pluginVmId)
connectionInfo, err:=proxywasm.GetPropertyMap([]string{"connection"})
proxywasm.LogInfof("connection info: %v", connectionInfo)
if!certFound {
proxywasm.LogWarnf("No peer cert found!")
}
returntypes.ActionContinue
}
// Override types.DefaultTcpContext.func (ctx*networkContext) OnDownstreamClose(types.PeerType) {
proxywasm.LogInfo("downstream connection close!")
return
}
Describe the bug / error
GetProperty
call returns no output. This is in a network WASM filter.I can tell the WASM filter is receiving data, because
GetDownstreamData
returns the data from downstream.What is your Envoy/Istio version?
Envoy 1.26
What is the SDK version?
v0.22.0
What is your TinyGo version?
tinygo version 0.27.0 darwin/amd64 (using go version go1.20.3 and LLVM version 15.0.0)
URL or snippet of your code including Envoy configuration
envoy.yaml:
Additional context (Optional)
Log output from Envoy/WASM:
The text was updated successfully, but these errors were encountered: