FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: allow credentials files to be passed for channel creation by busunkim96 · Pull Request #50 · googleapis/python-api-core · GitHub

This repository was archived by the owner on Feb 23, 2026. It is now read-only.
/ python-api-core Public archive

feat: allow credentials files to be passed for channel creation - #50

Merged
busunkim96 merged 16 commits into
masterfrom
creds-and-scope-overrides
Jun 18, 2020
Merged

feat: allow credentials files to be passed for channel creation#50
busunkim96 merged 16 commits into
masterfrom
creds-and-scope-overrides

Conversation

busunkim96 commented Jun 15, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Allow credentials files to be passed to create_channel.

For googleapis/gapic-generator-python#432

While it's possible for the library transport to create a credentials object and pass it to create_channel, I think it will be easier in the long run for the auth logic to remain in _create_composite_credentials.

googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 15, 2020
busunkim96 changed the title feat: let create_channel accept credentials files feat: allow credential files to be passed for channel creation Jun 15, 2020


def create_channel(target, credentials=None, scopes=None, ssl_credentials=None, **kwargs):
def create_channel(target, credentials=None, scopes=None, ssl_credentials=None, credentials_file=None, **kwargs):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I added credentials_file to the end of the list to avoid breaking anyone who is using positional arguments.

busunkim96 marked this pull request as ready for review June 16, 2020 23:37
busunkim96 requested a review from software-dov June 16, 2020 23:57
busunkim96 changed the title feat: allow credential files to be passed for channel creation feat: allow credentials files to be passed for channel creation Jun 16, 2020

software-dov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, one style/preference concern with exception raising.

credentials=mock.sentinel.credentials
)

assert "mutually exclusive" in str(excinfo.value)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm not a huge fan of checking for explicit strings in exception messages. If it's easy and within the style guides of the repo, I like to make one-off exception types and check for the specific exception type within tests, something like

class DuplicateCredentialArgs(Exception):
   pass
...
with pytest.raises(DuplicateCredentialArgs) as exc:
   ...

busunkim96 merged commit ded92d0 into master Jun 18, 2020
busunkim96 deleted the creds-and-scope-overrides branch June 19, 2020 00:58
This was referenced May 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL