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

[phishing-controller] Use new config endpoint for default update intervals #4228

Open
Gudahtt opened this issue Apr 29, 2024 · 0 comments
Open
Labels

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Apr 29, 2024

The API platform team has requested that we use a new config endpoint for setting the phishing configuration update intervals. This allows them to make optimizations to both the update intervals and their infrastructure together.

The config endpoint is https://phishing-detection.api.cx.metamask.io/v1/config. The return value should look like {"stalelist":2592000,"hotlist":300}. The numbers are the update intervals for each list, in seconds.

We can send a single request to this endpoint each time the controller is initialized. We should use the values from the config endpoint as defaults, overriding the hard-coded defaults we have in the controller. However, the config values should not override any custom update intervals set in the constructor (we still want to allow the client teams to customize this if necessary).

Acceptance Criteria:

  • We send a single request to the config endpoint in the controller initialize function
    • This function should be called after construction, as part of wallet initialization
  • The config endpoint values are used as default update intervals for each list
  • We still have fallback update intervals hard-coded in the controller, in case the request to the config endpoint fails
  • The update intervals can still be overridden by constructor options
@Gudahtt Gudahtt added enhancement New feature or request team-wallet-framework labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant