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

Use headers-only for api and app keys with exceptions #189

Merged
merged 17 commits into from
Oct 16, 2019
Merged

Conversation

ssc3
Copy link
Contributor

@ssc3 ssc3 commented Oct 7, 2019

Datadog now supports api and app keys in headers. Refactoring ruby lib to use headers only. There is an exception for some endpoints which cannot support these

Copy link
Contributor

@gzussa gzussa left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this 👏
Would it be possible to add a unit test for set_api_and_app_keys_in_params?

params = extra_params.merge params unless extra_params.nil?
qs_params = params.map { |k, v| CGI.escape(k.to_s) + '=' + CGI.escape(v.to_s) }
qs = '?' + qs_params.join('&')
qs
end

def set_api_and_app_keys_in_params(url, with_app_key)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot for this 👏
Would it be possible to add a unit test for set_api_and_app_keys_in_params?

Good point. Added a unit test!

Copy link
Contributor

@gzussa gzussa left a comment

Choose a reason for hiding this comment

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

Great!

@ssc3 ssc3 merged commit 82510d6 into master Oct 16, 2019
@ssc3 ssc3 deleted the shubho/use-headers branch October 16, 2019 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants