[JENKINS-19429] SshSessionFactory.setInstance unnecessary
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Inizia da JGitAPIImpl e traccia il suo utilizzo di SshSessionFactory.setInstance, Transport.open, PushCommand e TransportCommand.setTransportConfigCallback. Verifica il comportamento con test_push o con i test di trasporto pertinenti; il lavoro è completato quando l’autenticazione SSH è configurata per ogni SshTransport senza modificare la factory JGit a livello di VM.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
JGitAPIImpl. starts off by calling SshSessionFactory.setInstance(new TrileadSessionFactory()). This sets the VM-wide factory, which could be quite dangerous: it means that any other usage of JGit will not be using the standard logic in JschConfigSessionFactory to use ~/.ssh and so on.
Instead it should only set a TrileadSessionFactory directly using SshTransport.setSshSessionFactory when it calls Transport.open (and the result is an SshTransport). In some cases that is called directly; for PushCommand and similar uses that call Transport.open for you, it need only call TransportCommand.setTransportConfigCallback to configure an SshTransport with our authentication.
I can submit a pull request if you like—probably only JGitAPIImpl needs to be touched—though I am unsure how to test it. (I presume test_push does not push to a public server.)
Originally reported by
jglick, imported from: SshSessionFactory.setInstance unnecessary
- status: Open
- priority: Critical
- component(s): git-client-plugin
- resolution: Unresolved
- votes: 1
- watchers: 3
- imported: 20251211-071809
Raw content of original issue
JGitAPIImpl.<init> starts off by calling SshSessionFactory.setInstance(new TrileadSessionFactory()). This sets the VM-wide factory, which could be quite dangerous: it means that any other usage of JGit will not be using the standard logic in JschConfigSessionFactory to use ~/.ssh and so on.
Instead it should only set a TrileadSessionFactory directly using SshTransport.setSshSessionFactory when it calls Transport.open (and the result is an SshTransport). In some cases that is called directly; for PushCommand and similar uses that call Transport.open for you, it need only call TransportCommand.setTransportConfigCallback to configure an SshTransport with our authentication.
I can submit a pull request if you like—probably only JGitAPIImpl needs to be touched—though I am unsure how to test it. (I presume test_push does not push to a public server.)
- Lingua principale
- Java
- Stelle
- 152
- Fork
- 404
- Merge medio
- 2g 7h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jenkinsci/git-client-plugin
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
jenkinsci/git-client-plugin#1807 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
jenkinsci/git-client-plugin#1785 ·
-
Separate command line options from arguments with a double dashForse di nuovo libera @vidhumahajan l’ha presa 22 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
jenkinsci/git-client-plugin#1780 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
jenkinsci/git-client-plugin#1764 · 5 commenti · 1 reazione ·
-
Dependency DashboardAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 25/100
jenkinsci/git-client-plugin#1737 ·
Tutte le issue di jenkinsci/git-client-plugin
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
btraceio/jafar#228 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-templates triage:bot-seen triage:needs-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/aspire#22356 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Coral-Hive] locate() is typed as STRING instead of INT, so view schemas report a string columnAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/flink-agents#1395 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
floci-io/floci#8666 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno