zenodo / zenodo-rdm

Zenodo, powered by InvenioRDM
https://zenodo.org
GNU General Public License v2.0
64 stars 28 forks source link

Convert banned/safe links domains config to a DB table #1043

Closed slint closed 2 weeks ago

slint commented 2 weeks ago

We want to store all the link domains in a table, and mark their status (banned/safe). Ideally when matching, we should be querying the DB like so:

        domain_parts = self.extract_domain(url)  # ['io', 'github', 'slint']

        """
        SELECT status
        FROM domain_tree
        WHERE domain LIKE 'io.github%'  -- this is a "good" domain and should match

        -- This is a "bad" more specific domain
        -- WHERE domain LIKE 'io.github.ketogummies'
        """