elixir-grpc / grpc-reflection

elixir graph reflection support
Apache License 2.0
9 stars 6 forks source link

Add agent-based service for preloading reflection lookup #1

Closed mjheilmann closed 9 months ago

mjheilmann commented 9 months ago

The current reflection server is completely dynamic. While anyone querying the server could only naturally discover the types that are attached to our configured services, and we guard against service names and service methods, this will allow for any query to request, and get, a file response for types that are not part of the currently exposed services.

This PR adds an Agent to calculate the types, symbols, and filenames we should expose. This has the following effects:

  1. Runtime lookup of symbols can become much faster and less intensive as they are a simple lookup against the agent instead of a search+build operation (up to Agent throughput limits)
  2. Symbols and Filenames that we will respond with will be restricted to only the types and symbols exposed by the descriptor trees of our configured services
  3. The services that we support is now runtime configurable, by updating the Application.env and then updating the Agent, we now support growing or shrinking the reflected services dynamically -- provided the new services are complete with descriptors