feat(controller): Add authtoken public id to request context

This allows for http middleware handler functions that run later in the
handler function stack to have access to the extracted auth token public
id.
This commit is contained in:
Timothy Messier committed 2023-12-04 16:24:04 +00:00
1 parent 059d4992de
commit e337cf8f69
2 files changed
+6

No files matched your search

+1
View File
@@ -411,6 +411,7 @@ func wrapHandlerWithCommonFuncs(h http.Handler, c *Controller, props HandlerProp
}
requestInfo.PublicId, requestInfo.EncryptedToken, requestInfo.TokenFormat = auth.GetTokenFromRequest(ctx, c.kms, r)
ctx = context.WithValue(ctx, globals.ContextAuthTokenPublicIdKey, requestInfo.PublicId)
if info, ok := event.RequestInfoFromContext(ctx); ok {
// piggyback some eventing fields with the auth info proto message