mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Make RDE SSH key identity injectable
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133883090
This commit is contained in:
parent
28eeda189d
commit
2d46c7c27c
3 changed files with 16 additions and 1 deletions
|
@ -21,6 +21,7 @@ import com.jcraft.jsch.JSch;
|
|||
import com.jcraft.jsch.JSchException;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import google.registry.config.ConfigModule.Config;
|
||||
import google.registry.keyring.api.KeyModule.Key;
|
||||
|
||||
/** Dagger module for {@link JSch} which provides SSH/SFTP connectivity. */
|
||||
|
@ -29,13 +30,14 @@ public final class JSchModule {
|
|||
|
||||
@Provides
|
||||
static JSch provideJSch(
|
||||
@Config("rdeSshIdentity") String identity,
|
||||
@Key("rdeSshClientPrivateKey") String privateKey,
|
||||
@Key("rdeSshClientPublicKey") String publicKey) {
|
||||
applyAppEngineKludge();
|
||||
JSch jsch = new JSch();
|
||||
try {
|
||||
jsch.addIdentity(
|
||||
"rde@charlestonroadregistry.com",
|
||||
identity,
|
||||
privateKey.getBytes(UTF_8),
|
||||
publicKey.getBytes(UTF_8),
|
||||
null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue