Skip to content

feat: add /version endpoint and global X-Minder-Version header#6358

Open
DharunMR wants to merge 1 commit intomindersec:mainfrom
DharunMR:add-version-endpoint
Open

feat: add /version endpoint and global X-Minder-Version header#6358
DharunMR wants to merge 1 commit intomindersec:mainfrom
DharunMR:add-version-endpoint

Conversation

@DharunMR
Copy link
Copy Markdown
Contributor

@DharunMR DharunMR commented Apr 13, 2026

Summary

This PR addresses the need to easily expose the Minder server's build version and commit hash for tooling and debugging purposes, as requested. It introduces a dedicated, unauthenticated /api/v1/version endpoint and adds a global gRPC Unary Interceptor to stamp the server version on all incoming HTTP/gRPC responses.

Changes Included

  • Protobuf: Added GetVersion RPC to HealthService mapped to GET /api/v1/version. Configured rpc_options to allow unauthenticated access (TARGET_RESOURCE_NONE).
  • Server Handler: Implemented the GetVersion logic to return constants.CLIVersion and constants.Revision.
  • Global Header: Created VersionHeaderInterceptor to inject the X-Minder-Version header into the response metadata for all requests.
  • Telemetry Fix: Replaced the hardcoded "v0.1.0" service version in initMetrics with the dynamic constants.CLIVersion.

How I Tested This

  1. Verified the new endpoint returns the correct JSON payload and header:
    curl -i http://localhost:8080/api/v1/version
  2. Verified that the global header is successfully injected into other pre-existing endpoints:
    curl -I http://localhost:8080/api/v1/health

swappy-20260413_210156
swappy-20260413_211745

@DharunMR DharunMR requested a review from a team as a code owner April 13, 2026 15:49
@DharunMR DharunMR force-pushed the add-version-endpoint branch from c44ed8f to a1bff3a Compare April 13, 2026 15:53
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 13, 2026

Coverage Status

coverage: 59.402% (+0.01%) from 59.39% — DharunMR:add-version-endpoint into mindersec:main

Signed-off-by: DharunMR <maddharun56@gmail.com>
@DharunMR DharunMR force-pushed the add-version-endpoint branch from a1bff3a to 4ade151 Compare April 13, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a "/version" endpoint for Minder server

2 participants