-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
add support of empty api_key #1594
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! We are going to fix this in our codegen system, so chances are high we'll close this PR and fix in a separate one, but appreciate the contribution!
@@ -157,7 +157,8 @@ def qs(self) -> Querystring: | |||
@override | |||
def auth_headers(self) -> dict[str, str]: | |||
api_key = self.api_key | |||
return {"Authorization": f"Bearer {api_key}"} | |||
headers = {} if api_key == "" else {"Authorization": f"Bearer {api_key}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is we set api_key
to None
?
It should also handle situation in which API key is not set through argument of env variable.
@@ -371,7 +372,8 @@ def qs(self) -> Querystring: | |||
@override | |||
def auth_headers(self) -> dict[str, str]: | |||
api_key = self.api_key | |||
return {"Authorization": f"Bearer {api_key}"} | |||
headers = {} if api_key == "" else {"Authorization": f"Bearer {api_key}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Changes being requested
Additional context & links