Set user
on the X-Ray segment from ASGI scope or framework's request
#15
Labels
enhancement
New feature or request
If the X-Ray middleware is called after any authentication/session middleware, then the ASGI scope will probably contain some sort of reference to the authenticated user, which we can use to automatically set the user field on the Segment.
Here's some examples of how different web frameworks set the user:
payload
)AuthenticationMiddleware
(see below), and also adds asecret_token_user
key to the scope.AuthenticationMiddleware
adds auser
key to the scope and auser
attribute on the request. So any ofscope["user"].display_name
orrequest.user.display_name
is correct (but also checkuser.is_authenticated
)The text was updated successfully, but these errors were encountered: