Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: log the impersonator #642

Closed
hunhejj opened this issue Jun 21, 2022 · 5 comments · Fixed by #647
Closed

Feature Request: log the impersonator #642

hunhejj opened this issue Jun 21, 2022 · 5 comments · Fixed by #647

Comments

@hunhejj
Copy link

hunhejj commented Jun 21, 2022

It would be helpful if the impersonator's username was also logged as a tag on a request similar to the authenticated user.

@hunhejj hunhejj changed the title Log the impersonator Feature Request: log the impersonator Jun 21, 2022
@Jean85
Copy link
Collaborator

Jean85 commented Jun 21, 2022

Just to be clear, we're talking about this: https://symfony.com/doc/4.4/security/impersonating_user.html

I'm scrolling through the feature, and we would have to handle it in two ways since in 4.3 they changed/deprecated how to get the impersonated user: https://symfony.com/blog/new-in-symfony-4-3-deprecated-the-role-and-switchuserrole-classes

Anyway, happy to accept a PR on this!

@hunhejj
Copy link
Author

hunhejj commented Jun 21, 2022

Thanks for adding more context @Jean85.

I hope I will find some time creating a PR for this, we will see. Meanwhile a question: would you suggest to add the impersonator's username as a tag or as a metadata of the user?

@Jean85
Copy link
Collaborator

Jean85 commented Jun 21, 2022

IMHO, we could put it as a tag, since the addition would be done only when a user is actually impersonating another user; the normal user is already a tag on its own.

But I would like more input on this... @ste93cry WDYT?

@ste93cry
Copy link
Collaborator

I agree too, logging the impersonator's username as a tag means that it can also be searched (tags are indexed, extras are not), so it can be useful and we keep consistency with where we log the user.

@github-actions

This comment was marked as outdated.

@Jean85 Jean85 linked a pull request Jul 13, 2022 that will close this issue
@ste93cry ste93cry added this to the 4.4 milestone Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants