De-serialization without protobu - protocol-buffers

Using protobuf I am able to serialize data. I need to send this serialzed packet to different location. As I know I need protobuf again to de-serialize the data.
Is there a way in which we can de-serialize data without using full protobuf library or maybe a minimum version of protobuf.
TIA...

Once you have generated the serialization and deserialization code you don't need the protoBuff library. The ParseFromIstream() method is all you need.
From what I've read you never actually import Protobuf, you just run it to generate code that is dropped into the project. The generated code does not require the program that generated it.

Related

OperationCanceledException: Read was canceled on underlying PipeReader

am getting this type of error while moving to NET 6.0
Grpc.Core.RpcException : Status(StatusCode="Unknown", Detail="Exception was thrown by handler. OperationCanceledException: Read was canceled on underlying PipeReader.")
package: Google.Protobuf v (3.21.12)
NET 6.0
I tried different solution while downgrading the version of the package
but still facing the same issue
Message SOMETHING doesn't provide the generated method that enables WriteContext-based serialization. You might need to regenerate the generated protobuf code.
This comes from here
The problem here is that you're using (significantly) older generated code which does not support the pipe APIs; you should regenerate the code from the .proto, after updating protoc or Grpc.Tools or whatever mechanism you've used to turn the .proto schema into C#. This must include any nested message types; the SOMETHING in the above message tells you about any that are still needed.

marshal protoreflect.MessageDescriptor

I am trying, in the line of google.golang.org/grpc/reflection to marshall a protoreflect.MessageDescriptor. The idea is to have a server serving protoreflect.MessageDescriptor to a client.
The client would use the protoreflect.MessageDescriptor with dynamicpb.NewMessage to instanciate protobuf messages.
I am not able to marshal protoreflect.MessageDescriptor because it does not implement ProtoReflect(). It does not seem to be possible to marshall it and "send" it on the wire.
Anyone has tried that already? Am I trying to do something forbidden by design in the go implementation of GRPC?
I believe you want to be using DescriptorProto in your protocol, not a protoreflect.MessageDescriptor. There are conversion functions in the protodesc package like: https://pkg.go.dev/google.golang.org/protobuf/reflect/protodesc#ToDescriptorProto

Sort xml payload in Golang

I have one project in aws lambda in Golang.
There we are using aws-api-gateway to accept rest api.
I wanted to sort the xml payload based on element coming from the user side.
But the problem is unmarshalling the xml payload is not allowed.
I see somewhere that I can use xslt processor to sort the xml. But I’m unable to use this go package(github.com/wamuir/go-xslt) as it requires me to install some extra packages which is not in go. And our platform-team will not allowed it.
Is there any other go package that I can use.

Paw: Possible to copy/paste data from Hash/Dictionary source in target language?

I'm using Paw to integrate with an API and it's a great tool, but the codebase I'm working in has lots of data in Ruby Hashes already that I would like to bring into Paw for testing. Moreover, I would like to be able to copy the data out of a Paw response for use in Ruby code rather than having to copy JSON and either store it as a String and parse it in my code or manually convert it to a native dictionary data structure. Is this possible?

react native - validate source using digital signature with JWS, bcrypt or react-native-crypto

I am looking for a way to validate the source of a data in my React Native application.
The application receive data in JSON format and I want to validate its source.
I don't need to encrypt the data itself but I want to process only validated data otherwise I will notify the user the data is not originated from a valid source.
I am using RN version 0.45.1
EDIT
I've read that its not a good idea to use JWS, for example:
https://paragonie.com/blog/2017/03/jwt-json-web-tokens-is-bad-standard-that-everyone-should-avoid
but instead use 'react-native-bcrypt' or 'react-native-crypto', the second package is faster??
After a lot of searching I found this solution:
https://github.com/kjur/jsrsasign
this library provides ways to:
generate:
https://kjur.github.io/jsrsasign/api/symbols/KEYUTIL.html#.generateKeypair
sign and verify:https://kjur.github.io/jsrsasign/api/symbols/KJUR.crypto.Signature.html#constructor:
and many more...

Resources