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

Support custom auth params for oauth #16812

Merged

Conversation

tuteng
Copy link
Contributor

@tuteng tuteng commented Feb 7, 2024

What does this PR do?

Motivation

Some OAuth2 platforms have some additional oauth parameters, e.g. auth0 supports audience, azure AD OAuth2 has scope, add this change to support passing custom oauth2 parameters

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Changelog entries must be created for modifications to shipped code
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (6df5cf8) 90.39% compared to head (3db638e) 90.68%.
Report is 2 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
active_directory 100.00% <ø> (+17.64%) ⬆️
activemq 52.87% <ø> (ø)
activemq_xml 82.31% <ø> (ø)
aerospike 87.17% <ø> (+0.32%) ⬆️
amazon_msk 88.91% <ø> (ø)
ambari 85.80% <ø> (ø)
apache 95.08% <ø> (ø)
arangodb 98.23% <ø> (ø)
argocd 87.81% <ø> (ø)
aspdotnet 100.00% <ø> (ø)
avi_vantage 91.35% <ø> (ø)
azure_iot_edge 82.08% <ø> (ø)
boundary 100.00% <ø> (ø)
btrfs 82.91% <ø> (ø)
cacti 87.90% <ø> (ø)
calico 84.61% <ø> (ø)
cassandra 66.66% <ø> (ø)
cert_manager 77.41% <ø> (ø)
cisco_aci 95.31% <ø> (ø)
citrix_hypervisor 87.50% <ø> (ø)
cloud_foundry_api 96.11% <ø> (ø)
cloudera 99.49% <ø> (ø)
cockroachdb 91.52% <ø> (ø)
confluent_platform ?
consul 91.65% <ø> (ø)
coredns 94.61% <ø> (ø)
crio 89.79% <ø> (ø)
datadog_checks_base 89.49% <95.23%> (+0.84%) ⬆️
datadog_checks_dev 82.53% <ø> (+0.03%) ⬆️
datadog_checks_downloader 81.37% <ø> (ø)
datadog_cluster_agent 90.19% <ø> (ø)
dcgm 97.40% <ø> (ø)
ddev 87.45% <ø> (-0.78%) ⬇️
directory 95.49% <ø> (+0.42%) ⬆️
disk 89.34% <ø> (ø)
dns_check 93.33% <ø> (ø)
dotnetclr 91.39% <ø> (+12.90%) ⬆️
druid 97.70% <ø> (ø)
ecs_fargate 83.52% <ø> (ø)
eks_fargate 94.05% <ø> (ø)
elastic 93.36% <ø> (ø)
envoy 95.07% <ø> (+0.09%) ⬆️
etcd 95.56% <ø> (ø)
external_dns 89.28% <ø> (ø)
fluentd 94.79% <ø> (ø)
fluxcd 88.31% <ø> (ø)
foundationdb 83.83% <ø> (ø)
gitlab 91.95% <ø> (+0.20%) ⬆️
go_expvar 92.73% <ø> (ø)
gunicorn 92.10% <ø> (ø)
hazelcast 92.39% <ø> (ø)
hdfs_datanode 89.74% <ø> (ø)
hdfs_namenode 86.72% <ø> (ø)
hive 51.42% <ø> (ø)
hivemq 61.90% <ø> (ø)
http_check 95.28% <ø> (+2.03%) ⬆️
hudi 73.91% <ø> (ø)
ibm_ace 91.91% <ø> (ø)
ibm_db2 95.16% <ø> (ø)
ibm_i 81.91% <ø> (ø)
ibm_mq 91.28% <ø> (ø)
ignite 46.66% <ø> (ø)
iis 95.05% <ø> (ø)
impala 97.97% <ø> (ø)
istio 77.74% <ø> (+0.52%) ⬆️
jboss_wildfly 47.36% <ø> (ø)
kafka 64.70% <ø> (ø)
karpenter 94.36% <ø> (ø)
kube_apiserver_metrics 98.14% <ø> (ø)
kube_controller_manager 97.89% <ø> (ø)
kube_dns 95.97% <ø> (ø)
kube_metrics_server 94.87% <ø> (ø)
kube_proxy 96.80% <ø> (ø)
kube_scheduler 97.63% <ø> (ø)
kubelet 90.90% <ø> (ø)
kubernetes_state 89.50% <ø> (ø)
kyototycoon 85.96% <ø> (ø)
lighttpd 83.64% <ø> (ø)
linkerd 85.22% <ø> (+1.13%) ⬆️
linux_proc_extras 96.22% <ø> (ø)
mapr 82.42% <ø> (ø)
mapreduce 81.35% <ø> (ø)
marathon 83.12% <ø> (ø)
marklogic 96.09% <ø> (ø)
mcache 93.50% <ø> (ø)
mesos_master 89.75% <ø> (ø)
mesos_slave 93.33% <ø> (ø)
mysql 87.46% <ø> (-0.07%) ⬇️
nagios 89.01% <ø> (ø)
network 93.65% <ø> (+1.08%) ⬆️
nfsstat 95.20% <ø> (ø)
nginx 95.13% <ø> (+0.52%) ⬆️
nginx_ingress_controller 98.36% <ø> (ø)
nvidia_triton 88.52% <ø> (ø)
openldap 96.33% <ø> (ø)
openmetrics 98.08% <ø> (ø)
openstack 55.19% <ø> (ø)
openstack_controller 93.77% <ø> (ø)
oracle 88.44% <ø> (ø)
pgbouncer 91.35% <ø> (ø)
php_fpm 90.53% <ø> (+0.82%) ⬆️
postfix 88.10% <ø> (ø)
postgres 92.80% <ø> (-0.04%) ⬇️
powerdns_recursor 96.65% <ø> (ø)
presto 59.09% <ø> (ø)
process 85.28% <ø> (+0.28%) ⬆️
prometheus 94.17% <ø> (ø)
proxysql 98.97% <ø> (ø)
pulsar 100.00% <ø> (ø)
rabbitmq 95.67% <ø> (ø)
ray 96.45% <ø> (ø)
rethinkdb 97.93% <ø> (ø)
riak 99.22% <ø> (ø)
riakcs 93.61% <ø> (ø)
silk 93.82% <ø> (ø)
snmp 95.76% <ø> (+0.04%) ⬆️
snowflake 96.37% <ø> (ø)
solr 56.25% <ø> (ø)
sonarqube 98.24% <ø> (ø)
spark 93.91% <ø> (ø)
sqlserver 89.92% <ø> (+3.57%) ⬆️
squid 100.00% <ø> (ø)
statsd 87.36% <ø> (ø)
strimzi 89.70% <ø> (ø)
supervisord 89.78% <ø> (ø)
system_core 92.66% <ø> (ø)
system_swap 98.30% <ø> (ø)
tcp_check 91.58% <ø> (ø)
teamcity 88.74% <ø> (+3.21%) ⬆️
temporal 100.00% <ø> (ø)
teradata 94.05% <ø> (ø)
tls 92.07% <ø> (+0.82%) ⬆️
tokumx 57.52% <ø> (ø)
torchserve 97.32% <ø> (ø)
traffic_server 96.13% <ø> (ø)
twemproxy 79.56% <ø> (ø)
twistlock 80.47% <ø> (ø)
varnish 84.39% <ø> (+0.26%) ⬆️
weaviate 76.27% <ø> (ø)
weblogic 71.73% <ø> (ø)
win32_event_log 87.12% <ø> (+0.88%) ⬆️
wmi_check 92.91% <ø> (ø)
yarn 89.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link

github-actions bot commented Feb 7, 2024

Test Results

 1 009 files   1 009 suites   6h 5m 19s ⏱️
 6 791 tests  6 719 ✅    71 💤 0 ❌ 1 🔥
28 922 runs  23 868 ✅ 5 053 💤 0 ❌ 1 🔥

For more details on these errors, see this check.

Results for commit 3db638e.

♻️ This comment has been updated with latest results.

Copy link
Member

@FlorentClarret FlorentClarret left a comment

Choose a reason for hiding this comment

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

Hey! Thanks for the PR that's great. I left one nit comment.

Also, would you mind adding one more test here to ensure we are forwarding the parameters to the fetch_token function?

We will take care of updating the documentation for the various integrations that can use this option in a follow-up PR

datadog_checks_base/datadog_checks/base/utils/http.py Outdated Show resolved Hide resolved
@tuteng tuteng force-pushed the fixed/support-custom-params-for-oauth branch from fea771a to e7fbbf8 Compare February 8, 2024 01:12
@FlorentClarret FlorentClarret added this to the 7.52.0 milestone Feb 8, 2024
Copy link
Member

@FlorentClarret FlorentClarret left a comment

Choose a reason for hiding this comment

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

Thanks! This feature will be shipped with Agent 7.52.0

@FlorentClarret FlorentClarret merged commit 50f1110 into DataDog:master Feb 9, 2024
346 of 352 checks passed
Kyle-Neale pushed a commit that referenced this pull request Feb 12, 2024
* Support custom auth params

* Add changelog

* Add space line

* Fixed comment

* Add test for auth_params

* Format code

* Rename to options
@tuteng
Copy link
Contributor Author

tuteng commented Feb 18, 2024

https://github.com/DataDog/integrations-core/milestone/56 It seems that the pr for milestone 7.52.0 is all done, when is it scheduled to be released, is there any recommended way to test it, thanks @FlorentClarret

@FlorentClarret
Copy link
Member

DataDog/integrations-core/milestone/56 It seems that the pr for milestone 7.52.0 is all done, when is it scheduled to be released, is there any recommended way to test it, thanks @FlorentClarret

Agent 7.52.0 will officially go out in March, I don't have the exact date I'm sorry. Since this change lives in the base check, there's currently no way to test it on older versions of the Agent.

For testing purposes, you could use the release candidate version that will be available today on docker hub.

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.

None yet

3 participants