aboutcode-org / aboutcode-org/vulntotal-extension

Add Check for Missing API Keys for GitHub and VulnerableCode Data Sources

未关闭
#11 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
CSS
星标
1
派生
5
PR 合并指标
30 天内没有已合并 PR

描述

Currently, when the "Enabled DataSources" are set to either **GitHub** or **VulnerableCode**, but their respective API keys are not provided, the search request still proceeds, and the loader runs indefinitely. During this process, failed 401 requests are made in the background, but no indication is given to the user that the API keys are missing.

This issue creates a poor user experience, as the user does not understand why the search fails or why the loader never completes.

**Steps to Reproduce:**
1. Navigate to the settings page.
2. Enable **GitHub** and/or **VulnerableCode** data sources without providing their API keys.
3. Go to the main page and initiate a search for a package.
4. Observe that the loader remains active indefinitely, and there are failed 401 requests in the background (visible in the network tab).

**Expected Behavior:**
- If **GitHub** or **VulnerableCode** is enabled, the extension should check whether the respective API key is provided.
- If the API key is missing, the loader should display an error message like "API key required for GitHub/VulnerableCode data sources."
- The search request should not be sent until the missing API key is provided.

**Proposed Solution:**
- Before making the search request, add checks to validate that the required API keys are provided for **GitHub** and **VulnerableCode**.
- If the keys are missing, display a notification or alert asking the user to provide the necessary keys before proceeding with the search.

**Impact:**
- This fix will improve the user experience by providing clear feedback when the required API keys are not provided.
- It will prevent unnecessary network requests and make sure that the search process only starts when all required data sources have valid credentials.

**Screenshot:**

![Screenshot 2024-12-17 222842](https://github.com/user-attachments/assets/173df853-29f1-48cd-8bea-255680353af9)
![Screenshot 2024-12-17 222830](https://github.com/user-attachments/assets/886b4a15-a216-4bd2-ac00-c4bb1382c0b7)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。