From 73cf0fc36db8c315e8eba22fc3503367212ecb12 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 18 Dec 2020 15:04:04 +0100 Subject: [PATCH] rename reva to proxy where applicable --- proxy/config/proxy-example-migration.json | 4 ++-- proxy/config/proxy-example.json | 4 ++-- proxy/pkg/command/root.go | 2 +- proxy/pkg/config/config.go | 4 ++-- proxy/pkg/proxy/policy/selector.go | 4 ++-- proxy/pkg/proxy/policy/selector_test.go | 4 ++-- proxy/pkg/proxy/proxy.go | 2 +- proxy/pkg/proxy/proxy_integration_test.go | 16 ++++++++-------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/proxy/config/proxy-example-migration.json b/proxy/config/proxy-example-migration.json index d2ee43328..e241596dc 100644 --- a/proxy/config/proxy-example-migration.json +++ b/proxy/config/proxy-example-migration.json @@ -8,14 +8,14 @@ }, "policy_selector": { "migration": { - "acc_found_policy" : "reva", + "acc_found_policy" : "ocis", "acc_not_found_policy": "oc10", "unauthenticated_policy": "oc10" } }, "policies": [ { - "name": "reva", + "name": "ocis", "routes": [ { "endpoint": "/", diff --git a/proxy/config/proxy-example.json b/proxy/config/proxy-example.json index ed7c1a68c..887912515 100644 --- a/proxy/config/proxy-example.json +++ b/proxy/config/proxy-example.json @@ -8,12 +8,12 @@ }, "policy_selector": { "static": { - "policy": "reva" + "policy": "ocis" } }, "policies": [ { - "name": "reva", + "name": "ocis", "routes": [ { "endpoint": "/", diff --git a/proxy/pkg/command/root.go b/proxy/pkg/command/root.go index bc5265d0c..906ccaa70 100644 --- a/proxy/pkg/command/root.go +++ b/proxy/pkg/command/root.go @@ -19,7 +19,7 @@ func Execute() error { app := &cli.App{ Name: "ocis-proxy", Version: version.String, - Usage: "proxy for Reva/oCIS", + Usage: "proxy for oCIS", Compiled: version.Compiled(), Authors: []*cli.Author{ diff --git a/proxy/pkg/config/config.go b/proxy/pkg/config/config.go index 9af1fc418..29575c8ad 100644 --- a/proxy/pkg/config/config.go +++ b/proxy/pkg/config/config.go @@ -84,12 +84,12 @@ type Reva struct { Middleware Middleware } -// Middleware configures reva middlewares. +// Middleware configures proxy middlewares. type Middleware struct { Auth Auth } -// Auth configures reva http auth middleware. +// Auth configures proxy http auth middleware. type Auth struct { CredentialsByUserAgent map[string]string } diff --git a/proxy/pkg/proxy/policy/selector.go b/proxy/pkg/proxy/policy/selector.go index b886165e6..56534c0cb 100644 --- a/proxy/pkg/proxy/policy/selector.go +++ b/proxy/pkg/proxy/policy/selector.go @@ -75,7 +75,7 @@ func LoadSelector(cfg *config.PolicySelector) (Selector, error) { // Configuration: // // "policy_selector": { -// "static": {"policy" : "reva"} +// "static": {"policy" : "ocis"} // }, func NewStaticSelector(cfg *config.StaticSelectorConf) Selector { return func(ctx context.Context, r *http.Request) (s string, err error) { @@ -87,7 +87,7 @@ func NewStaticSelector(cfg *config.StaticSelectorConf) Selector { // The policy for each case is configurable: // "policy_selector": { // "migration": { -// "acc_found_policy" : "reva", +// "acc_found_policy" : "ocis", // "acc_not_found_policy": "oc10", // "unauthenticated_policy": "oc10" // } diff --git a/proxy/pkg/proxy/policy/selector_test.go b/proxy/pkg/proxy/policy/selector_test.go index afc26e13b..6c519db3e 100644 --- a/proxy/pkg/proxy/policy/selector_test.go +++ b/proxy/pkg/proxy/policy/selector_test.go @@ -15,9 +15,9 @@ import ( func TestStaticSelector(t *testing.T) { ctx := context.Background() req := httptest.NewRequest("GET", "https://example.org/foo", nil) - sel := NewStaticSelector(&config.StaticSelectorConf{Policy: "reva"}) + sel := NewStaticSelector(&config.StaticSelectorConf{Policy: "ocis"}) - want := "reva" + want := "ocis" got, err := sel(ctx, req) if got != want { t.Errorf("Expected policy %v got %v", want, got) diff --git a/proxy/pkg/proxy/proxy.go b/proxy/pkg/proxy/proxy.go index b4c2e7193..9127290df 100644 --- a/proxy/pkg/proxy/proxy.go +++ b/proxy/pkg/proxy/proxy.go @@ -269,7 +269,7 @@ func (p *MultiHostReverseProxy) prefixRouteMatcher(endpoint string, target url.U func defaultPolicies() []config.Policy { return []config.Policy{ { - Name: "reva", + Name: "ocis", Routes: []config.Route{ { Endpoint: "/", diff --git a/proxy/pkg/proxy/proxy_integration_test.go b/proxy/pkg/proxy/proxy_integration_test.go index de0af13d9..d4ff29aec 100644 --- a/proxy/pkg/proxy/proxy_integration_test.go +++ b/proxy/pkg/proxy/proxy_integration_test.go @@ -16,7 +16,7 @@ import ( func TestProxyIntegration(t *testing.T) { var tests = []testCase{ // Simple prefix route - test("simple_prefix", withPolicy("reva", withRoutes{{ + test("simple_prefix", withPolicy("ocis", withRoutes{{ Type: config.PrefixRoute, Endpoint: "/api", Backend: "http://api.example.com"}, @@ -24,7 +24,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://api.example.com/api"), // Complex prefix route, different method - test("complex_prefix_post", withPolicy("reva", withRoutes{{ + test("complex_prefix_post", withPolicy("ocis", withRoutes{{ Type: config.PrefixRoute, Endpoint: "/api", Backend: "http://api.example.com/service1/"}, @@ -32,7 +32,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://api.example.com/service1/api"), // Query route - test("query_route", withPolicy("reva", withRoutes{{ + test("query_route", withPolicy("ocis", withRoutes{{ Type: config.QueryRoute, Endpoint: "/api?format=json", Backend: "http://backend/"}, @@ -40,7 +40,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://backend/api?format=json"), // Regex route - test("regex_route", withPolicy("reva", withRoutes{{ + test("regex_route", withPolicy("ocis", withRoutes{{ Type: config.RegexRoute, Endpoint: `\/user\/(\d+)`, Backend: "http://backend/"}, @@ -48,7 +48,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://backend/user/1234"), // Multiple prefix routes 1 - test("multiple_prefix", withPolicy("reva", withRoutes{ + test("multiple_prefix", withPolicy("ocis", withRoutes{ { Type: config.PrefixRoute, Endpoint: "/api", @@ -63,7 +63,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://payment.example.com/payment"), // Multiple prefix routes 2 - test("multiple_prefix", withPolicy("reva", withRoutes{ + test("multiple_prefix", withPolicy("ocis", withRoutes{ { Type: config.PrefixRoute, Endpoint: "/api", @@ -78,7 +78,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://api.example.com/api"), // Mixed route types - test("mixed_types", withPolicy("reva", withRoutes{ + test("mixed_types", withPolicy("ocis", withRoutes{ { Type: config.PrefixRoute, Endpoint: "/api", @@ -94,7 +94,7 @@ func TestProxyIntegration(t *testing.T) { expectProxyTo("http://api.example.com/api"), // Mixed route types - test("mixed_types", withPolicy("reva", withRoutes{ + test("mixed_types", withPolicy("ocis", withRoutes{ { Type: config.PrefixRoute, Endpoint: "/api",