Locking down service access
Only Restate needs to be able to make requests to your services. The Restate Server will proxy all requests for these services. Therefore, it is advisable to ensure that only Restate can reach your service. Unrestricted access to the services is dangerous. If you’re working with multiple Restate instances, you also may want to check that requests are coming from the right instance. To make this easier, Restate has a native request identity feature which can be used in the SDK to cryptographically verify that requests have come from a particular Restate instance.1
Create a request identity key
- Restate Cloud / BYOC
- Restate OSS
Restate Cloud and BYOC environments create and manage the request identity key for you.Copy the environment’s public key from Developers > Security > HTTP endpoints in the Restate Cloud UI.
2
Validate requests with the public key
Configure your service to use that public key to validate requests. The SDK then rejects discovery and invocation requests that were not signed by the corresponding Restate environment.For a long running service, configure request identity validation on the SDK endpoint:For a TypeScript serverless platform handler, provide the public key to The public key is not secret, so you can include it in your service source code or configuration.
restate.createEndpointHandler instead:Private services
When registering an endpoint, every service is by default reachable via HTTP requests to the ingress. You can configure a service asprivate, via the service configuration.
Note that private services can still be invoked by other handlers via the SDK.
Client-side journal encryption
The TypeScript SDK has experimental support for client-side journal value encryption. It lets the SDK encrypt selected values after serializing them but before sending them to Restate. The codec is applied to:- Handler inputs and successful outputs
- Successful
ctx.runresults - Service call and send parameters, and successful call results
- State values
- Successful awakeable, signal, and workflow promise values
- Successful
ctx.attachresults
JournalValueCodec interface:
restatedev/journal-encryption
Loading repository data...