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

3078 rate limit login #3216

Merged
merged 9 commits into from
Apr 10, 2023
Merged

3078 rate limit login #3216

merged 9 commits into from
Apr 10, 2023

Conversation

mssalvatore
Copy link
Collaborator

What does this PR do?

Issue #3078

Adds rate limiting to authentication-related endpoints

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Do all unit tests pass?
  • Do all end-to-end tests pass?
  • If applicable, add screenshots or log transcripts of the feature working

@mssalvatore mssalvatore force-pushed the 3078-rate-limit-login branch 2 times, most recently from 6c69668 to 6451284 Compare April 10, 2023 14:36
@@ -123,8 +129,6 @@ def get_agent_binary(self, operating_system: OperatingSystem) -> bytes:
@handle_authentication_token_expiration
def get_otp(self) -> str:
response = self._http_client.get("/agent-otp")
if response.status_code == HTTPStatus.TOO_MANY_REQUESTS:
raise IslandAPIRequestLimitExceededError("Too many requests to get OTP.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the IslandAPIAgentOTPProvider still expect this error to be raised?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, it's now handled by the HTTPClient decorator

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets raised from self._http_client.get() in the handle_island_errors() decorator.

This test fails against our Windows Island due to network latency
issues. This is being removed until we can resolve the issue.
@mssalvatore mssalvatore merged commit df55c0d into develop Apr 10, 2023
@mssalvatore mssalvatore deleted the 3078-rate-limit-login branch April 10, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants