koding / kite

Micro-service framework in Go
https://godoc.org/github.com/koding/kite
MIT License
3.26k stars 300 forks source link

kite: scrubbing misses dnode.Functions in embedded structs #212

Open rjeczalik opened 6 years ago

rjeczalik commented 6 years ago

When a value of the following struct is sent to server and Callback is a valid dnode.Function value, server correctly scrubs the value:

type Req struct {
    Callback dnode.Function
}

However if client sends a value of the following type:

type WrappedReq struct {
    Req
}

With a valid Callback field, the very same field is incorrectly unmarshaled / scrubbed server-side, thus rendering the callback unusable.