Skip to content

Commit 83f35a1

Browse files
Pass api_key as sensitive value
1 parent be282f4 commit 83f35a1

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

environments/etc/installer-manifests/site.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
node default {
22
class { 'datadog_agent':
3-
api_key => 'somenonnullapikeythats32charlong',
3+
api_key => Sensitive('somenonnullapikeythats32charlong'),
44
manage_install => false,
55
datadog_installer_enabled => true,
66
apm_instrumentation_enabled => 'host',

environments/etc/manifests/site.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
node default {
22
class { 'datadog_agent':
3-
api_key => 'somenonnullapikeythats32charlong',
3+
api_key => Sensitive('somenonnullapikeythats32charlong'),
44
agent_extra_options => {
55
use_http => true,
66
},

manifests/installer_telemetry.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# This class handles the installation telemetry for the Datadog installer.
22
#
3-
# @param api_key String:Your DataDog API Key.
3+
# @param api_key Sensitive[String]:Your DataDog API Key.
44
# @param datadog_site String: The site of the Datadog intake to send Agent data to. Defaults to 'datadoghq.com'.
55
# @param packages_to_install String: The packages to be installed by the Datadog installer.
66
#
77
class datadog_agent::installer_telemetry (
8-
String $api_key = 'your_API_key',
8+
Sensitive[String] $api_key = 'your_API_key',
99
String $datadog_site = 'datadoghq.com',
1010
String $packages_to_install = 'datadog-agent',
1111
) {

manifests/reports.pp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# the datadog service.
55
#
66
# Parameters:
7-
# $api_key:
8-
# Your DataDog API Key. Please replace with your key value
7+
# @param api_key Sensitive[String]:Your DataDog API Key.
98
# $datadog_site:
109
# URL to use to talk to the Datadog API
1110
#
@@ -16,7 +15,7 @@
1615
# Sample Usage:
1716
#
1817
class datadog_agent::reports (
19-
String $api_key,
18+
Sensitive[String] $api_key = 'your_API_key',
2019
String $puppetmaster_user,
2120
String $dogapi_version,
2221
Boolean $manage_dogapi_gem = true,

manifests/windows.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
String $agent_version = $datadog_agent::params::agent_version,
88
Optional[String] $agent_repo_uri = undef,
99
String $msi_location = 'C:/Windows/temp',
10-
String $api_key = $datadog_agent::api_key,
10+
Sensitive[String] $api_key = $datadog_agent::api_key,
1111
String $hostname = $datadog_agent::host,
1212
Array $tags = $datadog_agent::tags,
1313
String $tags_join = join($tags,','),

spec/classes/datadog_agent_reports_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
context 'all supported operating systems' do
99
let(:params) do
1010
{
11-
api_key: 'notanapikey',
11+
api_key: Sensitive('notanapikey'),
1212
puppetmaster_user: 'puppet',
1313
dogapi_version: 'installed',
1414
}
@@ -79,7 +79,7 @@
7979
context 'specific dogapi version' do
8080
let(:params) do
8181
{
82-
api_key: 'notanapikey',
82+
api_key: Sensitive('notanapikey'),
8383
puppetmaster_user: 'puppet',
8484
dogapi_version: '1.2.2',
8585
}
@@ -131,7 +131,7 @@
131131
context 'specific gem provider' do
132132
let(:params) do
133133
{
134-
api_key: 'notanapikey',
134+
api_key: Sensitive('notanapikey'),
135135
puppetmaster_user: 'puppet',
136136
dogapi_version: '1.2.2',
137137
puppet_gem_provider: 'gem',
@@ -177,7 +177,7 @@
177177
context 'EU site in report' do
178178
let(:params) do
179179
{
180-
api_key: 'notanapikey',
180+
api_key: Sensitive('notanapikey'),
181181
puppetmaster_user: 'puppet',
182182
dogapi_version: 'installed',
183183
datadog_site: 'https://api.datadoghq.eu',
@@ -226,7 +226,7 @@
226226
context 'disabled ruby-manage' do
227227
let(:params) do
228228
{
229-
api_key: 'notanapikey',
229+
api_key: Sensitive('notanapikey'),
230230
hostname_extraction_regex: nil,
231231
dogapi_version: 'installed',
232232
puppetmaster_user: 'puppet',

spec/classes/datadog_agent_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
{
288288
agent_major_version: 7,
289289
windows_npm_install: true,
290-
api_key: 'notakey',
290+
api_key: Sensitive('notakey'),
291291
host: 'notahost',
292292
}
293293
end
@@ -304,7 +304,7 @@
304304
let(:params) do
305305
{
306306
agent_major_version: 7,
307-
api_key: 'notakey',
307+
api_key: Sensitive('notakey'),
308308
host: 'notahost',
309309
}
310310
end

0 commit comments

Comments
 (0)