Implementing authorization rotation for static files#4294
Implementing authorization rotation for static files#4294sougou merged 2 commits intovitessio:masterfrom
Conversation
Signed-off-by: avaidyanatha <avaidyanatha@ucsb.edu>
sougou
left a comment
There was a problem hiding this comment.
@demmer has pointed out that there exists a data race between loadConfigFromParams, which sets a.Entries and all the other functions like ValidateHash that read from it.
This race was originally introduced by installSignalHandlers, but this change aggravates it because loadFromConfig is now called every time ValidateHash is invoked. We probably need to introduce a mutex to prevent these races.
Signed-off-by: avaidyanatha <avaidyanatha@ucsb.edu>
|
I think this PR still needs additional work to be robust and safe. Reading through I noticed the following issues:
I think a better pattern for this would be to rework it to safely spin up a goroutine to refresh the config asynchronously when the ttl lapses. FWIW it might also be worth thinking about making a periodic config file refresh utility class with an interface to manage the ttl tracking and reloader goroutine management though tbh just the simple timer is probably sufficient. |
Main Changes
Notes
Signed-off-by: avaidyanatha avaidyanatha@ucsb.edu