- 
                Notifications
    
You must be signed in to change notification settings  - Fork 32
 
🎨 feat(api-server): Add TTL caching to authentication repositories 🚨 #8474
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
🎨 feat(api-server): Add TTL caching to authentication repositories 🚨 #8474
Conversation
          Codecov Report✅ All modified and coverable lines are covered by tests. 
 Additional details and impacted files@@             Coverage Diff             @@
##           master    #8474       +/-   ##
===========================================
- Coverage   87.10%   69.12%   -17.99%     
===========================================
  Files        1983      889     -1094     
  Lines       77285    39749    -37536     
  Branches     1333      175     -1158     
===========================================
- Hits        67322    27477    -39845     
- Misses       9564    12215     +2651     
+ Partials      399       57      -342     
 
 Continue to review full report in Codecov by Sentry. 
 🚀 New features to boost your workflow:
  | 
    
a5c896d    to
    0fbd190      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for quick action 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
        
          
                services/api-server/src/simcore_service_api_server/repository/api_keys.py
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                services/api-server/tests/unit/_with_db/authentication/test_api_dependency_authentication.py
          
            Show resolved
            Hide resolved
        
              
          
                services/api-server/tests/unit/_with_db/authentication/test_api_dependency_authentication.py
              
                Outdated
          
            Show resolved
            Hide resolved
        
      9925491    to
    829e3bd      
    Compare
  
    
          
 | 
    



What do these changes do?
This PR implements TTL-based caching for authentication operations to improve performance and reduce database load.
🚀 New Features
aiocachewith 120s TTL toApiKeysRepository.get_user()methodaiocachewith 120s TTL toUsersRepository.get_active_user_email()method🔧 Configuration
AIOCACHE_DISABLE=1environment variablenoself=TrueconfigurationSecurity Considerations
Performance Impact
Related issue/s
How to test
test_repository_api_keys.pyDev-ops