G-Node / gin-doi

G-Node DOI Service
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

[validation] refactor external author id check in authorWarnings #122

Closed mpsonntag closed 2 years ago

mpsonntag commented 2 years ago

The currently used approach to check potential researchIDs for validity against "http://publons.com/researcher/" can be slow and seems to become throttled when used extensively via tests.

Unfortunately using the publons API seems to come with different limitations, one of which is that by default only 100 requests are permitted per day which again might be an issue when running a lot of tests during development.

In any case authorWarnings should be refactored. It should only contain formal authorID syntax checks, the requests against the ORCID and publons services should be moved to its own function.

The new function should specifically address and handle potential http.Get timeouts to avoid Server stall or, even worse, panic.