Merge pull request #1143 from owncloud/rename_reva_to_proxy_where_applicable

rename reva to proxy where applicable
This commit is contained in:
Willy Kloucek
2020-12-21 10:09:29 +01:00
committed by GitHub
8 changed files with 20 additions and 20 deletions

View File

@@ -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": "/",

View File

@@ -8,12 +8,12 @@
},
"policy_selector": {
"static": {
"policy": "reva"
"policy": "ocis"
}
},
"policies": [
{
"name": "reva",
"name": "ocis",
"routes": [
{
"endpoint": "/",

View File

@@ -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{

View File

@@ -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
}

View File

@@ -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"
// }

View File

@@ -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)

View File

@@ -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: "/",

View File

@@ -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",