You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the isOldOpenAIKey function uses a simple startsWith check to validate OpenAI keys. This method is not robust and may not accurately validate all key formats.
Describe the solution that you'd like
The solution is to refactor the isOldOpenAIKey function to use a regular expression(REGEX) that matches the expected format of OpenAI keys. This will provide a more accurate validation method.
Describe alternatives that you have considered
An alternative could be to use a third-party library designed for API key validation, but this may introduce unnecessary dependencies. So let's leave it for now.
Additional Information
Research the expected format of both old and new OpenAI keys to create an accurate regex pattern.
Acceptance Criteria
The isOldOpenAIKey function uses regex for validation.
The function should not produce false positives or negatives.
The text was updated successfully, but these errors were encountered:
Hey @Yash-Khattar, Thanks for showing interest in this issue.
I'm on board with the approach, but we need to confirm the exact format of OpenAI keys before moving forward. While it seems likely they follow the pattern sk-[20 characters]T3BlbkFJ[20 characters], we can't rely on assumptions for something this critical.
Community Observations: Some community members have observed the sk-[20 characters]T3BlbkFJ[20 characters] pattern, but it's not guaranteed.
Proposal:
I suggest we keep this issue open until we have an official regex from OpenAI. Once it's available, we can quickly incorporate it for accurate key validation.
Please let me know if you have any other thoughts or suggestions.
Is your feature request related to a problem?
Currently, the
isOldOpenAIKey
function uses a simplestartsWith
check to validate OpenAI keys. This method is not robust and may not accurately validate all key formats.Describe the solution that you'd like
The solution is to refactor the
isOldOpenAIKey
function to use a regular expression(REGEX) that matches the expected format of OpenAI keys. This will provide a more accurate validation method.Describe alternatives that you have considered
An alternative could be to use a third-party library designed for API key validation, but this may introduce unnecessary dependencies. So let's leave it for now.
Additional Information
Research the expected format of both old and new OpenAI keys to create an accurate regex pattern.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: