openedx / course-discovery

Service providing access to consolidated course and program metadata
https://edx-discovery.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
57 stars 171 forks source link

fix: increase the default throttle rate for enterprise users (POC) #4394

Open adamstankiewicz opened 2 months ago

adamstankiewicz commented 2 months ago

The frontend-app-learner-portal-enterprise MFE makes requests to several API endpoints within course-discovery, e.g. to serve metadata about courses, programs, course recommendations, and course reviews. However, enterprise users are frequently rate limited by the default throttle rate of 100/hour (i.e., N = 2.45k requests rate limited in the past 1 week from this MFE).

This PR proposes a (POC) solution for increasing the default throttle rate if the authenticated user is an enterprise user, as determined by the authenticated user's roles in their decoded JWT cookie.