[
https://issues.apache.org/jira/browse/SSHD-1143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17302422#comment-17302422
]
Thomas Wolf commented on SSHD-1143:
-----------------------------------
That's not what I wrote.
If you absolutely want to use different factories, you can do so, and install
them in a {{TransportConfigCallback}} as before. Just creating and configuring
the factory provided by {{org.eclipse.jgit.ssh.apache}} will be different. If
that factory doesn't suit your needs, adapt it until it does, or file
enhancement requests at the [JGit issue
tracker|https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JGit&component=JGit&bug_severity=enhancement],
or even better, provide contributions with the enhancements to JGit.
JavaDoc for JGit is linked at the [JGit dowload
page|https://www.eclipse.org/jgit/download/], for 5.10.0 it's
[here|https://download.eclipse.org/jgit/site/5.10.0.202012080955-r/apidocs/index.html].
(For the sshd SshSessionFactory, look in package
{{org.eclipse.jgit.transport.sshd}}.)
The JGit unit tests contain several examples of using this factory, as does (of
course) the EGit code. Very simple usage (factory set globally) is shown in
[JGit's command-line
client|https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java#216].
I know that several projects/products have switched from JSch to using sshd in
JGit via this factory. Unless I'm mistaken at least one has configured the
factory to use a (relational?) database for configs and passphrase storage.
> Example for JGit TransportConfigCallback with MINA
> --------------------------------------------------
>
> Key: SSHD-1143
> URL: https://issues.apache.org/jira/browse/SSHD-1143
> Project: MINA SSHD
> Issue Type: Improvement
> Affects Versions: 2.5.1
> Reporter: Joern Guy Suess
> Priority: Major
>
> JGit used to rely on JSch as its transport provider, but changed because JSch
> does not accept certain keys, including some OpenSSH ones.
> If you are using a passphrase-encrypted key with JGit, the recommended
> approach with JSch used to be [to override a configuration callback, as shown
> in this blog
> article|https://blog.sebastian-daschner.com/entries/access-git-from-java].
> The alternative is to [set a shared session
> factory|https://stackoverflow.com/questions/12502452/how-do-you-set-the-configuration-for-jschconfigsessionfactory-for-jgit-so-that-p#answer-15290861]
> and this [also what the Apache MINA team recommends with a pointer to the
> cost of creating sessions on
> demand|https://github.com/apache/mina-sshd/blob/master/docs/git.md#user-content-client-side].
> However, my issue with this is that it sets a specific provider for the whole
> system scope. Consequently, I would like to implement
> [{{TransportConfigCallback}}|https://archive.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/api/TransportConfigCallback.html].
> Ultimately, this requires to adapt
> [{{SshSessionFactory}}|https://archive.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/transport/SshSessionFactory.html]
> to MINA's session initialization code and produce a
> [{{RemoteSession}}|https://archive.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/transport/RemoteSession.html].
> Would it be possible to provide an example or some boilerplate for this case?
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]