feature(std-http-server): option to inject request metadata into context
Added an option to inject request metadata into the context for the std-http-server. This will be useful for downstream logging, metrics, tracing, observability, and custom authorization implementations.
Checklist:
- All
makecommands (tidy,test,generate, andlint) have been run ✅ - Default is
false/off to preserve existing behavior ✅ - Added test cases and mock std-http-server ✅
- Generated code has been committed for review ✅
Example:
// set the option to enable metadata context injection
han := oapi.HandlerWithOptions(srv, StdHTTPServerOptions{
WithRequestMetadata: true,
})
// get the injected metadata from the context
md := oapi.RequestMetadataFromContext(ctx)
opID := md.OperationID
path := md.RequestRoute
Kusari Analysis Results:
✅ No Flagged Issues Detected
All values appear to be within acceptable risk parameters.
No pinned version dependency changes, code issues or exposed secrets detected!
[!NOTE] View full detailed analysis result for more information on the output and the checks that were run.
@kusari-inspector rerun - Trigger a re-analysis of this PR @kusari-inspector feedback [your message] - Send feedback to our AI and team See Kusari's documentation for setup and configuration. Commit: 54c773c31bfdb55557dbb19413cd091ca8ad3293, performed at: 2025-09-28T04:16:46Z
Found this helpful? Give it a 👍 or 👎 reaction!
Kusari PR Analysis rerun based on - c19ae607bfd14104cbb49f8124b541d6588f0cde performed at: 2025-09-13T21:06:03Z - link to updated analysis
Kusari PR Analysis rerun based on - 54c773c31bfdb55557dbb19413cd091ca8ad3293 performed at: 2025-09-28T04:17:03Z - link to updated analysis