feat: add /version endpoint and global X-Minder-Version header#6358
Open
DharunMR wants to merge 1 commit intomindersec:mainfrom
Open
feat: add /version endpoint and global X-Minder-Version header#6358DharunMR wants to merge 1 commit intomindersec:mainfrom
DharunMR wants to merge 1 commit intomindersec:mainfrom
Conversation
c44ed8f to
a1bff3a
Compare
Signed-off-by: DharunMR <maddharun56@gmail.com>
a1bff3a to
4ade151
Compare
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
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/versionendpoint and adds a global gRPC Unary Interceptor to stamp the server version on all incoming HTTP/gRPC responses.Changes Included
GetVersionRPC toHealthServicemapped toGET /api/v1/version. Configuredrpc_optionsto allow unauthenticated access (TARGET_RESOURCE_NONE).GetVersionlogic to returnconstants.CLIVersionandconstants.Revision.VersionHeaderInterceptorto inject theX-Minder-Versionheader into the response metadata for all requests."v0.1.0"service version ininitMetricswith the dynamicconstants.CLIVersion.How I Tested This
curl -i http://localhost:8080/api/v1/versioncurl -I http://localhost:8080/api/v1/health