authz: update user emails and groups caches in perforce authz provider
Created by: sashaostrikov
Follow up to https://github.com/sourcegraph/sourcegraph/pull/38415
This PR adds updates of user emails and groups caches, which are currently only filled during application startup.
It uses mutexes to exclude the possibility of unexpected surprises (panics) in future due to concurrent operations on these maps when perforce code is more widely used.
Also two new methods of Provider
are introduced: excludeGroupMembers
and includeGroupMembers
. They are added so that the code which accesses caches (and mutexes) is contained within Provider and perforce.go
file.
Test plan
Existing test cases should pass