feat(host): expose JWKS and monitoring services over gRPC - #46
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the placeholder
GreeterServicewith real gRPC surfaces for the host's public key store and monitoring, backs both the REST and gRPC monitoring endpoints with single shared aggregation layer (no duplicated health logic), fixes two DevTools gRPC UI issues (TLS less target resolution and empty request bodies), and lands the fullExamplePluginreference plugin that exercises every hook in the plugin contract.Host gRPC: JWKS and Monitoring services
protos/jwks.proto-Jwksservice exposingGetJwks,GetKeyByKid,GetJwksHealth, andGetJwksStats(mirrors the RESTJwksController)protos/monitoring.proto-Monitoringservice exposingGetHealth(key store + per plugin health) andGetMetrics(process uptime/start)JwksServiceandMonitoringServiceimplementations;GreeterServiceandgreet.protoremovedHost.Grpcto avoid shadowing the REST DTOs inHost.KeyManagement.Restful.DTO.ResponseShared monitoring layer (
Host.Monitoring)HealthReportServiceaggregates key store health and every loaded plugin's health check into one transport-agnosticHealthResponse/healthand/metricsendpoints (EndpointConfiguration) and the gRPCMonitoringservice now consume the same reports instead of re-implementing the same aggregation twiceMetricsReportServiceproduces the process metrics surfaced by both transportsDevTools gRPC UI fixes
ResolveGrpcTarget()now selectshttpsonly when the Kestrel certificate exists (falls back to plain HTTP/2, h2c), so the in-process gRPC UI can reach the host without TLSGrpcDynamicInvokertreats empty request bodies as{}forgoogle.protobuf.Emptyinputs instead of failing withInvalidProtocolBufferExceptionExamplePlugin (living reference)
src/Plugins/Solutions/ExamplePlugin- small, dependency free plugin implementing the completeIAuthKitPlugincontract:[PluginMetadata], context scoped configuration (ExampleOptions), middleware, endpoints, an API key authentication scheme, structured health checks, a hosted service, and plugin owned gRPC serviceAuthKit.slnx,appsettings.json(Plugins:authkit.example), and the Docker build ships its generatedmanifest.jsonValidation
dotnet build AuthKit.slnxcompletes with zero errorstask generate-manifestproduces the ExamplePlugin manifest;AuthKit.PluginContractValidatorpasses all pluginsResult
The host's key management and health surfaces are reachable over gRPC (and browsable in the DevTools UI under
GRPC_UI_TARGET), monitoring logic lives in one place shared by REST and gRPC, the DevTools gRPC UI works in HTTP and HTTPS setups, and plugin authors have complete reference to copy from.