jenkinsci / jenkinsci/java-client-api

[Query] I am not able to set password parameters with job.build(params)

未关闭
#415 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
913
派生
466
PR 合并指标
30 天内没有已合并 PR

描述

Hi All,

Looks like I am not able to set password parameters when triggering job builds.

My code looks more or less like this:
```
Map params = new HashMap<>();
params.put("USERNAME", "plain-text-username");
params.put("PASSWORD", "secret-password");

jenkins.getJob("job-name").build(params);
```

As the USERNAME is a generic StringParameter input it is passed properly to the build, while PASSWORD a PasswordParameter type input is not set at all.

I could see in the code all of the parameters are passed as BuildWithParameters&... URL inlined arguments which most likely block passwords. For my own scripting purposes, I use JSON payload which works with all types of inputs.

Is this possible to pass passwords with the current approach? Am I missing something here? If the issue is valid, would you consider a change of a method of passing arguments into JSON payload? I would love to contribute.

贡献指南

打开贡献指南

调研方向

首先跟踪 job.build(params) 背后的实现以及它如何构造 BuildWithParameters URL,然后将该路径与 issue 中描述的 JSON 负载进行比较。重现 USERNAME 和 PASSWORD 参数之间的差异;完成的标准是正确传递密码参数,同时不破坏现有的参数处理。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api, security
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。