refactor config values to constants
This commit is contained in:
+29
-30
@@ -226,7 +226,6 @@ func DefaultConfig() *Config {
|
||||
OIDC: OIDC{
|
||||
Issuer: "https://localhost:9200",
|
||||
Insecure: true,
|
||||
//Insecure: true,
|
||||
UserinfoCache: Cache{
|
||||
Size: 1024,
|
||||
TTL: 10,
|
||||
@@ -247,15 +246,16 @@ func DefaultConfig() *Config {
|
||||
UserOIDCClaim: "email",
|
||||
UserCS3Claim: "mail",
|
||||
MachineAuthAPIKey: "change-me-please",
|
||||
//AutoprovisionAccounts: false,
|
||||
//EnableBasicAuth: false,
|
||||
//InsecureBackends: false,
|
||||
Context: nil,
|
||||
Policies: defaultPolicies(),
|
||||
Context: nil,
|
||||
Policies: defaultPolicies(),
|
||||
}
|
||||
}
|
||||
|
||||
func defaultPolicies() []Policy {
|
||||
const idpBackend = "http://localhost:9130"
|
||||
const revaBackend = "http://localhost:9140"
|
||||
const ingressBackendURL = "https://demo.owncloud.com"
|
||||
|
||||
return []Policy{
|
||||
{
|
||||
Name: "ocis",
|
||||
@@ -266,19 +266,19 @@ func defaultPolicies() []Policy {
|
||||
},
|
||||
{
|
||||
Endpoint: "/.well-known/",
|
||||
Backend: "http://localhost:9130",
|
||||
Backend: idpBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/konnect/",
|
||||
Backend: "http://localhost:9130",
|
||||
Backend: idpBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/signin/",
|
||||
Backend: "http://localhost:9130",
|
||||
Backend: idpBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/archiver",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Type: RegexRoute,
|
||||
@@ -287,7 +287,7 @@ func defaultPolicies() []Policy {
|
||||
},
|
||||
{
|
||||
Endpoint: "/ocs/",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Type: QueryRoute,
|
||||
@@ -296,31 +296,31 @@ func defaultPolicies() []Policy {
|
||||
},
|
||||
{
|
||||
Endpoint: "/remote.php/",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/dav/",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/webdav/",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/status.php",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/index.php/",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/data",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/app/",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/graph/",
|
||||
@@ -335,7 +335,6 @@ func defaultPolicies() []Policy {
|
||||
Endpoint: "/api/v0/accounts",
|
||||
Backend: "http://localhost:9181",
|
||||
},
|
||||
// TODO the lookup needs a better mechanism
|
||||
{
|
||||
Endpoint: "/accounts.js",
|
||||
Backend: "http://localhost:9181",
|
||||
@@ -359,53 +358,53 @@ func defaultPolicies() []Policy {
|
||||
},
|
||||
{
|
||||
Endpoint: "/.well-known/",
|
||||
Backend: "http://localhost:9130",
|
||||
Backend: idpBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/konnect/",
|
||||
Backend: "http://localhost:9130",
|
||||
Backend: idpBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/signin/",
|
||||
Backend: "http://localhost:9130",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/archiver",
|
||||
Backend: "http://localhost:9140",
|
||||
Backend: revaBackend,
|
||||
},
|
||||
{
|
||||
Endpoint: "/ocs/",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/remote.php/",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/dav/",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/webdav/",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/status.php",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/index.php/",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
{
|
||||
Endpoint: "/data",
|
||||
Backend: "https://demo.owncloud.com",
|
||||
Backend: ingressBackendURL,
|
||||
ApacheVHost: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user