Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 0be62fd

Browse files
Fix broken path references/tests pointing to /lightbody/ url references
1 parent fca2968 commit 0be62fd

File tree

8 files changed

+33
-28
lines changed

8 files changed

+33
-28
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If you're running BrowserUp Proxy within a Java application or Selenium test, ge
99
command line as a standalone proxy, start with [Standalone](#getting-started-standalone).
1010

1111
### Getting started: Embedded Mode
12-
To use BrowserUp Proxy in your tests or application, add the `BrowserUp-core` dependency to your pom:
12+
To use BrowserUp Proxy in your tests or application, add the `browserup-proxy-core` dependency to your pom:
1313
```xml
1414
<dependency>
1515
<groupId>com.browserup.bup</groupId>
@@ -50,17 +50,17 @@ For more information on the features available in the REST API, see [the REST AP
5050

5151
## Changes since 2.0.0
5252

53-
The new [BrowserUpProxyServer class](BrowserUp-core/src/main/java/net/lightbody/bup/BrowserUpProxyServer.java) has replaced the legacy ProxyServer implementation. The legacy implementation is no longer actively supported; all new code should use `BrowserUpProxyServer`. We highly recommend that existing code migrate to the new implementation.
53+
The new [BrowserUpProxyServer class](browserup-proxy-core/src/main/java/com/browserup/bup/BrowserUpProxyServer.java) has replaced the legacy ProxyServer implementation. The legacy implementation is no longer actively supported; all new code should use `BrowserUpProxyServer`. We highly recommend that existing code migrate to the new implementation.
5454

5555
The most important changes from 2.0 are:
5656

5757
- [Separate REST API and Embedded Mode modules](#embedded-mode). Include only the functionality you need.
58-
- [New BrowserUpProxy interface](BrowserUp-core/src/main/java/net/lightbody/bup/BrowserUpProxy.java). The new interface will completely replace the legacy 2.0 ProxyServer contract in version 3.0 and higher.
58+
- [New BrowserUpProxy interface](browserup-proxy-core/src/main/java/com/browserup/bup/BrowserUpProxy.java). The new interface will completely replace the legacy 2.0 ProxyServer contract in version 3.0 and higher.
5959
- [LittleProxy support](#littleproxy-support). More stable and more powerful than the legacy Jetty back-end.
6060

6161
### New BrowserUpProxy API
6262

63-
BrowserUp Proxy 2.1 includes a [new BrowserUpProxy interface](BrowserUp-core/src/main/java/net/lightbody/bup/BrowserUpProxy.java) to interact with BrowserUp Proxy programmatically. The new interface defines the functionality that BrowserUp Proxy will support in future releases (including 3.0+). To ease migration, both the legacy (Jetty-based) ProxyServer class and the new, LittleProxy-powered BrowserUpProxy class support the new BrowserUpProxy interface.
63+
BrowserUp Proxy 2.1 includes a [new BrowserUpProxy interface](browserup-proxy-core/src/main/java/com/browserup/bup/BrowserUpProxy.java) to interact with BrowserUp Proxy programmatically. The new interface defines the functionality that BrowserUp Proxy will support in future releases (including 3.0+). To ease migration, both the legacy (Jetty-based) ProxyServer class and the new, LittleProxy-powered BrowserUpProxy class support the new BrowserUpProxy interface.
6464

6565
We _highly_ recommend migrating existing code to the BrowserUpProxy interface using the `BrowserUpProxyServer` class.
6666

@@ -86,7 +86,7 @@ The legacy interface, implicitly defined by the ProxyServer class, has been extr
8686

8787
LegacyProxyServer will not be supported after 3.0 is released, so we recommend migrating to the `BrowserUpProxy` interface as soon as possible. The new interface provides additional functionality and is compatible with both the legacy Jetty-based ProxyServer implementation [(with some exceptions)](new-interface-compatibility.md) and the new LittleProxy implementation.
8888

89-
If you must continue using the legacy Jetty-based implementation, include the `BrowserUp-core-legacy` artifact instead of `BrowserUp-core`.
89+
If you must continue using the legacy Jetty-based implementation, include the `browserup-proxy-core-legacy` artifact instead of `browserup-proxy-core`.
9090

9191
## Features and Usage
9292

@@ -198,13 +198,13 @@ system properties will be used to specify the upstream proxy.
198198

199199
**New in 2.1:** New [BrowserUpProxy interface](#new-BrowserUpproxy-api) for Embedded Mode
200200

201-
BrowserUp Proxy 2.1 separates the Embedded Mode and REST API into two modules. If you only need Embedded Mode functionality, add the `BrowserUp-core` artifact as a dependency. The REST API artifact is `BrowserUp-rest`.
201+
BrowserUp Proxy 2.1 separates the Embedded Mode and REST API into two modules. If you only need Embedded Mode functionality, add the `browserup-proxy-core` artifact as a dependency. The REST API artifact is `BrowserUp-rest`.
202202

203203
If you're using Java and Selenium, the easiest way to get started is to embed the project directly in your test. First, you'll need to make sure that all the dependencies are imported in to the project. You can find them in the *lib* directory. Or, if you're using Maven, you can add this to your pom:
204204
```xml
205205
<dependency>
206206
<groupId>com.browserup.bup</groupId>
207-
<artifactId>BrowserUp-core</artifactId>
207+
<artifactId>browserup-proxy-core</artifactId>
208208
<version>2.1.4</version>
209209
<scope>test</scope>
210210
</dependency>
@@ -358,7 +358,7 @@ Consult the Java API docs for more info.
358358

359359
### SSL Support
360360

361-
**BrowserUp Proxy 2.1.0+ now supports full MITM:** For most users, MITM will work out-of-the-box with default settings. Install the [ca-certificate-rsa.cer](/BrowserUp-core/src/main/resources/sslSupport/ca-certificate-rsa.cer) file in your browser or HTTP client to avoid untrusted certificate warnings. Generally, it is safer to generate your own private key, rather than using the .cer files distributed with BrowserUp Proxy. See the [README file in the `mitm` module](/mitm/README.md) for instructions on generating or using your own root certificate and private key with MITM.
361+
**BrowserUp Proxy 2.1.0+ now supports full MITM:** For most users, MITM will work out-of-the-box with default settings. Install the [ca-certificate-rsa.cer](/browserup-proxy-core/src/main/resources/sslSupport/ca-certificate-rsa.cer) file in your browser or HTTP client to avoid untrusted certificate warnings. Generally, it is safer to generate your own private key, rather than using the .cer files distributed with BrowserUp Proxy. See the [README file in the `mitm` module](/mitm/README.md) for instructions on generating or using your own root certificate and private key with MITM.
362362

363363
**Note: DO NOT** permanently install the .cer files distributed with BrowserUp Proxy in users' browsers. They should be used for testing only and must not be used with general web browsing.
364364

@@ -374,7 +374,7 @@ When running in stand-alone mode, the proxy loads the default logging configurat
374374

375375
### DNS Resolution
376376

377-
The BrowserUpProxyServer implementation uses native DNS resolution by default, but supports custom DNS resolution and advanced DNS manipulation. See the [ClientUtil](BrowserUp-proxy/BrowserUp-core/src/main/java/net/lightbody/bup/client/ClientUtil.java) class for information on DNS manipulation using the dnsjava resolver.
377+
The BrowserUpProxyServer implementation uses native DNS resolution by default, but supports custom DNS resolution and advanced DNS manipulation. See the [ClientUtil](browserup-proxy-core/src/main/java/com/browserup/bup/client/ClientUtil.java) class for information on DNS manipulation using the dnsjava resolver.
378378

379379
## Building the latest from source
380380

browserup-proxy-core/src/main/java/com/browserup/bup/filters/HarCaptureFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ public void serverToProxyResponseReceived() {
784784
long responseReceivedNanos = System.nanoTime();
785785

786786
// like the wait time, the receive time requires that the serverToProxyResponseReceiving() method be called before this method is invoked.
787-
// typically that should happen, but it has been reported (https://github.com/lightbody/BrowserUp-proxy/issues/288) that it
787+
// typically that should happen, but it has been reported (https://github.com/lightbody/browsermob-proxy/issues/288) that it
788788
// sometimes does not. therefore, to be safe, make sure responseReceiveStartedNanos is populated before setting the receive time.
789789
if (responseReceiveStartedNanos > 0L) {
790790
this.harEntry.getTimings().setReceive(responseReceivedNanos - responseReceiveStartedNanos, NANOSECONDS);

browserup-proxy-mitm/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
plugins {
66
id 'java-library'
7+
id 'groovy'
78
}
89

910
archivesBaseName = 'browserup-proxy-mitm'
@@ -74,6 +75,7 @@ dependencies {
7475
testImplementation 'org.apache.logging.log4j:log4j-api:2.8'
7576
testImplementation 'org.apache.logging.log4j:log4j-core:2.8'
7677
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.8'
78+
testImplementation 'org.codehaus.groovy:groovy-all:2.4.16'
7779
testImplementation 'org.hamcrest:hamcrest-library:1.3'
7880
testImplementation 'org.mockito:mockito-core:2.23.4'
7981
testImplementation 'org.slf4j:jcl-over-slf4j:1.7.22'

browserup-proxy-mitm/src/test/groovy/com/browserup/bup/mitm/KeyStoreFileCertificateSourceTest.groovy

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import org.junit.rules.TemporaryFolder
1313
import java.nio.file.Files
1414
import java.nio.file.StandardCopyOption
1515

16+
import static com.browserup.bup.mitm.test.util.CertificateTestUtil.*
17+
1618
class KeyStoreFileCertificateSourceTest {
1719

1820
@Rule
@@ -26,17 +28,17 @@ class KeyStoreFileCertificateSourceTest {
2628
pkcs12File = tmpDir.newFile("keystore.p12")
2729
jksFile = tmpDir.newFile("keystore.jks")
2830

29-
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/net/lightbody/bup/mitm/keystore.p12"), pkcs12File.toPath(), StandardCopyOption.REPLACE_EXISTING)
30-
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/net/lightbody/bup/mitm/keystore.jks"), jksFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
31+
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/com/browserup/bup/mitm/keystore.p12"), pkcs12File.toPath(), StandardCopyOption.REPLACE_EXISTING)
32+
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/com/browserup/bup/mitm/keystore.jks"), jksFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
3133
}
3234

3335
@Test
3436
void testPkcs12FileOnClasspath() {
35-
KeyStoreFileCertificateSource keyStoreFileCertificateSource = new KeyStoreFileCertificateSource("PKCS12", "/net/lightbody/bup/mitm/keystore.p12", "privateKey", "password")
37+
KeyStoreFileCertificateSource keyStoreFileCertificateSource = new KeyStoreFileCertificateSource("PKCS12", "/com/browserup/bup/mitm/keystore.p12", "privateKey", "password")
3638

3739
CertificateAndKey certificateAndKey = keyStoreFileCertificateSource.load()
3840

39-
CertificateTestUtil.verifyTestRSACertWithCNandO(certificateAndKey)
41+
verifyTestRSACertWithCNandO(certificateAndKey)
4042
}
4143

4244
@Test
@@ -45,16 +47,16 @@ class KeyStoreFileCertificateSourceTest {
4547

4648
CertificateAndKey certificateAndKey = keyStoreFileCertificateSource.load()
4749

48-
CertificateTestUtil.verifyTestRSACertWithCNandO(certificateAndKey)
50+
verifyTestRSACertWithCNandO(certificateAndKey)
4951
}
5052

5153
@Test
5254
void testJksFileOnClasspath() {
53-
KeyStoreFileCertificateSource keyStoreFileCertificateSource = new KeyStoreFileCertificateSource("JKS", "/net/lightbody/bup/mitm/keystore.jks", "privateKey", "password")
55+
KeyStoreFileCertificateSource keyStoreFileCertificateSource = new KeyStoreFileCertificateSource("JKS", "/com/browserup/bup/mitm/keystore.jks", "privateKey", "password")
5456

5557
CertificateAndKey certificateAndKey = keyStoreFileCertificateSource.load()
5658

57-
CertificateTestUtil.verifyTestRSACertWithCNandO(certificateAndKey)
59+
verifyTestRSACertWithCNandO(certificateAndKey)
5860
}
5961

6062
@Test
@@ -63,6 +65,6 @@ class KeyStoreFileCertificateSourceTest {
6365

6466
CertificateAndKey certificateAndKey = keyStoreFileCertificateSource.load()
6567

66-
CertificateTestUtil.verifyTestRSACertWithCNandO(certificateAndKey)
68+
verifyTestRSACertWithCNandO(certificateAndKey)
6769
}
6870
}

browserup-proxy-mitm/src/test/groovy/com/browserup/bup/mitm/PemFileCertificateSourceTest.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import org.junit.rules.TemporaryFolder
1515
import java.nio.file.Files
1616
import java.nio.file.StandardCopyOption
1717

18+
import static com.browserup.bup.mitm.test.util.CertificateTestUtil.*
1819
import static org.junit.Assert.assertNotNull
1920
import static org.junit.Assume.assumeTrue
2021

@@ -33,9 +34,9 @@ class PemFileCertificateSourceTest {
3334
encryptedPrivateKeyFile = tmpDir.newFile("encrypted-private-key.key")
3435
unencryptedPrivateKeyFile = tmpDir.newFile("unencrypted-private-key.key")
3536

36-
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/net/lightbody/bup/mitm/certificate.crt"), certificateFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
37-
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/net/lightbody/bup/mitm/encrypted-private-key.key"), encryptedPrivateKeyFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
38-
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/net/lightbody/bup/mitm/unencrypted-private-key.key"), unencryptedPrivateKeyFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
37+
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/com/browserup/bup/mitm/certificate.crt"), certificateFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
38+
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/com/browserup/bup/mitm/encrypted-private-key.key"), encryptedPrivateKeyFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
39+
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/com/browserup/bup/mitm/unencrypted-private-key.key"), unencryptedPrivateKeyFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
3940
}
4041

4142
@Test
@@ -47,7 +48,7 @@ class PemFileCertificateSourceTest {
4748
CertificateAndKey certificateAndKey = pemFileCertificateSource.load()
4849
assertNotNull(certificateAndKey)
4950

50-
CertificateTestUtil.verifyTestRSACertWithCNandO(certificateAndKey)
51+
verifyTestRSACertWithCNandO(certificateAndKey)
5152
}
5253

5354
@Test
@@ -57,7 +58,7 @@ class PemFileCertificateSourceTest {
5758
CertificateAndKey certificateAndKey = pemFileCertificateSource.load()
5859
assertNotNull(certificateAndKey)
5960

60-
CertificateTestUtil.verifyTestRSACertWithCNandO(certificateAndKey)
61+
verifyTestRSACertWithCNandO(certificateAndKey)
6162
}
6263

6364
@Test(expected = ImportException)

browserup-proxy-mitm/src/test/groovy/com/browserup/bup/mitm/TrustSourceTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TrustSourceTest {
3232
void stageFiles() {
3333
certificateFile = tmpDir.newFile("certificate.crt")
3434

35-
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/net/lightbody/bup/mitm/certificate.crt"), certificateFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
35+
Files.copy(KeyStoreFileCertificateSourceTest.getResourceAsStream("/com/browserup/bup/mitm/certificate.crt"), certificateFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
3636
}
3737

3838
@Test
@@ -95,7 +95,7 @@ class TrustSourceTest {
9595

9696
@Test
9797
void testCanAddTrustedCertificateInKeyStore() {
98-
InputStream keystoreStream = TrustSource.class.getResourceAsStream("/net/lightbody/bup/mitm/trusted-cert.jks")
98+
InputStream keystoreStream = TrustSource.class.getResourceAsStream("/com/browserup/bup/mitm/trusted-cert.jks")
9999
assertNotNull("Unable to load keystore", keystoreStream)
100100
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType())
101101
keyStore.load(keystoreStream, null)

browserup-proxy-rest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dependencies {
7575
testImplementation 'org.apache.logging.log4j:log4j-api:2.8.2'
7676
testImplementation 'org.apache.logging.log4j:log4j-core:2.8.2'
7777
testImplementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.2'
78-
testImplementation 'org.codehaus.groovy:groovy-all:2.4.12'
78+
testImplementation 'org.codehaus.groovy:groovy-all:2.4.16'
7979
testImplementation 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
8080
testImplementation 'org.hamcrest:hamcrest-library:1.3'
8181
testImplementation 'org.mock-server:mockserver-netty:3.10.8'

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ configurations.all {
1010
// it uses org.littleshoot.proxy.impl.ProxyToServerConnection.addressFor
1111
// which calls com.google.common.net.HostAndPort.getHost(),
1212
// which is not in 19.
13-
// https://github.com/lightbody/BrowserUp-proxy/issues/638
14-
// https://github.com/lightbody/BrowserUp-proxy/issues/398
13+
// https://github.com/lightbody/browsermob-proxy/issues/638
14+
// https://github.com/lightbody/browsermob-proxy/issues/398
1515
// .....
1616
// UPDATE Jan 21 2019: I'm upgrading to Guava 22, and will sort out upstream Minion
1717
// conflicts later. BrowserUpDriver _should_ be allowed to use whatever libs it wants.

0 commit comments

Comments
 (0)