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

fix: change admin key validation from error to warning when not provided #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rorymalcolm
Copy link

@rorymalcolm rorymalcolm commented Jan 16, 2025

Previously, attempting to configure the OpenAI provider with a null admin_key would result in an error, making it impossible to use configurations where the admin key might be intentionally unset for certain environments or accounts.

This change:

  • Changes the admin_key validation from an error to a warning when not provided
  • Only performs the sk-admin- prefix validation when an admin_key is actually provided
  • Enables common configurations like:
provider "openai" { 
    admin_key = var.openai_api_key # where var.openai_api_key can be null 
}

Fixes: #58

Previously, attempting to configure the OpenAI provider with a null admin_key would result in an error, making it impossible to use configurations where the admin key might be intentionally unset for certain environments or accounts.

This change:
- Changes the admin_key validation from an error to a warning when not provided
- Only performs the sk-admin- prefix validation when an admin_key is actually provided
- Enables common configurations like:
  ```hcl
  provider openai {
    admin_key = var.openai_api_key # where var.openai_api_key can be null
  }
@rorymalcolm rorymalcolm requested a review from jianyuan as a code owner January 16, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation prevents provider instantiation without an API key
1 participant