Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(platform): User API key management #8602

Open
wants to merge 17 commits into
base: dev
Choose a base branch
from

Conversation

Abhi1992002
Copy link
Contributor

Feature #8590

Note

This issue depends upon #8589 so merge it first

Adding frontend functionality on the profile page for API key generation and revocation.

Changes 🏗️

  • Created requests and types to communicate with the backend.
  • Developed frontend functionality to create the API key.

Video

api.ket.generation.mp4

@Abhi1992002 Abhi1992002 requested a review from a team as a code owner November 9, 2024 11:08
@Abhi1992002 Abhi1992002 requested review from Pwuts and kcze and removed request for a team November 9, 2024 11:08
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/xl labels Nov 9, 2024
Copy link

PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

8590 - Fully compliant

Fully compliant requirements:

  • Add frontend functionality in profile page for API key generation
  • Add frontend functionality in profile page for API key revocation

8589 - Fully compliant

Fully compliant requirements:

  • Create backend function to generate API key
  • Create backend function to store hashed API key
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 Security concerns

API Key Security:
The hash_api_key method in key_manager.py does not properly hash the API key, instead generating a random hash unrelated to the input key. This makes it impossible to properly validate API keys. Additionally, sensitive information like API keys and hashes are being logged via print statements, which could expose this data in logs.

⚡ Recommended focus areas for review

Security Issue
The hash_api_key method generates a new random hash key but doesn't use the input api_key parameter in the hashing process. This means the stored hash has no relation to the original API key.

Debug Code
Multiple print statements are left in the code which may expose sensitive information like API keys and hashes in logs

Debug Code
Console.log statement exposing API keys data to browser console

@Abhi1992002 Abhi1992002 force-pushed the feature/profile-api-key-generation branch from c5fb04a to a742591 Compare November 10, 2024 10:56
Copy link

netlify bot commented Nov 10, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 1aeeee9
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6736bf091497ca0008074bf8

@Pwuts Pwuts changed the title Feature/profile api key generation feat(platform): User API key management Nov 10, 2024
@Torantulino Torantulino requested review from aarushik93 and removed request for Pwuts November 11, 2024 13:30
@Torantulino
Copy link
Member

Love this! Could be worth explicitly stating it's an AutoGPT platform API key to distinguish it from those in your credentials.

Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Nov 11, 2024
@aarushik93
Copy link
Contributor

thank you for this, this is great! Minor comments plus Toran's comment and its good to go 🥳

@Abhi1992002 Abhi1992002 force-pushed the feature/profile-api-key-generation branch from e850212 to 1131788 Compare November 14, 2024 06:15
@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Nov 14, 2024
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@aarushik93 aarushik93 self-requested a review November 14, 2024 10:46
@aarushik93 aarushik93 self-assigned this Nov 14, 2024
@aarushik93
Copy link
Contributor

aarushik93 commented Nov 14, 2024

I am putting in a feature flag before merging these two PRs

Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Nov 14, 2024
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@github-actions github-actions bot added size/l conflicts Automatically applied to PRs with merge conflicts and removed conflicts Automatically applied to PRs with merge conflicts size/xl labels Nov 15, 2024
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 4 size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants