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

Add auth type to RequestsWrapper #4708

Merged
merged 5 commits into from
Oct 25, 2019
Merged

Add auth type to RequestsWrapper #4708

merged 5 commits into from
Oct 25, 2019

Conversation

itsdanni
Copy link
Contributor

@itsdanni itsdanni commented Oct 8, 2019

@itsdanni itsdanni requested review from a team as code owners October 8, 2019 15:59
@itsdanni
Copy link
Contributor Author

itsdanni commented Oct 8, 2019

currently failing some style tests and the test for lighttpd. Failing lighttpd should be expected.

@hithwen hithwen changed the title [WIP] Danni/add auth type Add auth type to RequestsWrapper Oct 10, 2019
hithwen
hithwen previously approved these changes Oct 10, 2019
@hithwen hithwen requested a review from ofek October 10, 2019 07:59
@ofek
Copy link
Contributor

ofek commented Oct 10, 2019

cc @ruthnaebeck for docs

Copy link
Contributor

@ruthnaebeck ruthnaebeck left a 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:

activemq/datadog_checks/activemq/data/conf.yaml.example Outdated Show resolved Hide resolved
activemq/datadog_checks/activemq/data/conf.yaml.example Outdated Show resolved Hide resolved
ruthnaebeck
ruthnaebeck previously approved these changes Oct 10, 2019
Copy link
Contributor

@ruthnaebeck ruthnaebeck left a comment

Choose a reason for hiding this comment

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

👍 for docs

hithwen
hithwen previously approved these changes Oct 11, 2019
@@ -62,6 +62,7 @@
'tls_verify': True,
'timeout': DEFAULT_TIMEOUT,
'username': None,
'auth_type': None,
Copy link
Contributor

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'):
Copy link
Contributor

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

@itsdanni itsdanni dismissed stale reviews from hithwen and ruthnaebeck via 6b9887c October 11, 2019 17:49
@itsdanni itsdanni requested a review from a team as a code owner October 15, 2019 15:43
.azure-pipelines/all.yml Outdated Show resolved Hide resolved
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))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Copy link
Contributor

@FlorianVeaux FlorianVeaux left a 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

@ofek ofek merged commit a631218 into master Oct 25, 2019
@ofek ofek deleted the danni/add_auth_type branch October 25, 2019 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment