Hi,
It definitely makes sense to avoid duplicating code everywhere.
You should look(for the server side) at implementing a grpc::AuthMetadataProcessor.
This allows to access the `auth_metadata`, which can be used to pass whatever you want between your clients and the server, via the headers.
In it, you also have access to the `:path` if you want to auth or not based on the route.
For java client you can add the headers with CallCredentials.
And using c++ that would be a `grpc::MetadataCredentialsPlugin`.
The doc is indeed a bit sparse on this.
You can look at test/cpp/end2end/end2end_test.cc for inspiration, and some other tests.
Good luck