jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Separate fetcher key validation from fetcher api url

Open Eduguimar opened this issue 2 weeks ago • 1 comments

Closes #14016

This pull request refactors the API key validation for web fetchers by replacing the getTestUrl() method with a more flexible isValidKey(String apiKey) in the CustomizableKeyFetcher interface. This allows each fetcher to implement its own specific logic for key validation, instead of assuming the key is always appended to a URL. The implementation was updated for IEEE, BiodiversityLibrary, Medline, SpringerNature, and Unpaywall fetchers.

Steps to test

  1. Go to File -> Preferences -> Web search.
  2. In the "Web search fetchers" section, select a fetcher that requires an API key (e.g., IEEE Xplore).
  3. Check the option box and click in the "Configure API key" button.
  4. Enter the API key and click the "Test connection"" button.
  5. A confirmation dialog should appear if the key is valid, and an error dialog if it is invalid.
  6. Repeat the process for other updated fetchers like Biodiversity Heritage Library to confirm the validation works as expected.

Mandatory checks

  • [x] I own the copyright of the code submitted and I license it under the MIT license
  • [x] I manually tested my changes in running JabRef (always required)
  • [x] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [x] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • [x] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

Eduguimar avatar Dec 07 '25 01:12 Eduguimar

Hey @Eduguimar! 👋

Thank you for contributing to JabRef!

We have automated checks in place, based on which you will soon get feedback if any of them are failing.

After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs.

Please re-check our AI Usage Policy to ensure that your pull request is in line with it. It also contains links to our contribution guide in case of any other doubts related to our contribution workflow.

github-actions[bot] avatar Dec 07 '25 01:12 github-actions[bot]

Your pull request conflicts with the target branch.

Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

github-actions[bot] avatar Dec 17 '25 18:12 github-actions[bot]