-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins 2.236+
-
-
pipeline-input-step 2.12
JENKINS-61808 changed the way that password parameters are constructed via data binding. This breaks existing uses of the input step that have a password parameter in Jenkins 2.236 and newer, and is analogous to JENKINS-63499. For example, this is is an example of something that used to work but no longer does:
input(message: 'Approve?', parameters: [password(name: 'foo', defaultValue: 'bar', description: 'baz')])
In Jenkins 2.236, it will throw the following exception:
java.lang.IllegalArgumentException: WARNING: Unknown parameter(s) found for class type 'hudson.model.PasswordParameterDefinition': defaultValue at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:322) at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:474) at org.jenkinsci.plugins.structs.describable.DescribableModel.coerceList(DescribableModel.java:585) at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:458) at org.jenkinsci.plugins.structs.describable.DescribableModel.injectSetters(DescribableModel.java:429) at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:331) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:269) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122) ...
If Secret.fromString were available for use in the sandbox, users could manually modify their Pipelines like this as a workaround:
input(message: 'Approve?', parameters: [password(name: 'foo', defaultValueAsSecret: Secret.fromString('bar'), description: 'baz')])
Unless we change something about how JENKINS-61808 was implemented in core, I think the only fix would to have InputStep implement customInstantiate and customUninstantiate similarly to what was done for the build step in JENKINS-62305.
- is caused by
-
JENKINS-61808 Always encrypt f:password values, not just those backed by Secret
- Resolved
- relates to
-
JENKINS-63500 JENKINS-61808 breaks doc generation for build and input steps
- Open
-
JENKINS-63499 Configuration of password parameters broken in Declarative Pipelines in Jenkins 2.236+
- Resolved
-
JENKINS-62305 Error "hudson.model.PasswordParameterValue.value expects class hudson.util.Secret" since 2.236
- Resolved
- links to