restate
restate copied to clipboard
Support sending headers in call/backgroundCall
Right now there is not way to support sending Metadata in call/backgroundCall. This is especially problematic to support things such as AuthN/AuthZ between services.
- [ ] Implement the changes in the service-protocol messages to send the metadata
- [ ] Define how the callee should receive the
Metadata(header?StartMessage?) - [ ] Implement the logic to propagate metadata in the invoker
- [ ] Implement the SDK API to send metadata
- [ ] Implement the SDK API to receive metadata
API Proposal
Java
Overload the call methods (including one way call and delayed call) to accept Metadata (the headers struct from gRPC):
var myClient = Greeter.newRestateClient()
myClient.greet()
myClient.greet(Metadata)
And/or add the Metadata as arguments when creating a client (this is more idiomatic for gRPC users, as that's how it works for Channels):
var myClient = Greeter.newRestateClient(metadata)
myClient.greet()
Typescript
Because we don't control the code generation, I guess we can only develop a solution where the metadata are passed through the client:
var myClient = new GreeterClientImpl(ctx.channel(metadata))
myClient.greet()