Skip to content

Separate fetcher key validation from fetcher api url#14536

Merged
calixtus merged 7 commits intoJabRef:mainfrom
Eduguimar:issue-14016
Dec 21, 2025
Merged

Separate fetcher key validation from fetcher api url#14536
calixtus merged 7 commits intoJabRef:mainfrom
Eduguimar:issue-14016

Conversation

@Eduguimar
Copy link
Contributor

@Eduguimar Eduguimar commented Dec 7, 2025

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

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • 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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

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 github-actions bot added the status: changes-required Pull requests that are not yet complete label Dec 7, 2025
@calixtus calixtus changed the title Issue 14016 Separate fetcher key validation from fetcher api url Dec 8, 2025
@calixtus calixtus added component: fetcher dev: code-quality Issues related to code or architecture decisions labels Dec 12, 2025
@github-actions
Copy link
Contributor

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.

@calixtus calixtus enabled auto-merge December 21, 2025 20:09
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Dec 21, 2025
@calixtus calixtus disabled auto-merge December 21, 2025 20:10
@JabRef JabRef deleted a comment from jabref-machine Dec 21, 2025
@github-actions github-actions bot added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Dec 21, 2025
@calixtus calixtus enabled auto-merge December 21, 2025 20:16
@calixtus calixtus added this pull request to the merge queue Dec 21, 2025
Merged via the queue into JabRef:main with commit 926abca Dec 21, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: fetcher dev: code-quality Issues related to code or architecture decisions first contrib good first issue An issue intended for project-newcomers. Varies in difficulty.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite org.jabref.logic.importer.fetcher.CustomizableKeyFetcher#getTestUrl to be a pattern

2 participants