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

[customs] RetryAfter not decreasing #16957

Closed
enote-kane opened this issue May 15, 2024 · 2 comments
Closed

[customs] RetryAfter not decreasing #16957

enote-kane opened this issue May 15, 2024 · 2 comments

Comments

@enote-kane
Copy link
Contributor

enote-kane commented May 15, 2024

Description

After getting blocked, the RetryAfter as returned by fxa-customs-server and used to form the response header does not increase over time, which is bad for clients.

Steps to reproduce

  1. execute a bad login attempt:
    curl -s 'http://localhost:7000/failedLoginAttempt' -X POST -H 'content-type: application/json' --data-binary '{"action": "accountLogin", "ip": "...", "email": "...", "errno": 125}'
  2. check the status of the user activity:
    curl -s 'http://localhost:7000/check' -X POST -H 'content-type: application/json' --data-binary '{"action": "accountLogin", "ip": "...", "email": "..."}' | jq '.'
  3. repeat 1. + 2. until the /check route returns that the user is blocked, e.g.:
    {
      "block": true,
      "retryAfter": 900,
      "unblock": true,
      "suspect": false,
      "blockReason": "other"
    }
  4. wait a few seconds
  5. execute another /check

Expected result

After the activity has been blocked, I'd expect the returned retryAfter to decrease, so that a client can tell the user how much longer to wait until the block is removed.

Actual result

The /check response always contains the initially reported number, even if the block is removed the next second.

Environment

Not applicable

┆Issue is synchronized with this Jira Task

@clouserw
Copy link
Member

Is the block actually removed the next second? I assumed it was reset every time you tried if it was already blocked

@vpomerleau
Copy link
Contributor

The observed behaviour is expected for this endpoint. Repeated attempts on this endpoint increase/reset the ban period.

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

No branches or pull requests

3 participants