go-saas / kit

Microservice compatible starter kit for golang saas project
https://go-saas.github.io/kit/
Apache License 2.0
195 stars 37 forks source link

Initial docs #5

Closed goxiaoy closed 11 months ago

ppusapati commented 2 years ago

What is the purpose of remote folder in user service?

goxiaoy commented 2 years ago

@ppusapati remote is merged into api now

[Previous design]: remote folder is to explictly separate different calls from self or other services. for example:

in session refresh flow

if this happens in service user

graph TD
    A[User] --> B[User-RefreshTokenProvider: AuthServiceServer < local function call>]  -->C[User: AuthService] -->E[User: Set Cookie]

if this happens in gateway

graph TD
    A[Gateway] --> B[Gateway-RemoteRefreshTokenProvider: AuthServiceClient  < grpccall user>] -->C[User: AuthService]  -->E[Gateway: Set Cookie]

(This behavior can be observed by tracing)

Most of codes should be reusable for maintaining

[Current design]: with the protoc-gen-go-grpc-proxy

the second call is replaced with

graph TD
    A[Gateway] --> B[Gateway-RefreshTokenProvider: AuthServiceServer < proxy AuthServiceClient as AuthServiceServer>]-->C[User: AuthService] -->E[Gateway: Set Cookie]