GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Feat: Add api_key argument to Client constructor by andrewsg · Pull Request #1441 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Conversation

@andrewsg

@andrewsg andrewsg commented Feb 21, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrewsg
Feat: Add api_key argument to Client constructor
b4b958a
@andrewsg
andrewsg requested review from a team February 21, 2025 23:58
@blunderbuss-gcf blunderbuss-gcf Bot assigned cojenco Feb 21, 2025
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/python-storage API. labels Feb 21, 2025
cojenco
cojenco reviewed Feb 25, 2025
View reviewed changes
Comment thread google/cloud/storage/client.py
:param api_key:
(Optional) An API key. Mutually exclusive with any other credentials.
This parameter is an alias for setting `client_options.api_key` and
will supercede any api key set in the `client_options` parameter.

@cojenco cojenco Feb 25, 2025

Copy link
Copy Markdown
Contributor

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.

Thanks for working on this. While I understand that allowing api key-based access is the main goal, is there a specific reason why we need to add a parameter as an alias?

client_options is an existing parameter, and both a dictionary or ClientOption instance is supported, making it quite easy for users to pass it in.

client_options = {"api_key": api_key}
client = Client(client_options=client_options)

Could you share more context on the user journey and requirements for this, thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andrewsg andrewsg Feb 26, 2025

Copy link
Copy Markdown
Contributor Author

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.

This was the result of a discussion with the PM. Basically, the overarching design philosophy was to make it as easy to use as possible, and this alias is inexpensive for us to maintain and improves usability and legibility.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cojenco
cojenco approved these changes Feb 27, 2025
View reviewed changes
@andrewsg
Merge branch 'main' into api-key
6ecbc0f
@andrewsg
andrewsg requested a review from a team February 27, 2025 18:35
@andrewsg
Merge branch 'main' into api-key
23845a4
@andrewsg andrewsg added the automerge Merge the pull request once unit tests and other checks pass. label Feb 27, 2025
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit c869e15 into main Feb 27, 2025
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 27, 2025
@gcf-merge-on-green
gcf-merge-on-green Bot deleted the api-key branch February 27, 2025 23:56
@release-please release-please Bot mentioned this pull request Feb 27, 2025
chore(main): release 3.1.0 #1435
Merged
gcf-merge-on-green Bot pushed a commit that referenced this pull request Feb 28, 2025
@release-please
chore(main): release 3.1.0 (#1435)
aa7afdf
🤖 I have created a release *beep* *boop*
---


## [3.1.0](https://togithub.com/googleapis/python-storage/compare/v3.0.0...v3.1.0) (2025-02-27)


### Features

* Add api_key argument to Client constructor ([#1441](https://togithub.com/googleapis/python-storage/issues/1441)) ([c869e15](https://togithub.com/googleapis/python-storage/commit/c869e15ec535a0aa50029d30b6a3ce64ff119b5f))
* Add Bucket.move_blob() for HNS-enabled buckets ([#1431](https://togithub.com/googleapis/python-storage/issues/1431)) ([24c000f](https://togithub.com/googleapis/python-storage/commit/24c000fb7b9f576e6d6c6ec5733f3971fe133655))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@cojenco cojenco cojenco approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cojenco cojenco

Labels

api: storage Issues related to the googleapis/python-storage API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andrewsg @cojenco
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.