Yash Agarwal

Posts in ‘Go + gRPC + OPA’ series (3)

Go + gRPC + OPA - A Perfect Union - Part 3

I finished my last post with the following issue - Now, here one problem arises, how to make sure that the search results will not return any book which the user is not authorized to access. We will solve this problem using OPA in the next and last post of this series. Let’s solve this issue now. We will use OPA’s declarative language, Rego, to implement policies which will decide on the basis of some user-provided data, which all objects are to be returned to the user.

Go + gRPC + OPA - A Perfect Union - Part 2

In the last post, we discussed about the structure of our library application. In this post, we will define the data definitions using protobuf, and then we will use these definitions to create a Go service. We will also add a REST interface to the service. So let’s get started. Defining Proto Definitions gRPC uses protocol buffers for serializing structured data. To define the structure of the data that you want to serialize, we use a proto file - it is a simple text file that contains all the logical pieces of your data in the form of messages, and the methods that will be called over the network.

Go + gRPC + OPA - A Perfect Union - Part 1

TL;DR – In a series of blog posts, I will be implementing a simple library application supporting both gRPC and REST interfaces using Go, gRPC, and OPA. My approach might not be the most optimal one, but I am learning these technologies currently. Please give your valuable suggestions and be kind :) I have been learning the basics of microservices and Golang lately. On the work front, I got a chance to work on Go, gRPC, and Open Policy Agent as my first professional project.