Skip to content
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

CertificateCredential requires either certificate_path or certificate_data #17852

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

chlowell
Copy link
Member

@chlowell chlowell commented Apr 6, 2021

... but giving it both is a ValueError.

@@ -72,6 +72,8 @@ def get_client_credential(certificate_path, password=None, certificate_data=None
"""Load a certificate from a filesystem path or bytes, return it as a dict suitable for msal.ClientApplication"""

if certificate_path:
if certificate_data:
raise ValueError('Please specify either "certificate_path" or "certificate_data"')
Copy link
Member

Choose a reason for hiding this comment

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

The language technically already implies this, but I think it might help to be explicit about only accepting one or the other. I wouldn't die on this hill though

Suggested change
raise ValueError('Please specify either "certificate_path" or "certificate_data"')
raise ValueError('Please specify exactly one of either "certificate_path" or "certificate_data"')

@chlowell chlowell enabled auto-merge (squash) April 7, 2021 18:10
@chlowell chlowell merged commit 4bb2951 into Azure:master Apr 7, 2021
mccoyp pushed a commit to mccoyp/azure-sdk-for-python that referenced this pull request Apr 9, 2021
mccoyp pushed a commit to mccoyp/azure-sdk-for-python that referenced this pull request Apr 13, 2021
benbp pushed a commit to benbp/azure-sdk-for-python that referenced this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants