Authentication and Authorisation of gRPC
I have being posting lots of tech stuff related to DevOps, Development but mostly I have being posting a lot about Golang
Hi everyone I hope you are doing great
last post I made was how to enable gRPC to work with regular Restful http/1 apis through gRPC gateway
gRPC Gateway is a tool that serves as a reverse proxy to translate between HTTP/1 (REST) and gRPC
It allows you to expose your gRPC services over HTTP/1, making it easier for clients that use traditional RESTful APIs to interact with gRPC-based services.
To use gRPC Gateway, you typically define your API in Protobuf, generate gRPC service code and gRPC Gateway code, and then configure the gateway to route HTTP/1 requests to the appropriate gRPC services. This allows you to leverage the benefits of gRPC while still accommodating clients that rely on traditional HTTP/1 REST APIs.
and with that following this https://github.com/grpc-ecosystem/grpc-gatewayy
you will be able to have a gRPC up and running in no time.
Authorisation of apis
From the first photo you can see me checking various scenarios of authorisation, but its far from complete some more configuration are needed for RBAC kind of authorisation but as of now it ensures that the user is authorised to access the system
I have built and a Micro service with Hexagonal architecture aka port and adapters and within it I have embedded gRPC. check it out at https://github.com/myrachanto/grpc-and-ddd