jenkinsci / jenkinsci/java-client-api

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

Ouverte
#415 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
913
Forks
466
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
api, security
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.