Skip to content

Commit 730bbf7

Browse files
committed
(PUP-8134) Allow tasks to specify that parameters are "sensitive"
This commit adds the task metadata field "sensitive" to the whitelist of metadata fields. This field can be used to specify that a parameter value should be redacted from logs, etc. This does not include any behavior change to actually redact data, just to allow those tasks to be run.
1 parent 2263866 commit 730bbf7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/puppet/pops/loader/task_instantiator.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def self.ensure_initialized
5454
Types::Task::PARAMETER_NAME_PATTERN,
5555
tf.struct(
5656
tf.optional('description') => tf.string,
57-
tf.optional('type') => Types::PStringType::NON_EMPTY
57+
tf.optional('type') => Types::PStringType::NON_EMPTY,
58+
tf.optional('sensitive') => tf.boolean
5859
)
5960
)
6061

spec/unit/pops/types/task_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def compile(code = nil)
133133
"supports_noop": true,
134134
"parameters": {
135135
"message": {
136-
"type": "String"
136+
"type": "String",
137+
"sensitive": false
137138
},
138139
"font": {
139140
"type": "Optional[String]"
@@ -456,7 +457,7 @@ def compile(code = nil)
456457
type Service::Init = Task {
457458
constants => {
458459
supports_noop => true,
459-
input_format => 'stdin:json'
460+
input_method => 'stdin'
460461
},
461462
attributes => {
462463
action => Service::Action,

0 commit comments

Comments
 (0)