jenkinsci / jenkinsci/java-client-api
[Query] I am not able to set password parameters with job.build(params)
- Vorherrschende Sprache
- Java
- Sterne
- 913
- Forks
- 466
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Start by tracing the implementation behind job.build(params) and how it constructs the BuildWithParameters URL, then compare that path with the JSON payload described in the issue. Reproduce the difference between USERNAME and PASSWORD parameters; done means password parameters are passed correctly without breaking existing parameter handling.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api, security
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100