Skip to content

Commit

Permalink
Fix the type of bearer_token_auth
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c committed Jan 14, 2022
1 parent e773f59 commit 6d1ad95
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion crio/datadog_checks/crio/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,13 @@
- name: bearer_token_auth
description: |
If set to true, adds a bearer token authentication header.
If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
value:
example: false
type: boolean
anyOf:
- type: boolean
- type: string
- name: bearer_token_path
description: |
The path to a Kubernetes service account bearer token file. Make sure the file exists and is mounted correctly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion etcd/datadog_checks/etcd/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion gitlab/datadog_checks/gitlab/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion haproxy/datadog_checks/haproxy/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Datadog, Inc. 2021-present
# (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

Expand Down Expand Up @@ -69,7 +69,7 @@ class Config:
aws_host: Optional[str]
aws_region: Optional[str]
aws_service: Optional[str]
bearer_token_auth: Optional[bool]
bearer_token_auth: Optional[Union[bool, str]]
bearer_token_path: Optional[str]
connect_timeout: Optional[float]
disable_generic_tags: Optional[bool]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: true
## @param bearer_token_auth - boolean or string - optional - default: true
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion kube_dns/datadog_checks/kube_dns/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion kube_proxy/datadog_checks/kube_proxy/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Datadog, Inc. 2021-present
# (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

Expand Down Expand Up @@ -51,7 +51,7 @@ def instance_aws_service(field, value):


def instance_bearer_token_auth(field, value):
return False
return get_default_field_value(field, value)


def instance_bearer_token_path(field, value):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Datadog, Inc. 2021-present
# (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)

Expand Down Expand Up @@ -69,7 +69,7 @@ class Config:
aws_host: Optional[str]
aws_region: Optional[str]
aws_service: Optional[str]
bearer_token_auth: Optional[bool]
bearer_token_auth: Optional[Union[bool, str]]
bearer_token_path: Optional[str]
connect_timeout: Optional[float]
disable_generic_tags: Optional[bool]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down
3 changes: 2 additions & 1 deletion scylla/datadog_checks/scylla/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ instances:
#
# include_labels: []

## @param bearer_token_auth - boolean - optional - default: false
## @param bearer_token_auth - boolean or string - optional - default: false
## If set to true, adds a bearer token authentication header.
## If set to 'tls_only', adds only a bearer token authentication header if the endpoint is secure https.
## Note: If bearer_token_path is not set, the default path is /var/run/secrets/kubernetes.io/serviceaccount/token.
#
# bearer_token_auth: false
Expand Down

0 comments on commit 6d1ad95

Please sign in to comment.