jenkinsci / jenkinsci/java-client-api

Enhancement: re-work crumbFlag handling

Aperta
#361 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Java
Stelle
913
Fork
466
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Currently the way to handle the crumbFlag is not very intuitive and even not complete. Some methods offer a parameter "crumbFlag" but other dont (see #350).

IMHO it would be better to handle this internally in the library or at least in one central place. So my suggestion is to have a new constructor:
`new JenkinsServer(..., boolean crumbFlag)`

Furthermore, if no crumbFlag is specified (by using the existing constructors) the library itself determines if the crumbFlag should be set or not by calling
```
String json = client.get("api/json");
boolean crumbFlag = new JsonObject(json).get("useCrumbs").getAsBoolean();
```

This would allow to cleanup the API from all overloaded methods that allow passing a "crumbFlag" parameter.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.