Skip to content

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

Open
@Gudahtt

Description

@Gudahtt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions