Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
busunkim96 merged 16 commits intomasterfromcreds-and-scope-overrides
Jun 18, 2020

Conversation

@busunkim96
Copy link
Contributor

@busunkim96busunkim96 commentedJun 15, 2020
edited
Loading

Allow credentials files to be passed tocreate_channel.

Forgoogleapis/gapic-generator-python#432

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

@googlebotgooglebot added the cla: yesThis human has signed the Contributor License Agreement. labelJun 15, 2020
@busunkim96busunkim96 changed the titlefeat: let create_channel accept credentials filesfeat: allow credential files to be passed for channel creationJun 15, 2020


defcreate_channel(target,credentials=None,scopes=None,ssl_credentials=None,**kwargs):
defcreate_channel(target,credentials=None,scopes=None,ssl_credentials=None,credentials_file=None,**kwargs):
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

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

@busunkim96busunkim96 marked this pull request as ready for reviewJune 16, 2020 23:37
@busunkim96busunkim96 changed the titlefeat: allow credential files to be passed for channel creationfeat: allow credentials files to be passed for channel creationJun 16, 2020
Copy link
Contributor

@software-dovsoftware-dov left a 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.

credentials=mock.sentinel.credentials
)

assert"mutually exclusive"instr(excinfo.value)
Copy link
Contributor

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

classDuplicateCredentialArgs(Exception):pass...withpytest.raises(DuplicateCredentialArgs)asexc:   ...

@busunkim96busunkim96 merged commitded92d0 intomasterJun 18, 2020
@busunkim96busunkim96 deleted the creds-and-scope-overrides branchJune 19, 2020 00:58
This was referencedMay 30, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@software-dovsoftware-dovsoftware-dov approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@busunkim96@software-dov@googlebot

[8]ページ先頭

©2009-2025 Movatter.jp