cloudfront-auth
                                
                                 cloudfront-auth copied to clipboard
                                
                                    cloudfront-auth copied to clipboard
                            
                            
                            
                        Google Groups authorization calls Google API on each request
It seems that Google Groups authorization checks user membership in groups on every HTTP request.  This is suboptimal.  Should probably check only once before issuing TOKEN cookie.  Then, in case TOKEN cookie is still valid, it should assume that user is authorized without checking group membership again.
Agreed. This may involve a bit of a larger change. The original concept was that we decouple authentication and authorization such that the user is first authenticated and then authorized. The authorization step was set up such that it should call the callback function with a pass or fail.
This change would require we decouple calling the callback function and the authorization function (which is probably how things should've been set up in the first place).
Suggested changes:
- For each authz file, remove callback,internalServerError, andunauthorizedparameters and add a boolean return
- Adjust the corresponding usage of auth.isAuthorizedin the authn files to handle the boolean and end execution with a call tocallback,internalServerError, orunauthorized