rename reva to proxy where applicable
This commit is contained in:
@@ -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"
|
||||
// }
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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: "/",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user