Skip to content
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: 🛂 implement rate limit on api requests #681

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

nutfdt
Copy link
Collaborator

@nutfdt nutfdt commented Dec 19, 2024

No description provided.

@nutfdt nutfdt added javascript Pull requests that update Javascript code python Pull requests that update Python code labels Dec 19, 2024
@nutfdt nutfdt self-assigned this Dec 19, 2024
@nutfdt nutfdt requested a review from thomashbrnrd as a code owner December 19, 2024 08:05
@nutfdt nutfdt linked an issue Dec 19, 2024 that may be closed by this pull request
1 task
@nutfdt nutfdt force-pushed the 424-rate-limit-api branch from df46a8d to 0db0d0b Compare December 19, 2024 08:55
Copy link

github-actions bot commented Dec 19, 2024

badge

Backend Coverage Summary

Filename               Stmts    Miss  Cover    Missing
-------------------  -------  ------  -------  -----------------------------
src/__init__.py            0       0  100.00%
src/config.py             45       3  93.33%   79, 81, 83
src/main.py               19       0  100.00%
src/router.py            106      17  83.96%   66, 116-122, 149-152, 175-191
src/utils.py              43       5  88.37%   72-74, 92, 96
tests/__init__.py          0       0  100.00%
tests/conftest.py         14       0  100.00%
tests/test_api.py        113       0  100.00%
tests/test_email.py        4       0  100.00%
TOTAL                    344      25  92.73%

Results for commit: 9244d3e

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@nutfdt nutfdt force-pushed the 424-rate-limit-api branch from 0db0d0b to 7c51533 Compare December 19, 2024 09:32
Copy link

github-actions bot commented Dec 19, 2024

badge

Frontend Coverage Summary

Filename                                                                      Stmts    Miss  Cover    Missing
--------------------------------------------------------------------------  -------  ------  -------  ------------------------------------------------------------------
src/App.vue                                                                      10       3  70.00%   10, 19-20
src/main.ts                                                                       6       0  100.00%
src/api/api-client.ts                                                            21       4  80.95%   22-23, 27-31
src/api/api-routes.ts                                                             6       0  100.00%
src/components/AskingExpert.vue                                                  27      13  51.85%   24-25, 31-56, 63-69, 83-93
src/components/HeaderMain.vue                                                     8       0  100.00%
src/components/MissingCardAlert.vue                                               0       0  100.00%
src/components/OnboardingSwiper.vue                                               4       0  100.00%
src/components/PopupVideo.vue                                                    15       4  73.33%   11, 21-25, 93
src/components/ResultPage.vue                                                    41      12  70.73%   50-81, 235-239
src/components/SnackbarAlert.vue                                                 10       9  10.00%   7-20, 28
src/components/StepsGuide.vue                                                     1       0  100.00%
src/router/index.ts                                                              54       3  94.44%   215, 243, 264
src/stores/result.ts                                                             29       0  100.00%
src/stores/snackbar.ts                                                           16       9  43.75%   15-39
src/utils/authentication.ts                                                       2       0  100.00%
src/utils/isUserUsingComputer.ts                                                  1       0  100.00%
src/utils/isUserUsingCrosscall.ts                                                 1       0  100.00%
src/utils/mentions.ts                                                             8       0  100.00%
src/utils/storage-utils.ts                                                        4       0  100.00%
src/utils/firearms-utils/arme-alarme.ts                                           2       1  50.00%   31
src/utils/firearms-utils/autre-pistolet.ts                                        2       1  50.00%   20
src/utils/firearms-utils/epaule-a-levier-sous-garde.ts                            1       0  100.00%
src/utils/firearms-utils/epaule-a-pompe.ts                                        8       2  75.00%   10, 51
src/utils/firearms-utils/epaule-a-un-coup-par-canon.ts                            4       3  25.00%   17-20
src/utils/firearms-utils/epaule-a-verrou.ts                                       1       0  100.00%
src/utils/firearms-utils/epaule-semi-auto-militaire-milieu-20e.ts                 3       2  33.33%   8-22
src/utils/firearms-utils/epaule-semi-auto-style-chasse.ts                         9       7  22.22%   30-38
src/utils/firearms-utils/epaule_mecanisme_ancien.ts                               2       1  50.00%   6
src/utils/firearms-utils/get-next-route-after-result.ts                          15       0  100.00%
src/utils/firearms-utils/index.ts                                                26       6  76.92%   106-107, 113-117
src/utils/firearms-utils/pistolet-mecanisme-ancien.ts                             2       0  100.00%
src/utils/firearms-utils/pistolet-semi-auto-moderne.ts                            4       1  75.00%   72
src/utils/firearms-utils/revolver.ts                                              8       1  87.50%   199
src/utils/firearms-utils/semi-auto-style-militaire-autre.ts                       3       2  33.33%   24-119
src/views/AboutPage.vue                                                           5       0  100.00%
src/views/AccessibilityPage.vue                                                   3       0  100.00%
src/views/ContactPage.vue                                                         0       0  100.00%
src/views/InstructionsPage.vue                                                   63       7  88.88%   48-50, 62-63, 69, 174
src/views/LegalPage.vue                                                           0       0  100.00%
src/views/MissingCardPage.vue                                                     9       1  88.88%   36
src/views/StartPage.vue                                                           4       0  100.00%
src/views/GuideAskingExpertise/ExpertContact.vue                                 41       3  92.68%   42, 111, 161
src/views/GuideAskingExpertise/ExpertiseForm.vue                                111      20  81.98%   28, 67-74, 89-104, 118, 134-179, 253, 311, 400, 406, 412, 440, 523
src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue              75      24  68.00%   49, 84-112, 120, 210, 236-254, 287-295
src/views/GuideIdentificationFirearm/IdentificationAlarmGun.vue                  12       0  100.00%
src/views/GuideIdentificationFirearm/IdentificationFinalResult.vue                1       0  100.00%
src/views/GuideIdentificationFirearm/IdentificationFurtherInformations.vue        0       0  100.00%
src/views/GuideIdentificationFirearm/IdentificationSelectAmmo.vue                31      12  61.29%   23, 33-38, 43, 57, 88, 103, 123-142
src/views/GuideIdentificationFirearm/IdentificationTypologyResult.vue             1       0  100.00%
src/views/GuideSecuringFirearm/GuideSecuringFirearm.vue                           6       1  83.33%   102
src/views/GuideSecuringFirearm/SecuringAchievement.vue                           14       1  92.85%   102
src/views/GuideSecuringFirearm/SecuringFooter.vue                                 2       0  100.00%
src/views/GuideSecuringFirearm/SecuringSelectOptionContent.vue                   37       7  81.08%   25-26, 41, 140-164
src/views/GuideSecuringFirearm/SecuringTutorialContent.vue                       17       1  94.11%   66
TOTAL                                                                           786     161  79.51%

Results for commit: 9244d3e

Minimum allowed coverage is 75%

♻️ This comment has been updated with latest results

@nutfdt nutfdt force-pushed the 424-rate-limit-api branch from 7c51533 to cf44561 Compare December 19, 2024 13:00
@nutfdt nutfdt force-pushed the 424-rate-limit-api branch from cf44561 to 9244d3e Compare December 19, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a rate limit to limit big requests
1 participant