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
Hi, I got several issues in nameko_grpc context/metadata processing.
I don't see any reason why there is METADATA_PREFIX hardcoded? It causing problem, that all our custom headers have this prefix, which is not desired.
There is not correctly working encoding values. Strings are encoded two times.
There is definitely issue in context_data_from_metadata because there is decode_value(value) only in one part of if/else block. I am not sure, about what is correct, but for my case there should not be any decoding. I think that decode is already done by that time.
The text was updated successfully, but these errors were encountered:
Thank you for raising this. The metadata module was added quite hastily, so the issues you've found are not too surprising.
I think the confusion here is that Nameko has its own concept of context (context_data) and we are trying to persist that object through the gRPC headers. Each item in Nameko's context_data is JSON-serialised (whether it needs to be or not) because Nameko supports rich objects like lists in each key.
The METADATA_PREFIX is there so the context data object can be reconstructed on the other side if the target is a Nameko service.
This is the reason for the asymmetrical decode -- only keys with the METADATA_PREFIX have been JSON-encoded on the way in.
Hi, I got several issues in nameko_grpc context/metadata processing.
I don't see any reason why there is METADATA_PREFIX hardcoded? It causing problem, that all our custom headers have this prefix, which is not desired.
There is not correctly working encoding values. Strings are encoded two times.
There is definitely issue in
context_data_from_metadata
because there is decode_value(value) only in one part of if/else block. I am not sure, about what is correct, but for my case there should not be any decoding. I think that decode is already done by that time.The text was updated successfully, but these errors were encountered: