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: allow credentials files to be passed for channel creation by busunkim96 · Pull Request #50 · googleapis/python-api-core

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

Conversation

@busunkim96

@busunkim96 busunkim96 commented Jun 15, 2020 •
edited
Loading

Uh oh!

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

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.

Sorry, something went wrong.

Uh oh!

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

All reactions
@busunkim96
feat: let create_channel accept credentials files
d72e2af
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 15, 2020
@busunkim96 busunkim96 changed the title feat: let create_channel accept credentials files feat: allow credential files to be passed for channel creation Jun 15, 2020
busunkim96 and others added 8 commits June 16, 2020 04:50
@busunkim96
test: add unit tests
21f6fac
@busunkim96
Merge branch 'master' into creds-and-scope-overrides
2190ac5
@busunkim96
docs: update docstrings
2d55a3a
@busunkim96
Merge branch 'creds-and-scope-overrides' of github.com:googleapis/pyt…
937ea1f
…hon-api-core into creds-and-scope-overrides
@busunkim96
chore: remove whitespace
f332cf3
@busunkim96
test: fix coverage
b64b6e1
@busunkim96
chore: delete pytype output
a34fab8
@busunkim96
chore: fix typo
672e74d
@busunkim96 busunkim96 mentioned this pull request Jun 16, 2020
feat: add credentials_file and scopes via client_options googleapis/gapic-generator-python#461
Merged
4 of 5 tasks
busunkim96
busunkim96 commented Jun 16, 2020
View reviewed changes
Comment thread google/api_core/grpc_helpers.py


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):

@busunkim96 busunkim96 Jun 16, 2020

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.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@busunkim96
busunkim96 marked this pull request as ready for review June 16, 2020 23:37
@busunkim96
Merge branch 'master' into creds-and-scope-overrides
2e01e23
@busunkim96
busunkim96 requested a review from software-dov June 16, 2020 23:57
@busunkim96 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
Update .gitignore
6a3a9ac
software-dov
software-dov approved these changes Jun 18, 2020
View reviewed changes

@software-dov software-dov left a comment

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.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread tests/asyncio/test_grpc_helpers_async.py
credentials=mock.sentinel.credentials
)

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

@software-dov software-dov Jun 18, 2020

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.

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:
   ...

Sorry, something went wrong.

Uh oh!

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

All reactions
busunkim96 added 5 commits June 18, 2020 23:05
@busunkim96
fix: add new exception type
537130d
@busunkim96
Merge branch 'creds-and-scope-overrides' of github.com:googleapis/pyt…
659e787
…hon-api-core into creds-and-scope-overrides
@busunkim96
docs: update error type in docstring
a1d6402
@busunkim96
docs: fix in async too
385a710
@busunkim96
docs: one more docstring
cd60b1d
@busunkim96
busunkim96 merged commit ded92d0 into master Jun 18, 2020
@busunkim96
busunkim96 deleted the creds-and-scope-overrides branch June 19, 2020 00:58
@busunkim96 busunkim96 mentioned this pull request Jul 14, 2020
feat!: migrate to use microgenerator googleapis/python-billingbudgets#38
Merged
This was referenced May 30, 2025
chore(main): release 2.0.0 #822
Closed
chore(main): release 2.0.0 #823
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@software-dov software-dov software-dov approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

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

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.

3 participants

@busunkim96 @software-dov @googlebot
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.