From 62b036cae5b2677770f66174576622f2a25eb410 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Fri, 30 Jun 2023 12:10:49 +0200 Subject: [PATCH] Tor: Create da package for DirectoryAuthority classes --- .../local_network/DirectoryAuthorityKeyGenerationTests.java | 4 ++++ .../java/bisq/tor/local_network/DirectoryAuthorityTests.java | 2 ++ .../bisq/tor/local_network/{ => da}/DirectoryAuthority.java | 2 +- .../local_network/{ => da}/DirectoryAuthorityFactory.java | 5 ++++- .../local_network/{ => da/keygen}/RelayKeyGenProcess.java | 5 ++++- .../keygen/process}/DirectoryAuthorityKeyGenerator.java | 4 +++- .../keygen/process}/DirectoryIdentityKeyGenProcess.java | 3 ++- .../bisq/tor/local_network/torrc/CommonTorrcGenerator.java | 2 +- .../torrc/DirectoryAuthorityTorrcGenerator.java | 2 +- .../bisq/tor/local_network/torrc/RelayTorrcGenerator.java | 2 +- .../bisq/tor/local_network/torrc/TorrcFileGenerator.java | 2 +- .../local_network/DirectoryAuthorityTorrcGeneratorTests.java | 1 + .../bisq/tor/local_network/RelayTorrcGeneratorTests.java | 1 + 13 files changed, 26 insertions(+), 9 deletions(-) rename network/tor-local-network/src/main/java/bisq/tor/local_network/{ => da}/DirectoryAuthority.java (97%) rename network/tor-local-network/src/main/java/bisq/tor/local_network/{ => da}/DirectoryAuthorityFactory.java (91%) rename network/tor-local-network/src/main/java/bisq/tor/local_network/{ => da/keygen}/RelayKeyGenProcess.java (94%) rename network/tor-local-network/src/main/java/bisq/tor/local_network/{ => da/keygen/process}/DirectoryAuthorityKeyGenerator.java (95%) rename network/tor-local-network/src/main/java/bisq/tor/local_network/{ => da/keygen/process}/DirectoryIdentityKeyGenProcess.java (96%) diff --git a/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerationTests.java b/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerationTests.java index e6285847ff..346ee1cf1a 100644 --- a/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerationTests.java +++ b/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerationTests.java @@ -17,6 +17,10 @@ package bisq.tor.local_network; +import bisq.tor.local_network.da.DirectoryAuthority; +import bisq.tor.local_network.da.keygen.process.DirectoryAuthorityKeyGenerator; +import bisq.tor.local_network.da.keygen.process.DirectoryIdentityKeyGenProcess; +import bisq.tor.local_network.da.keygen.RelayKeyGenProcess; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; diff --git a/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityTests.java b/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityTests.java index 89d23b7f1c..a806ade0e7 100644 --- a/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityTests.java +++ b/network/tor-local-network/src/integrationTest/java/bisq/tor/local_network/DirectoryAuthorityTests.java @@ -18,6 +18,8 @@ package bisq.tor.local_network; import bisq.common.util.NetworkUtils; +import bisq.tor.local_network.da.DirectoryAuthority; +import bisq.tor.local_network.da.DirectoryAuthorityFactory; import bisq.tor.local_network.torrc.DirectoryAuthorityTorrcGenerator; import bisq.tor.local_network.torrc.TorrcFileGenerator; import org.junit.jupiter.api.Test; diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthority.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/DirectoryAuthority.java similarity index 97% rename from network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthority.java rename to network/tor-local-network/src/main/java/bisq/tor/local_network/da/DirectoryAuthority.java index 9b7ffdfa97..2d475544ff 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthority.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/DirectoryAuthority.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.tor.local_network; +package bisq.tor.local_network.da; import lombok.Builder; import lombok.Getter; diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthorityFactory.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/DirectoryAuthorityFactory.java similarity index 91% rename from network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthorityFactory.java rename to network/tor-local-network/src/main/java/bisq/tor/local_network/da/DirectoryAuthorityFactory.java index 8c11aa0b8f..b328f33b50 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthorityFactory.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/DirectoryAuthorityFactory.java @@ -15,8 +15,11 @@ * along with Bisq. If not, see . */ -package bisq.tor.local_network; +package bisq.tor.local_network.da; +import bisq.tor.local_network.da.keygen.process.DirectoryAuthorityKeyGenerator; +import bisq.tor.local_network.da.keygen.process.DirectoryIdentityKeyGenProcess; +import bisq.tor.local_network.da.keygen.RelayKeyGenProcess; import lombok.Getter; import java.io.File; diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/RelayKeyGenProcess.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/RelayKeyGenProcess.java similarity index 94% rename from network/tor-local-network/src/main/java/bisq/tor/local_network/RelayKeyGenProcess.java rename to network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/RelayKeyGenProcess.java index d5d2b3f734..f872d26822 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/RelayKeyGenProcess.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/RelayKeyGenProcess.java @@ -15,7 +15,10 @@ * along with Bisq. If not, see . */ -package bisq.tor.local_network; +package bisq.tor.local_network.da.keygen; + +import bisq.tor.local_network.KeyFingerprintReader; +import bisq.tor.local_network.da.DirectoryAuthority; import java.io.File; import java.io.IOException; diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerator.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/process/DirectoryAuthorityKeyGenerator.java similarity index 95% rename from network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerator.java rename to network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/process/DirectoryAuthorityKeyGenerator.java index 0c83e5a542..2f84f5873d 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryAuthorityKeyGenerator.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/process/DirectoryAuthorityKeyGenerator.java @@ -15,8 +15,10 @@ * along with Bisq. If not, see . */ -package bisq.tor.local_network; +package bisq.tor.local_network.da.keygen.process; +import bisq.tor.local_network.InputStreamWaiter; +import bisq.tor.local_network.da.keygen.RelayKeyGenProcess; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryIdentityKeyGenProcess.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/process/DirectoryIdentityKeyGenProcess.java similarity index 96% rename from network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryIdentityKeyGenProcess.java rename to network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/process/DirectoryIdentityKeyGenProcess.java index 89c358e30b..b3df6610d3 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/DirectoryIdentityKeyGenProcess.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/da/keygen/process/DirectoryIdentityKeyGenProcess.java @@ -15,8 +15,9 @@ * along with Bisq. If not, see . */ -package bisq.tor.local_network; +package bisq.tor.local_network.da.keygen.process; +import bisq.tor.local_network.KeyFingerprintReader; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/CommonTorrcGenerator.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/CommonTorrcGenerator.java index 3fe2ef532f..66ea325e8b 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/CommonTorrcGenerator.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/CommonTorrcGenerator.java @@ -17,7 +17,7 @@ package bisq.tor.local_network.torrc; -import bisq.tor.local_network.DirectoryAuthority; +import bisq.tor.local_network.da.DirectoryAuthority; import lombok.Getter; /** diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/DirectoryAuthorityTorrcGenerator.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/DirectoryAuthorityTorrcGenerator.java index ed33b034da..d5363d357b 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/DirectoryAuthorityTorrcGenerator.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/DirectoryAuthorityTorrcGenerator.java @@ -17,7 +17,7 @@ package bisq.tor.local_network.torrc; -import bisq.tor.local_network.DirectoryAuthority; +import bisq.tor.local_network.da.DirectoryAuthority; public class DirectoryAuthorityTorrcGenerator extends CommonTorrcGenerator { public DirectoryAuthorityTorrcGenerator(DirectoryAuthority thisDirectoryAuthority) { diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/RelayTorrcGenerator.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/RelayTorrcGenerator.java index 29eaa5756f..c3067a8b8c 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/RelayTorrcGenerator.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/RelayTorrcGenerator.java @@ -17,7 +17,7 @@ package bisq.tor.local_network.torrc; -import bisq.tor.local_network.DirectoryAuthority; +import bisq.tor.local_network.da.DirectoryAuthority; public class RelayTorrcGenerator extends CommonTorrcGenerator { public RelayTorrcGenerator(DirectoryAuthority thisDirectoryAuthority) { diff --git a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/TorrcFileGenerator.java b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/TorrcFileGenerator.java index b413f7032d..b2ff5bee61 100644 --- a/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/TorrcFileGenerator.java +++ b/network/tor-local-network/src/main/java/bisq/tor/local_network/torrc/TorrcFileGenerator.java @@ -17,7 +17,7 @@ package bisq.tor.local_network.torrc; -import bisq.tor.local_network.DirectoryAuthority; +import bisq.tor.local_network.da.DirectoryAuthority; import java.io.IOException; import java.nio.file.Files; diff --git a/network/tor-local-network/src/test/java/bisq/tor/local_network/DirectoryAuthorityTorrcGeneratorTests.java b/network/tor-local-network/src/test/java/bisq/tor/local_network/DirectoryAuthorityTorrcGeneratorTests.java index e1e1a06e93..9a310af98d 100644 --- a/network/tor-local-network/src/test/java/bisq/tor/local_network/DirectoryAuthorityTorrcGeneratorTests.java +++ b/network/tor-local-network/src/test/java/bisq/tor/local_network/DirectoryAuthorityTorrcGeneratorTests.java @@ -17,6 +17,7 @@ package bisq.tor.local_network; +import bisq.tor.local_network.da.DirectoryAuthority; import bisq.tor.local_network.torrc.DirectoryAuthorityTorrcGenerator; import bisq.tor.local_network.torrc.TorrcFileGenerator; import org.junit.jupiter.api.Test; diff --git a/network/tor-local-network/src/test/java/bisq/tor/local_network/RelayTorrcGeneratorTests.java b/network/tor-local-network/src/test/java/bisq/tor/local_network/RelayTorrcGeneratorTests.java index f088d5957f..ae3a49096b 100644 --- a/network/tor-local-network/src/test/java/bisq/tor/local_network/RelayTorrcGeneratorTests.java +++ b/network/tor-local-network/src/test/java/bisq/tor/local_network/RelayTorrcGeneratorTests.java @@ -17,6 +17,7 @@ package bisq.tor.local_network; +import bisq.tor.local_network.da.DirectoryAuthority; import bisq.tor.local_network.torrc.RelayTorrcGenerator; import bisq.tor.local_network.torrc.TorrcFileGenerator; import org.junit.jupiter.api.Test;