Creating interceptors

The helping-hands.order.core namespace defines all the interceptors that are used for the routes of the Order microservice. The Auth interceptor is the generic interceptor that reads the token and updates the user ID field :uid for the Order routes to get all the orders for an authenticated user. For simplicity of the implementation, the Auth interceptor assumes that the token passed in the header is set to the consumer ID.

The validation interceptor for Order routes validates both service ID and the provider ID of the order to make sure that both provider and service are registered with the Helping Hands application and the same provider provides the specified service. The service-exists?provider-exists?, and consumer-exists? ...

Get Microservices with Clojure now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.