-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add auth type to RequestsWrapper #4708
Conversation
Codecov Report
|
currently failing some style tests and the test for lighttpd. Failing lighttpd should be expected. |
cc @ruthnaebeck for docs |
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.
Docs review - Update all conf.yaml.example
files like this:
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.
👍 for docs
@@ -62,6 +62,7 @@ | |||
'tls_verify': True, | |||
'timeout': DEFAULT_TIMEOUT, | |||
'username': None, | |||
'auth_type': None, |
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.
Let's keep it in alphabetical order
auth = (config['username'], config['password']) | ||
if config['auth_type']: | ||
auth_type = config.get('auth_type', 'basic').lower() | ||
if auth_type not in ('basic', 'digest'): |
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.
Let's check for each then log in an else
branch. Also, make the first be if auth_type == 'basic':
8acba15
to
ed95149
Compare
elif auth_type == 'digest': | ||
auth = requests.auth.HTTPDigestAuth(config['username'], config['password']) | ||
else: | ||
self.logger.debug('auth_type {} is not supported, defaulting to basic'.format(auth_type)) |
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.
self.logger.debug('auth_type {} is not supported, defaulting to basic'.format(auth_type)) | |
self.logger.warning('auth_type {} is not supported, defaulting to basic'.format(auth_type)) |
I think we want this to appear on the logs without needing to enable debug
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.
See comments #4708 (comment) and #4708 (comment) and
For this card: https://trello.com/c/HGVH9yKS/790-add-authtype-to-requestswrapper