From b99070ab9f10410a3f8d25fae01dd611a6cc79ff Mon Sep 17 00:00:00 2001 From: Addison Luh Date: Mon, 8 Jul 2019 18:38:53 -0700 Subject: [PATCH] Add modules support and bump version up to 3.0.0. (#292) * Add modules support and bump version up to 3.0.0. --- README.md | 10 +++- api/forwarder.go | 4 +- api/forwarder_test.go | 2 +- auth/auth_filter.go | 2 +- auth/auth_filter_test.go | 6 +-- auth/context.go | 2 +- body/body_modifier.go | 4 +- body/body_modifier_test.go | 6 +-- cmd/marbl/viewer.go | 2 +- cmd/proxy/main.go | 54 ++++++++++---------- cmd/proxy/main_test.go | 2 +- cookie/cookie_filter.go | 8 +-- cookie/cookie_filter_test.go | 10 ++-- cookie/cookie_matcher.go | 2 +- cookie/cookie_modifier.go | 6 +-- cookie/cookie_modifier_test.go | 4 +- failure/failure_verifier.go | 6 +-- failure/failure_verifier_test.go | 6 +-- fifo/fifo_group.go | 8 +-- fifo/fifo_group_test.go | 12 ++--- filter/filter.go | 6 +-- filter/filter_test.go | 6 +-- go.mod | 5 ++ go.sum | 5 ++ har/har.go | 8 +-- har/har_handlers.go | 2 +- har/har_handlers_test.go | 4 +- har/har_test.go | 4 +- header/copy_modifier.go | 8 +-- header/copy_modifier_test.go | 4 +- header/forwarded_modifier.go | 2 +- header/framing_modifier.go | 2 +- header/header_append_modifier.go | 6 +-- header/header_append_modifier_test.go | 4 +- header/header_blacklist_modifier.go | 6 +-- header/header_blacklist_modifier_test.go | 4 +- header/header_filter.go | 6 +-- header/header_filter_test.go | 8 +-- header/header_matcher.go | 2 +- header/header_modifier.go | 6 +-- header/header_modifier_test.go | 4 +- header/header_value_regex_filter.go | 4 +- header/header_verifier.go | 8 +-- header/header_verifier_test.go | 8 +-- header/hopbyhop_modifier.go | 2 +- header/hopbyhop_modifier_test.go | 2 +- header/id_modifier.go | 4 +- header/id_modifier_test.go | 4 +- header/via_modifier.go | 2 +- header/via_modifier_test.go | 4 +- httpspec/httpspec.go | 4 +- httpspec/httpspec_test.go | 6 +-- init.go | 2 +- ipauth/ipauth.go | 4 +- ipauth/ipauth_test.go | 8 +-- marbl/handler.go | 2 +- marbl/marbl.go | 6 +-- marbl/marbl_test.go | 4 +- marbl/modifier.go | 2 +- martian_test.go | 2 +- martianhttp/authority_handler_test.go | 2 +- martianhttp/martianhttp.go | 8 +-- martianhttp/martianhttp_integration_test.go | 6 +-- martianhttp/martianhttp_test.go | 8 +-- martianlog/logger.go | 8 +-- martianlog/logger_test.go | 6 +-- martiantest/martiantest_test.go | 2 +- martiantest/transport.go | 2 +- martiantest/transport_test.go | 2 +- martianurl/url_filter.go | 8 +-- martianurl/url_filter_test.go | 10 ++-- martianurl/url_matcher.go | 2 +- martianurl/url_modifier.go | 4 +- martianurl/url_modifier_test.go | 2 +- martianurl/url_regex_filter.go | 4 +- martianurl/url_regex_filter_test.go | 8 +-- martianurl/url_verifier.go | 6 +-- martianurl/url_verifier_test.go | 6 +-- messageview/messageview_test.go | 2 +- method/method_filter.go | 8 +-- method/method_filter_test.go | 8 +-- method/method_verifier.go | 6 +-- method/method_verifier_test.go | 6 +-- mitm/mitm.go | 2 +- mobile/proxy.go | 56 ++++++++++----------- noop.go | 2 +- nosigpipe/nosigpipe_darwin.go | 2 +- parse/parse.go | 2 +- parse/parse_test.go | 4 +- pingback/pingback_verifier.go | 6 +-- pingback/pingback_verifier_test.go | 6 +-- port/port_filter.go | 4 +- port/port_filter_test.go | 8 +-- port/port_modifier.go | 2 +- port/port_modifier_test.go | 2 +- priority/priority_group.go | 4 +- priority/priority_group_test.go | 8 +-- proxy.go | 10 ++-- proxy_test.go | 8 +-- proxy_trafficshaping_test.go | 6 +-- proxyauth/proxyauth.go | 4 +- proxyauth/proxyauth_test.go | 8 +-- querystring/query_string_filter.go | 6 +-- querystring/query_string_filter_test.go | 12 ++--- querystring/query_string_modifier.go | 4 +- querystring/query_string_modifier_test.go | 2 +- querystring/query_string_verifier.go | 6 +-- querystring/query_string_verifier_test.go | 6 +-- servemux/servemux_filter.go | 4 +- servemux/servemux_filter_test.go | 4 +- skip/skip.go | 4 +- skip/skip_test.go | 4 +- stash/stash_modifier.go | 2 +- stash/stash_modifier_test.go | 8 +-- static/static_file_modifier.go | 4 +- static/static_file_modifier_test.go | 6 +-- status/status_modifier.go | 4 +- status/status_modifier_test.go | 4 +- status/status_verifier.go | 6 +-- status/status_verifier_test.go | 8 +-- trafficshape/bucket.go | 2 +- trafficshape/handler.go | 2 +- trafficshape/listener.go | 2 +- verify/verify.go | 2 +- verify/verify_handlers.go | 4 +- verify/verify_handlers_test.go | 2 +- 126 files changed, 365 insertions(+), 347 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/README.md b/README.md index 00fc45dd2..e43d35a9d 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,17 @@ Martian is a great tool to use if you want to: By taking advantage of Go cross-compilation, Martian can be deployed anywhere that Go can target. +## Latest Version + +v3.0.0 + ## Requirements -Go 1.9 +Go 1.11 + +## Go Modules Support + +Martian Proxy added support for Go modules since v3.0.0. If you use a Go version that does not support modules, this will break you. The latest version without Go modules support was tagged v2.1.0. ## Getting Started diff --git a/api/forwarder.go b/api/forwarder.go index 4f2789a4d..1b1eb99f6 100644 --- a/api/forwarder.go +++ b/api/forwarder.go @@ -20,8 +20,8 @@ import ( "fmt" "net/http" - "github.com/google/martian" - "github.com/google/martian/log" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" ) // Forwarder is a request modifier that routes the request to the API server and diff --git a/api/forwarder_test.go b/api/forwarder_test.go index 0e8f78cfc..fa8c7d624 100644 --- a/api/forwarder_test.go +++ b/api/forwarder_test.go @@ -18,7 +18,7 @@ import ( "net/http" "testing" - "github.com/google/martian" + "github.com/google/martian/v3" ) func TestApiForwarder(t *testing.T) { diff --git a/auth/auth_filter.go b/auth/auth_filter.go index 56bde7f9c..755a57596 100644 --- a/auth/auth_filter.go +++ b/auth/auth_filter.go @@ -21,7 +21,7 @@ import ( "net/http" "sync" - "github.com/google/martian" + "github.com/google/martian/v3" ) // Filter filters RequestModifiers and ResponseModifiers by auth ID. diff --git a/auth/auth_filter_test.go b/auth/auth_filter_test.go index 849dd1682..27502e329 100644 --- a/auth/auth_filter_test.go +++ b/auth/auth_filter_test.go @@ -18,9 +18,9 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" ) func TestFilter(t *testing.T) { diff --git a/auth/context.go b/auth/context.go index 5881bdb89..d0ce5008a 100644 --- a/auth/context.go +++ b/auth/context.go @@ -17,7 +17,7 @@ package auth import ( "sync" - "github.com/google/martian" + "github.com/google/martian/v3" ) const key = "auth.Context" diff --git a/body/body_modifier.go b/body/body_modifier.go index 92c017bb3..6d91d87d2 100644 --- a/body/body_modifier.go +++ b/body/body_modifier.go @@ -28,8 +28,8 @@ import ( "strconv" "strings" - "github.com/google/martian/log" - "github.com/google/martian/parse" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" ) func init() { diff --git a/body/body_modifier_test.go b/body/body_modifier_test.go index e7d43a179..a9e7290b9 100644 --- a/body/body_modifier_test.go +++ b/body/body_modifier_test.go @@ -25,9 +25,9 @@ import ( "strings" "testing" - "github.com/google/martian/messageview" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/messageview" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestBodyModifier(t *testing.T) { diff --git a/cmd/marbl/viewer.go b/cmd/marbl/viewer.go index dcff44c26..80721df22 100644 --- a/cmd/marbl/viewer.go +++ b/cmd/marbl/viewer.go @@ -30,7 +30,7 @@ import ( "log" "os" - "github.com/google/martian/marbl" + "github.com/google/martian/v3/marbl" ) var ( diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index d5546514a..68bbbb487 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -205,33 +205,33 @@ import ( "strings" "time" - "github.com/google/martian" - mapi "github.com/google/martian/api" - "github.com/google/martian/cors" - "github.com/google/martian/fifo" - "github.com/google/martian/har" - "github.com/google/martian/httpspec" - "github.com/google/martian/marbl" - "github.com/google/martian/martianhttp" - "github.com/google/martian/martianlog" - "github.com/google/martian/mitm" - "github.com/google/martian/servemux" - "github.com/google/martian/trafficshape" - "github.com/google/martian/verify" - - _ "github.com/google/martian/body" - _ "github.com/google/martian/cookie" - _ "github.com/google/martian/failure" - _ "github.com/google/martian/martianurl" - _ "github.com/google/martian/method" - _ "github.com/google/martian/pingback" - _ "github.com/google/martian/port" - _ "github.com/google/martian/priority" - _ "github.com/google/martian/querystring" - _ "github.com/google/martian/skip" - _ "github.com/google/martian/stash" - _ "github.com/google/martian/static" - _ "github.com/google/martian/status" + "github.com/google/martian/v3" + mapi "github.com/google/martian/v3/api" + "github.com/google/martian/v3/cors" + "github.com/google/martian/v3/fifo" + "github.com/google/martian/v3/har" + "github.com/google/martian/v3/httpspec" + "github.com/google/martian/v3/marbl" + "github.com/google/martian/v3/martianhttp" + "github.com/google/martian/v3/martianlog" + "github.com/google/martian/v3/mitm" + "github.com/google/martian/v3/servemux" + "github.com/google/martian/v3/trafficshape" + "github.com/google/martian/v3/verify" + + _ "github.com/google/martian/v3/body" + _ "github.com/google/martian/v3/cookie" + _ "github.com/google/martian/v3/failure" + _ "github.com/google/martian/v3/martianurl" + _ "github.com/google/martian/v3/method" + _ "github.com/google/martian/v3/pingback" + _ "github.com/google/martian/v3/port" + _ "github.com/google/martian/v3/priority" + _ "github.com/google/martian/v3/querystring" + _ "github.com/google/martian/v3/skip" + _ "github.com/google/martian/v3/stash" + _ "github.com/google/martian/v3/static" + _ "github.com/google/martian/v3/status" ) var ( diff --git a/cmd/proxy/main_test.go b/cmd/proxy/main_test.go index fe7702cc0..53cc45999 100644 --- a/cmd/proxy/main_test.go +++ b/cmd/proxy/main_test.go @@ -30,7 +30,7 @@ import ( "testing" "time" - "github.com/google/martian/mitm" + "github.com/google/martian/v3/mitm" ) func waitForProxy(t *testing.T, c *http.Client, apiURL string) { diff --git a/cookie/cookie_filter.go b/cookie/cookie_filter.go index 5f399d26f..1e6d9cfe1 100644 --- a/cookie/cookie_filter.go +++ b/cookie/cookie_filter.go @@ -18,10 +18,10 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/filter" - "github.com/google/martian/log" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" ) var noop = martian.Noop("cookie.Filter") diff --git a/cookie/cookie_filter_test.go b/cookie/cookie_filter_test.go index 74aa69e3e..e8ee083e5 100644 --- a/cookie/cookie_filter_test.go +++ b/cookie/cookie_filter_test.go @@ -18,11 +18,11 @@ import ( "net/http" "testing" - "github.com/google/martian/filter" - _ "github.com/google/martian/header" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/filter" + _ "github.com/google/martian/v3/header" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestFilterFromJSON(t *testing.T) { diff --git a/cookie/cookie_matcher.go b/cookie/cookie_matcher.go index d1b1f439a..b6b5ffdb6 100644 --- a/cookie/cookie_matcher.go +++ b/cookie/cookie_matcher.go @@ -17,7 +17,7 @@ package cookie import ( "net/http" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // Matcher is a conditonal evalutor of request or diff --git a/cookie/cookie_modifier.go b/cookie/cookie_modifier.go index 366f02ae7..c0f9b0f6a 100644 --- a/cookie/cookie_modifier.go +++ b/cookie/cookie_modifier.go @@ -20,9 +20,9 @@ import ( "net/http" "time" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" ) func init() { diff --git a/cookie/cookie_modifier_test.go b/cookie/cookie_modifier_test.go index 417cece6e..30527716c 100644 --- a/cookie/cookie_modifier_test.go +++ b/cookie/cookie_modifier_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestCookieModifier(t *testing.T) { diff --git a/failure/failure_verifier.go b/failure/failure_verifier.go index 9f675a108..7a2de541f 100644 --- a/failure/failure_verifier.go +++ b/failure/failure_verifier.go @@ -23,9 +23,9 @@ import ( "fmt" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func init() { diff --git a/failure/failure_verifier_test.go b/failure/failure_verifier_test.go index c87b0a197..38ef34082 100644 --- a/failure/failure_verifier_test.go +++ b/failure/failure_verifier_test.go @@ -18,9 +18,9 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func TestVerifyRequestFails(t *testing.T) { diff --git a/fifo/fifo_group.go b/fifo/fifo_group.go index 702b3367c..367040548 100644 --- a/fifo/fifo_group.go +++ b/fifo/fifo_group.go @@ -25,10 +25,10 @@ import ( "net/http" "sync" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) // Group is a martian.RequestResponseModifier that maintains lists of diff --git a/fifo/fifo_group_test.go b/fifo/fifo_group_test.go index 421845473..4b85d9f49 100644 --- a/fifo/fifo_group_test.go +++ b/fifo/fifo_group_test.go @@ -21,13 +21,13 @@ import ( "reflect" "testing" - "github.com/google/martian" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" - _ "github.com/google/martian/header" + _ "github.com/google/martian/v3/header" ) func TestGroupFromJSON(t *testing.T) { diff --git a/filter/filter.go b/filter/filter.go index fb86ce443..b95864141 100644 --- a/filter/filter.go +++ b/filter/filter.go @@ -20,9 +20,9 @@ import ( "fmt" "net/http" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/verify" ) var noop = martian.Noop("Filter") diff --git a/filter/filter_test.go b/filter/filter_test.go index 4e3f09a8a..5af160750 100644 --- a/filter/filter_test.go +++ b/filter/filter_test.go @@ -19,9 +19,9 @@ import ( "net/http" "testing" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" ) func TestRequestWhenTrueCondition(t *testing.T) { diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..f9a54ed45 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/google/martian/v3 + +go 1.11 + +require golang.org/x/net v0.0.0-20190628185345-da137c7871d7 diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..549168c4c --- /dev/null +++ b/go.sum @@ -0,0 +1,5 @@ +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/har/har.go b/har/har.go index b63138d5a..7f38ddac9 100644 --- a/har/har.go +++ b/har/har.go @@ -33,10 +33,10 @@ import ( "time" "unicode/utf8" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/messageview" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/messageview" + "github.com/google/martian/v3/proxyutil" ) // Logger maintains request and response log entries. diff --git a/har/har_handlers.go b/har/har_handlers.go index 6ab0016fe..aca499140 100644 --- a/har/har_handlers.go +++ b/har/har_handlers.go @@ -20,7 +20,7 @@ import ( "net/url" "strconv" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) type exportHandler struct { diff --git a/har/har_handlers_test.go b/har/har_handlers_test.go index 3f7014378..5e494d314 100644 --- a/har/har_handlers_test.go +++ b/har/har_handlers_test.go @@ -20,8 +20,8 @@ import ( "net/http/httptest" "testing" - "github.com/google/martian" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/proxyutil" ) func TestExportHandlerServeHTTP(t *testing.T) { diff --git a/har/har_test.go b/har/har_test.go index 4f723c03b..35631c3ac 100644 --- a/har/har_test.go +++ b/har/har_test.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/google/martian" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/proxyutil" ) func TestModifyRequest(t *testing.T) { diff --git a/header/copy_modifier.go b/header/copy_modifier.go index ce0d23e2b..c1defd065 100644 --- a/header/copy_modifier.go +++ b/header/copy_modifier.go @@ -18,10 +18,10 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func init() { diff --git a/header/copy_modifier_test.go b/header/copy_modifier_test.go index 64092bd4c..3e1d14407 100644 --- a/header/copy_modifier_test.go +++ b/header/copy_modifier_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestCopyModifier(t *testing.T) { diff --git a/header/forwarded_modifier.go b/header/forwarded_modifier.go index 9b336ae70..4f8eaf79d 100644 --- a/header/forwarded_modifier.go +++ b/header/forwarded_modifier.go @@ -18,7 +18,7 @@ import ( "net" "net/http" - "github.com/google/martian" + "github.com/google/martian/v3" ) // NewForwardedModifier sets the X-Forwarded-For, X-Forwarded-Proto, diff --git a/header/framing_modifier.go b/header/framing_modifier.go index f492bc7f0..df62b34f4 100644 --- a/header/framing_modifier.go +++ b/header/framing_modifier.go @@ -19,7 +19,7 @@ import ( "net/http" "strings" - "github.com/google/martian" + "github.com/google/martian/v3" ) // NewBadFramingModifier makes a best effort to fix inconsistencies in the diff --git a/header/header_append_modifier.go b/header/header_append_modifier.go index 30c642d5e..2cfed68fd 100644 --- a/header/header_append_modifier.go +++ b/header/header_append_modifier.go @@ -18,9 +18,9 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func init() { diff --git a/header/header_append_modifier_test.go b/header/header_append_modifier_test.go index 3cb0dcfd6..392da0774 100644 --- a/header/header_append_modifier_test.go +++ b/header/header_append_modifier_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestModifyRequestWithMultipleHeaders(t *testing.T) { diff --git a/header/header_blacklist_modifier.go b/header/header_blacklist_modifier.go index 2da8f875d..e3133afa4 100644 --- a/header/header_blacklist_modifier.go +++ b/header/header_blacklist_modifier.go @@ -18,9 +18,9 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func init() { diff --git a/header/header_blacklist_modifier_test.go b/header/header_blacklist_modifier_test.go index 20e917254..bfbe98604 100644 --- a/header/header_blacklist_modifier_test.go +++ b/header/header_blacklist_modifier_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestBlacklistModifierOnRequest(t *testing.T) { diff --git a/header/header_filter.go b/header/header_filter.go index c905b3706..c721b57a4 100644 --- a/header/header_filter.go +++ b/header/header_filter.go @@ -18,9 +18,9 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/filter" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/parse" ) var noop = martian.Noop("header.Filter") diff --git a/header/header_filter_test.go b/header/header_filter_test.go index a6e6c356f..e2f402f59 100644 --- a/header/header_filter_test.go +++ b/header/header_filter_test.go @@ -18,10 +18,10 @@ import ( "net/http" "testing" - "github.com/google/martian/filter" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestFilterFromJSON(t *testing.T) { diff --git a/header/header_matcher.go b/header/header_matcher.go index 1c29558f8..6abed5f28 100644 --- a/header/header_matcher.go +++ b/header/header_matcher.go @@ -17,7 +17,7 @@ package header import ( "net/http" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) // Matcher is a conditonal evalutor of request or diff --git a/header/header_modifier.go b/header/header_modifier.go index a73138a2b..140bf1fbd 100644 --- a/header/header_modifier.go +++ b/header/header_modifier.go @@ -18,9 +18,9 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func init() { diff --git a/header/header_modifier_test.go b/header/header_modifier_test.go index 5707a5df3..0b343a0c1 100644 --- a/header/header_modifier_test.go +++ b/header/header_modifier_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestNewHeaderModifier(t *testing.T) { diff --git a/header/header_value_regex_filter.go b/header/header_value_regex_filter.go index 2b71ccb4f..eace718e8 100644 --- a/header/header_value_regex_filter.go +++ b/header/header_value_regex_filter.go @@ -19,8 +19,8 @@ import ( "net/http" "regexp" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) // ValueRegexFilter executes resmod and reqmod when the header diff --git a/header/header_verifier.go b/header/header_verifier.go index 6b4056eda..3599d2653 100644 --- a/header/header_verifier.go +++ b/header/header_verifier.go @@ -22,10 +22,10 @@ import ( "net/http" "strings" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" ) const ( diff --git a/header/header_verifier_test.go b/header/header_verifier_test.go index 5cf62905b..29640c41d 100644 --- a/header/header_verifier_test.go +++ b/header/header_verifier_test.go @@ -19,10 +19,10 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" ) func TestVerifyRequestsBlankValue(t *testing.T) { diff --git a/header/hopbyhop_modifier.go b/header/hopbyhop_modifier.go index d25900719..d50ceaf9f 100644 --- a/header/hopbyhop_modifier.go +++ b/header/hopbyhop_modifier.go @@ -18,7 +18,7 @@ import ( "net/http" "strings" - "github.com/google/martian" + "github.com/google/martian/v3" ) // Hop-by-hop headers as defined by RFC2616. diff --git a/header/hopbyhop_modifier_test.go b/header/hopbyhop_modifier_test.go index 6d92a0fcb..d192f9b4d 100644 --- a/header/hopbyhop_modifier_test.go +++ b/header/hopbyhop_modifier_test.go @@ -18,7 +18,7 @@ import ( "net/http" "testing" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) func TestRemoveHopByHopHeaders(t *testing.T) { diff --git a/header/id_modifier.go b/header/id_modifier.go index d17090107..17328559b 100644 --- a/header/id_modifier.go +++ b/header/id_modifier.go @@ -18,8 +18,8 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) const idHeaderName string = "X-Martian-ID" diff --git a/header/id_modifier_test.go b/header/id_modifier_test.go index fe4626ed4..a800d267c 100644 --- a/header/id_modifier_test.go +++ b/header/id_modifier_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) func TestIdModifier(t *testing.T) { diff --git a/header/via_modifier.go b/header/via_modifier.go index a3525056e..d85ece7a7 100644 --- a/header/via_modifier.go +++ b/header/via_modifier.go @@ -22,7 +22,7 @@ import ( "regexp" "strings" - "github.com/google/martian" + "github.com/google/martian/v3" ) const viaLoopKey = "via.LoopDetection" diff --git a/header/via_modifier_test.go b/header/via_modifier_test.go index f32a84e98..8a7617eed 100644 --- a/header/via_modifier_test.go +++ b/header/via_modifier_test.go @@ -19,8 +19,8 @@ import ( "strings" "testing" - "github.com/google/martian" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/proxyutil" ) func TestViaModifier(t *testing.T) { diff --git a/httpspec/httpspec.go b/httpspec/httpspec.go index 5e4cab9a8..bc188d03a 100644 --- a/httpspec/httpspec.go +++ b/httpspec/httpspec.go @@ -19,8 +19,8 @@ package httpspec import ( - "github.com/google/martian/fifo" - "github.com/google/martian/header" + "github.com/google/martian/v3/fifo" + "github.com/google/martian/v3/header" ) // NewStack returns a martian modifier stack that handles ensuring proper proxy diff --git a/httpspec/httpspec_test.go b/httpspec/httpspec_test.go index 549db1956..19764edc8 100644 --- a/httpspec/httpspec_test.go +++ b/httpspec/httpspec_test.go @@ -19,9 +19,9 @@ import ( "strings" "testing" - "github.com/google/martian" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" ) func TestNewStack(t *testing.T) { diff --git a/init.go b/init.go index d12481576..0ca1886c4 100644 --- a/init.go +++ b/init.go @@ -17,7 +17,7 @@ package martian import ( "flag" - mlog "github.com/google/martian/log" + mlog "github.com/google/martian/v3/log" ) var ( diff --git a/ipauth/ipauth.go b/ipauth/ipauth.go index 092821cb0..5a1b6370d 100644 --- a/ipauth/ipauth.go +++ b/ipauth/ipauth.go @@ -19,8 +19,8 @@ import ( "net" "net/http" - "github.com/google/martian" - "github.com/google/martian/auth" + "github.com/google/martian/v3" + "github.com/google/martian/v3/auth" ) var noop = martian.Noop("ipauth.Modifier") diff --git a/ipauth/ipauth_test.go b/ipauth/ipauth_test.go index f1e05bb0b..dd05aafac 100644 --- a/ipauth/ipauth_test.go +++ b/ipauth/ipauth_test.go @@ -19,10 +19,10 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/auth" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/auth" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" ) func TestModifyRequest(t *testing.T) { diff --git a/marbl/handler.go b/marbl/handler.go index 7ca35ae50..685d9991b 100644 --- a/marbl/handler.go +++ b/marbl/handler.go @@ -20,7 +20,7 @@ import ( "net/http" "sync" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" "golang.org/x/net/websocket" ) diff --git a/marbl/marbl.go b/marbl/marbl.go index 28236a6aa..4a72dee9f 100644 --- a/marbl/marbl.go +++ b/marbl/marbl.go @@ -43,9 +43,9 @@ import ( "sync/atomic" "time" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/proxyutil" ) // MessageType incicates whether the message represents an HTTP request or response. diff --git a/marbl/marbl_test.go b/marbl/marbl_test.go index 3f387ee69..0460bf5dc 100644 --- a/marbl/marbl_test.go +++ b/marbl/marbl_test.go @@ -23,8 +23,8 @@ import ( "testing" "time" - "github.com/google/martian" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/proxyutil" ) func TestMarkAPIRequestsWithHeader(t *testing.T) { diff --git a/marbl/modifier.go b/marbl/modifier.go index 65b112e65..2a0a34399 100644 --- a/marbl/modifier.go +++ b/marbl/modifier.go @@ -18,7 +18,7 @@ import ( "io" "net/http" - "github.com/google/martian" + "github.com/google/martian/v3" ) // Modifier implements the Martian modifier interface so that marbl logs diff --git a/martian_test.go b/martian_test.go index 3a0eeff00..41cc6e31a 100644 --- a/martian_test.go +++ b/martian_test.go @@ -18,7 +18,7 @@ import ( "net/http" "testing" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) func TestModifierFuncs(t *testing.T) { diff --git a/martianhttp/authority_handler_test.go b/martianhttp/authority_handler_test.go index f6edd3813..e66de4445 100644 --- a/martianhttp/authority_handler_test.go +++ b/martianhttp/authority_handler_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/google/martian/mitm" + "github.com/google/martian/v3/mitm" ) func TestAuthorityHandler(t *testing.T) { diff --git a/martianhttp/martianhttp.go b/martianhttp/martianhttp.go index 7992a4235..3ee47f5ab 100644 --- a/martianhttp/martianhttp.go +++ b/martianhttp/martianhttp.go @@ -22,10 +22,10 @@ import ( "net/http" "sync" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) var noop = martian.Noop("martianhttp.Modifier") diff --git a/martianhttp/martianhttp_integration_test.go b/martianhttp/martianhttp_integration_test.go index ef6ab5839..59e4d4dde 100644 --- a/martianhttp/martianhttp_integration_test.go +++ b/martianhttp/martianhttp_integration_test.go @@ -22,10 +22,10 @@ import ( "strings" "testing" - "github.com/google/martian" - "github.com/google/martian/martiantest" + "github.com/google/martian/v3" + "github.com/google/martian/v3/martiantest" - _ "github.com/google/martian/header" + _ "github.com/google/martian/v3/header" ) func TestIntegration(t *testing.T) { diff --git a/martianhttp/martianhttp_test.go b/martianhttp/martianhttp_test.go index 9bb681252..51658e3c6 100644 --- a/martianhttp/martianhttp_test.go +++ b/martianhttp/martianhttp_test.go @@ -22,11 +22,11 @@ import ( "net/http/httptest" "testing" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" - _ "github.com/google/martian/header" + _ "github.com/google/martian/v3/header" ) func TestNoModifiers(t *testing.T) { diff --git a/martianlog/logger.go b/martianlog/logger.go index f2ee9449d..ff3c09407 100644 --- a/martianlog/logger.go +++ b/martianlog/logger.go @@ -23,10 +23,10 @@ import ( "net/http" "strings" - "github.com/google/martian" - "github.com/google/martian/log" - "github.com/google/martian/messageview" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/messageview" + "github.com/google/martian/v3/parse" ) // Logger is a modifier that logs requests and responses. diff --git a/martianlog/logger_test.go b/martianlog/logger_test.go index bbfeb6ab5..cae003895 100644 --- a/martianlog/logger_test.go +++ b/martianlog/logger_test.go @@ -22,9 +22,9 @@ import ( "strings" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func ExampleLogger() { diff --git a/martiantest/martiantest_test.go b/martiantest/martiantest_test.go index 0fa6c0f5c..d54a5e76c 100644 --- a/martiantest/martiantest_test.go +++ b/martiantest/martiantest_test.go @@ -19,7 +19,7 @@ import ( "net/http" "testing" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) func TestModifier(t *testing.T) { diff --git a/martiantest/transport.go b/martiantest/transport.go index 661c1e036..ea9eb8db6 100644 --- a/martiantest/transport.go +++ b/martiantest/transport.go @@ -3,7 +3,7 @@ package martiantest import ( "net/http" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) // Transport is an http.RoundTripper for testing. diff --git a/martiantest/transport_test.go b/martiantest/transport_test.go index 32491f682..273385520 100644 --- a/martiantest/transport_test.go +++ b/martiantest/transport_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) func TestTransport(t *testing.T) { diff --git a/martianurl/url_filter.go b/martianurl/url_filter.go index 6dded1494..8c0c09a69 100644 --- a/martianurl/url_filter.go +++ b/martianurl/url_filter.go @@ -18,10 +18,10 @@ import ( "encoding/json" "net/url" - "github.com/google/martian" - "github.com/google/martian/filter" - "github.com/google/martian/log" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" ) var noop = martian.Noop("url.Filter") diff --git a/martianurl/url_filter_test.go b/martianurl/url_filter_test.go index 26f51efff..e786797bf 100644 --- a/martianurl/url_filter_test.go +++ b/martianurl/url_filter_test.go @@ -20,12 +20,12 @@ import ( "net/url" "testing" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" - _ "github.com/google/martian/header" + _ "github.com/google/martian/v3/header" ) func TestFilterModifyRequest(t *testing.T) { diff --git a/martianurl/url_matcher.go b/martianurl/url_matcher.go index 34e5ef2b2..a5582d78c 100644 --- a/martianurl/url_matcher.go +++ b/martianurl/url_matcher.go @@ -18,7 +18,7 @@ import ( "net/http" "net/url" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // Matcher is a conditional evaluator of request urls to be used in diff --git a/martianurl/url_modifier.go b/martianurl/url_modifier.go index 40b4b7608..e70302f61 100644 --- a/martianurl/url_modifier.go +++ b/martianurl/url_modifier.go @@ -21,8 +21,8 @@ import ( "net/http" "net/url" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) // Modifier alters the request URL fields to match the fields of diff --git a/martianurl/url_modifier_test.go b/martianurl/url_modifier_test.go index e046cef8f..0cd17947c 100644 --- a/martianurl/url_modifier_test.go +++ b/martianurl/url_modifier_test.go @@ -20,7 +20,7 @@ import ( "net/url" "testing" - "github.com/google/martian/parse" + "github.com/google/martian/v3/parse" ) func TestNewModifier(t *testing.T) { diff --git a/martianurl/url_regex_filter.go b/martianurl/url_regex_filter.go index c2db51012..34ada45c2 100644 --- a/martianurl/url_regex_filter.go +++ b/martianurl/url_regex_filter.go @@ -18,8 +18,8 @@ import ( "encoding/json" "regexp" - "github.com/google/martian/filter" - "github.com/google/martian/parse" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/parse" ) func init() { diff --git a/martianurl/url_regex_filter_test.go b/martianurl/url_regex_filter_test.go index b74aa3c9e..eba2cfc8e 100644 --- a/martianurl/url_regex_filter_test.go +++ b/martianurl/url_regex_filter_test.go @@ -19,10 +19,10 @@ import ( "regexp" "testing" - "github.com/google/martian" - _ "github.com/google/martian/header" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + _ "github.com/google/martian/v3/header" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestRegexFilterModifyRequest(t *testing.T) { diff --git a/martianurl/url_verifier.go b/martianurl/url_verifier.go index 4da19c3b8..7617d8f0a 100644 --- a/martianurl/url_verifier.go +++ b/martianurl/url_verifier.go @@ -21,9 +21,9 @@ import ( "net/url" "strings" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) const ( diff --git a/martianurl/url_verifier_test.go b/martianurl/url_verifier_test.go index 378e4d0ce..c44e826b0 100644 --- a/martianurl/url_verifier_test.go +++ b/martianurl/url_verifier_test.go @@ -19,9 +19,9 @@ import ( "net/url" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func TestVerifyRequests(t *testing.T) { diff --git a/messageview/messageview_test.go b/messageview/messageview_test.go index 6a279295d..8161faabf 100644 --- a/messageview/messageview_test.go +++ b/messageview/messageview_test.go @@ -25,7 +25,7 @@ import ( "strings" "testing" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/proxyutil" ) func TestRequestViewHeadersOnly(t *testing.T) { diff --git a/method/method_filter.go b/method/method_filter.go index d63664f40..26b978f2c 100644 --- a/method/method_filter.go +++ b/method/method_filter.go @@ -19,10 +19,10 @@ import ( "net/http" "strings" - "github.com/google/martian" - "github.com/google/martian/filter" - "github.com/google/martian/log" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/parse" ) var noop = martian.Noop("method.Filter") diff --git a/method/method_filter_test.go b/method/method_filter_test.go index 4f2a8727a..7a5444bb5 100644 --- a/method/method_filter_test.go +++ b/method/method_filter_test.go @@ -18,10 +18,10 @@ import ( "net/http" "testing" - _ "github.com/google/martian/header" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + _ "github.com/google/martian/v3/header" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestFilterModifyRequest(t *testing.T) { diff --git a/method/method_verifier.go b/method/method_verifier.go index b4c50ea23..a161b6f34 100644 --- a/method/method_verifier.go +++ b/method/method_verifier.go @@ -20,9 +20,9 @@ import ( "fmt" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) type verifier struct { diff --git a/method/method_verifier_test.go b/method/method_verifier_test.go index bda4bbc4f..93e4b93ec 100644 --- a/method/method_verifier_test.go +++ b/method/method_verifier_test.go @@ -18,9 +18,9 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func TestVerifierFromJSON(t *testing.T) { diff --git a/mitm/mitm.go b/mitm/mitm.go index 921641498..29d113bf7 100644 --- a/mitm/mitm.go +++ b/mitm/mitm.go @@ -32,7 +32,7 @@ import ( "sync" "time" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // MaxSerialNumber is the upper boundary that is used to create unique serial diff --git a/mobile/proxy.go b/mobile/proxy.go index 80e3a687b..e16cb9495 100644 --- a/mobile/proxy.go +++ b/mobile/proxy.go @@ -26,36 +26,36 @@ import ( "path" "time" - "github.com/google/martian" - "github.com/google/martian/api" - "github.com/google/martian/cors" - "github.com/google/martian/cybervillains" - "github.com/google/martian/fifo" - "github.com/google/martian/har" - "github.com/google/martian/httpspec" - mlog "github.com/google/martian/log" - "github.com/google/martian/marbl" - "github.com/google/martian/martianhttp" - "github.com/google/martian/mitm" - "github.com/google/martian/servemux" - "github.com/google/martian/trafficshape" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/api" + "github.com/google/martian/v3/cors" + "github.com/google/martian/v3/cybervillains" + "github.com/google/martian/v3/fifo" + "github.com/google/martian/v3/har" + "github.com/google/martian/v3/httpspec" + mlog "github.com/google/martian/v3/log" + "github.com/google/martian/v3/marbl" + "github.com/google/martian/v3/martianhttp" + "github.com/google/martian/v3/mitm" + "github.com/google/martian/v3/servemux" + "github.com/google/martian/v3/trafficshape" + "github.com/google/martian/v3/verify" // side-effect importing to register with JSON API - _ "github.com/google/martian/body" - _ "github.com/google/martian/cookie" - _ "github.com/google/martian/failure" - _ "github.com/google/martian/header" - _ "github.com/google/martian/martianurl" - _ "github.com/google/martian/method" - _ "github.com/google/martian/pingback" - _ "github.com/google/martian/port" - _ "github.com/google/martian/priority" - _ "github.com/google/martian/querystring" - _ "github.com/google/martian/skip" - _ "github.com/google/martian/stash" - _ "github.com/google/martian/static" - _ "github.com/google/martian/status" + _ "github.com/google/martian/v3/body" + _ "github.com/google/martian/v3/cookie" + _ "github.com/google/martian/v3/failure" + _ "github.com/google/martian/v3/header" + _ "github.com/google/martian/v3/martianurl" + _ "github.com/google/martian/v3/method" + _ "github.com/google/martian/v3/pingback" + _ "github.com/google/martian/v3/port" + _ "github.com/google/martian/v3/priority" + _ "github.com/google/martian/v3/querystring" + _ "github.com/google/martian/v3/skip" + _ "github.com/google/martian/v3/stash" + _ "github.com/google/martian/v3/static" + _ "github.com/google/martian/v3/status" ) // Martian is a wrapper for the initialized Martian proxy diff --git a/noop.go b/noop.go index 468acf843..c86fa4ae5 100644 --- a/noop.go +++ b/noop.go @@ -17,7 +17,7 @@ package martian import ( "net/http" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) type noopModifier struct { diff --git a/nosigpipe/nosigpipe_darwin.go b/nosigpipe/nosigpipe_darwin.go index 77a341b00..a65220485 100644 --- a/nosigpipe/nosigpipe_darwin.go +++ b/nosigpipe/nosigpipe_darwin.go @@ -6,7 +6,7 @@ import ( "net" "syscall" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // IgnoreSIGPIPE prevents SIGPIPE from being raised on TCP sockets when remote hangs up diff --git a/parse/parse.go b/parse/parse.go index f533b2eed..760496c12 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -20,7 +20,7 @@ import ( "fmt" "sync" - "github.com/google/martian" + "github.com/google/martian/v3" ) // ModifierType is the HTTP message type. diff --git a/parse/parse_test.go b/parse/parse_test.go index ddc1e0bb9..ca95d6625 100644 --- a/parse/parse_test.go +++ b/parse/parse_test.go @@ -19,8 +19,8 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/martiantest" + "github.com/google/martian/v3" + "github.com/google/martian/v3/martiantest" ) func TestFromJSON(t *testing.T) { diff --git a/pingback/pingback_verifier.go b/pingback/pingback_verifier.go index 2ea9732b8..e51457280 100644 --- a/pingback/pingback_verifier.go +++ b/pingback/pingback_verifier.go @@ -22,9 +22,9 @@ import ( "net/http" "net/url" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) const ( diff --git a/pingback/pingback_verifier_test.go b/pingback/pingback_verifier_test.go index 9b7921c6d..a59af147b 100644 --- a/pingback/pingback_verifier_test.go +++ b/pingback/pingback_verifier_test.go @@ -19,9 +19,9 @@ import ( "net/url" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func TestVerifyRequests(t *testing.T) { diff --git a/port/port_filter.go b/port/port_filter.go index b11e1bdfb..058c43e7f 100644 --- a/port/port_filter.go +++ b/port/port_filter.go @@ -23,8 +23,8 @@ import ( "strconv" "strings" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) var noop = martian.Noop("port.Filter") diff --git a/port/port_filter_test.go b/port/port_filter_test.go index b2e8964c5..395fd20bb 100644 --- a/port/port_filter_test.go +++ b/port/port_filter_test.go @@ -19,10 +19,10 @@ import ( "net/url" "testing" - _ "github.com/google/martian/header" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + _ "github.com/google/martian/v3/header" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestFilterModifyRequest(t *testing.T) { diff --git a/port/port_modifier.go b/port/port_modifier.go index 4c598e1d8..885cbe0e5 100644 --- a/port/port_modifier.go +++ b/port/port_modifier.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/google/martian/parse" + "github.com/google/martian/v3/parse" ) func init() { diff --git a/port/port_modifier_test.go b/port/port_modifier_test.go index f0d37299e..08712c3e7 100644 --- a/port/port_modifier_test.go +++ b/port/port_modifier_test.go @@ -19,7 +19,7 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" + "github.com/google/martian/v3/parse" ) func TestPortModifierOnPort(t *testing.T) { diff --git a/priority/priority_group.go b/priority/priority_group.go index 4ee8a9e06..52094a525 100644 --- a/priority/priority_group.go +++ b/priority/priority_group.go @@ -21,8 +21,8 @@ import ( "net/http" "sync" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) var ( diff --git a/priority/priority_group_test.go b/priority/priority_group_test.go index d06ef2aaf..d66fec63d 100644 --- a/priority/priority_group_test.go +++ b/priority/priority_group_test.go @@ -20,12 +20,12 @@ import ( "reflect" "testing" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" // Import to register header.Modifier with JSON parser. - _ "github.com/google/martian/header" + _ "github.com/google/martian/v3/header" ) func TestPriorityGroupModifyRequest(t *testing.T) { diff --git a/proxy.go b/proxy.go index 264125c98..833e9999d 100644 --- a/proxy.go +++ b/proxy.go @@ -28,11 +28,11 @@ import ( "sync" "time" - "github.com/google/martian/log" - "github.com/google/martian/mitm" - "github.com/google/martian/nosigpipe" - "github.com/google/martian/proxyutil" - "github.com/google/martian/trafficshape" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/mitm" + "github.com/google/martian/v3/nosigpipe" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/trafficshape" ) var errClose = errors.New("closing connection") diff --git a/proxy_test.go b/proxy_test.go index 3b337ae0f..233dfbb2a 100644 --- a/proxy_test.go +++ b/proxy_test.go @@ -31,10 +31,10 @@ import ( "testing" "time" - "github.com/google/martian/log" - "github.com/google/martian/martiantest" - "github.com/google/martian/mitm" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/mitm" + "github.com/google/martian/v3/proxyutil" ) type tempError struct{} diff --git a/proxy_trafficshaping_test.go b/proxy_trafficshaping_test.go index 4a467c851..929f00e47 100644 --- a/proxy_trafficshaping_test.go +++ b/proxy_trafficshaping_test.go @@ -11,9 +11,9 @@ import ( "testing" "time" - "github.com/google/martian/log" - "github.com/google/martian/martiantest" - "github.com/google/martian/trafficshape" + "github.com/google/martian/v3/log" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/trafficshape" ) // Tests that sending data of length 600 bytes with max bandwidth of 100 bytes/s takes diff --git a/proxyauth/proxyauth.go b/proxyauth/proxyauth.go index 692d7efcb..17934b6df 100644 --- a/proxyauth/proxyauth.go +++ b/proxyauth/proxyauth.go @@ -21,8 +21,8 @@ import ( "net/http" "strings" - "github.com/google/martian" - "github.com/google/martian/auth" + "github.com/google/martian/v3" + "github.com/google/martian/v3/auth" ) var noop = martian.Noop("proxyauth.Modifier") diff --git a/proxyauth/proxyauth_test.go b/proxyauth/proxyauth_test.go index 3586c0dc2..6fa736400 100644 --- a/proxyauth/proxyauth_test.go +++ b/proxyauth/proxyauth_test.go @@ -20,10 +20,10 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/auth" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/auth" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" ) func encode(v string) string { diff --git a/querystring/query_string_filter.go b/querystring/query_string_filter.go index 2409f3f56..155683b50 100644 --- a/querystring/query_string_filter.go +++ b/querystring/query_string_filter.go @@ -17,9 +17,9 @@ package querystring import ( "encoding/json" - "github.com/google/martian" - "github.com/google/martian/filter" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/filter" + "github.com/google/martian/v3/parse" ) var noop = martian.Noop("querystring.Filter") diff --git a/querystring/query_string_filter_test.go b/querystring/query_string_filter_test.go index f917a96eb..3bb31a00c 100644 --- a/querystring/query_string_filter_test.go +++ b/querystring/query_string_filter_test.go @@ -20,14 +20,14 @@ import ( "strings" "testing" - "github.com/google/martian" - "github.com/google/martian/martiantest" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" // Import to register header.Modifier with JSON parser. - _ "github.com/google/martian/header" + _ "github.com/google/martian/v3/header" ) func TestNoModifiers(t *testing.T) { diff --git a/querystring/query_string_modifier.go b/querystring/query_string_modifier.go index b01c9a32d..4b977b75d 100644 --- a/querystring/query_string_modifier.go +++ b/querystring/query_string_modifier.go @@ -19,8 +19,8 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) func init() { diff --git a/querystring/query_string_modifier_test.go b/querystring/query_string_modifier_test.go index 18e7a9252..1003fc97e 100644 --- a/querystring/query_string_modifier_test.go +++ b/querystring/query_string_modifier_test.go @@ -18,7 +18,7 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" + "github.com/google/martian/v3/parse" ) func TestNewQueryStringModifier(t *testing.T) { diff --git a/querystring/query_string_verifier.go b/querystring/query_string_verifier.go index fe46239df..46f8bee09 100644 --- a/querystring/query_string_verifier.go +++ b/querystring/query_string_verifier.go @@ -20,9 +20,9 @@ import ( "net/http" "strings" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func init() { diff --git a/querystring/query_string_verifier_test.go b/querystring/query_string_verifier_test.go index 3cbe40b36..f0ebba497 100644 --- a/querystring/query_string_verifier_test.go +++ b/querystring/query_string_verifier_test.go @@ -18,9 +18,9 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) func TestVerifyRequestPasses(t *testing.T) { diff --git a/servemux/servemux_filter.go b/servemux/servemux_filter.go index 0de43e61a..c001ac133 100644 --- a/servemux/servemux_filter.go +++ b/servemux/servemux_filter.go @@ -19,8 +19,8 @@ package servemux import ( "net/http" - "github.com/google/martian" - "github.com/google/martian/filter" + "github.com/google/martian/v3" + "github.com/google/martian/v3/filter" ) var noop = martian.Noop("mux.Filter") diff --git a/servemux/servemux_filter_test.go b/servemux/servemux_filter_test.go index 60b25843a..f9c7de152 100644 --- a/servemux/servemux_filter_test.go +++ b/servemux/servemux_filter_test.go @@ -17,8 +17,8 @@ import ( "net/http" "testing" - "github.com/google/martian/martiantest" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/martiantest" + "github.com/google/martian/v3/proxyutil" ) func TestModifyRequest(t *testing.T) { diff --git a/skip/skip.go b/skip/skip.go index 3bd6e9e20..4ace85374 100644 --- a/skip/skip.go +++ b/skip/skip.go @@ -19,8 +19,8 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) // RoundTrip is a modifier that skips the request round-trip. diff --git a/skip/skip_test.go b/skip/skip_test.go index 07b0a656a..2482f6d29 100644 --- a/skip/skip_test.go +++ b/skip/skip_test.go @@ -18,8 +18,8 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) func TestRoundTrip(t *testing.T) { diff --git a/stash/stash_modifier.go b/stash/stash_modifier.go index 6dd33f0ac..a35183b43 100644 --- a/stash/stash_modifier.go +++ b/stash/stash_modifier.go @@ -21,7 +21,7 @@ import ( "fmt" "net/http" - "github.com/google/martian/parse" + "github.com/google/martian/v3/parse" ) func init() { diff --git a/stash/stash_modifier_test.go b/stash/stash_modifier_test.go index f5f6d48e8..7ac798390 100644 --- a/stash/stash_modifier_test.go +++ b/stash/stash_modifier_test.go @@ -19,10 +19,10 @@ import ( "net/http" "testing" - "github.com/google/martian/fifo" - "github.com/google/martian/parse" - "github.com/google/martian/port" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/fifo" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/port" + "github.com/google/martian/v3/proxyutil" ) func TestStashRequest(t *testing.T) { diff --git a/static/static_file_modifier.go b/static/static_file_modifier.go index bb026b21d..6db3a2216 100644 --- a/static/static_file_modifier.go +++ b/static/static_file_modifier.go @@ -33,8 +33,8 @@ import ( "strconv" "strings" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) // Modifier is a martian.RequestResponseModifier that routes reqeusts to rootPath diff --git a/static/static_file_modifier_test.go b/static/static_file_modifier_test.go index a753f0e56..e099543ab 100644 --- a/static/static_file_modifier_test.go +++ b/static/static_file_modifier_test.go @@ -23,9 +23,9 @@ import ( "path" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func Test404WhenExplictlyMappedFileDoesNotExist(t *testing.T) { diff --git a/status/status_modifier.go b/status/status_modifier.go index 2ff619708..1c654c5ab 100644 --- a/status/status_modifier.go +++ b/status/status_modifier.go @@ -20,8 +20,8 @@ import ( "fmt" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" ) type statusModifier struct { diff --git a/status/status_modifier_test.go b/status/status_modifier_test.go index 31d2fa924..0b654288a 100644 --- a/status/status_modifier_test.go +++ b/status/status_modifier_test.go @@ -19,8 +19,8 @@ import ( "net/http" "testing" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" ) func TestFromJSON(t *testing.T) { diff --git a/status/status_verifier.go b/status/status_verifier.go index c8f390ca1..9d39f9f8e 100644 --- a/status/status_verifier.go +++ b/status/status_verifier.go @@ -19,9 +19,9 @@ import ( "fmt" "net/http" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/verify" ) const errFormat = "response(%s) status code verify failure: got %d, want %d" diff --git a/status/status_verifier_test.go b/status/status_verifier_test.go index cb612a05f..3d72bac25 100644 --- a/status/status_verifier_test.go +++ b/status/status_verifier_test.go @@ -18,10 +18,10 @@ import ( "net/http" "testing" - "github.com/google/martian" - "github.com/google/martian/parse" - "github.com/google/martian/proxyutil" - "github.com/google/martian/verify" + "github.com/google/martian/v3" + "github.com/google/martian/v3/parse" + "github.com/google/martian/v3/proxyutil" + "github.com/google/martian/v3/verify" ) func TestVerifyResponses(t *testing.T) { diff --git a/trafficshape/bucket.go b/trafficshape/bucket.go index 9d64d5afc..1086e893d 100644 --- a/trafficshape/bucket.go +++ b/trafficshape/bucket.go @@ -20,7 +20,7 @@ import ( "sync/atomic" "time" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // Bucket is a generic leaky bucket that drains at a configurable interval and diff --git a/trafficshape/handler.go b/trafficshape/handler.go index 3318ea3c1..98eaede38 100644 --- a/trafficshape/handler.go +++ b/trafficshape/handler.go @@ -22,7 +22,7 @@ import ( "net/http" "time" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // Handler configures a trafficshape.Listener. diff --git a/trafficshape/listener.go b/trafficshape/listener.go index 8979d212a..7daae1a85 100644 --- a/trafficshape/listener.go +++ b/trafficshape/listener.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/google/martian/log" + "github.com/google/martian/v3/log" ) // ErrForceClose is an error that communicates the need to close the connection. diff --git a/verify/verify.go b/verify/verify.go index cee49749a..db69ae67d 100644 --- a/verify/verify.go +++ b/verify/verify.go @@ -19,7 +19,7 @@ package verify import ( "net/http" - "github.com/google/martian" + "github.com/google/martian/v3" ) // RequestVerifier is a RequestModifier that maintains a verification state. diff --git a/verify/verify_handlers.go b/verify/verify_handlers.go index 1c1564765..d5622fad5 100644 --- a/verify/verify_handlers.go +++ b/verify/verify_handlers.go @@ -18,8 +18,8 @@ import ( "encoding/json" "net/http" - "github.com/google/martian" - "github.com/google/martian/log" + "github.com/google/martian/v3" + "github.com/google/martian/v3/log" ) // Handler is an http.Handler that returns the request and response diff --git a/verify/verify_handlers_test.go b/verify/verify_handlers_test.go index 34b24e5e9..945c015d4 100644 --- a/verify/verify_handlers_test.go +++ b/verify/verify_handlers_test.go @@ -22,7 +22,7 @@ import ( "net/http/httptest" "testing" - "github.com/google/martian" + "github.com/google/martian/v3" ) func TestHandlerServeHTTPUnsupportedMethod(t *testing.T) {