chore: update default configuration

This commit is contained in:
Jonas Kaninda
2024-10-30 16:58:22 +01:00
parent c332309a56
commit c45b62ec67

View File

@@ -134,8 +134,6 @@ type Route struct {
DisableHeaderXForward bool `yaml:"disableHeaderXForward"`
// HealthCheck Defines the backend is health check PATH
HealthCheck string `yaml:"healthCheck"`
// Blocklist Defines route blacklist
Blocklist []string `yaml:"blocklist"`
// InterceptErrors intercepts backend errors based on the status codes
//
// Eg: [ 403, 405, 500 ]
@@ -283,7 +281,6 @@ func initConfig(configFile string) {
Destination: "https://example.com",
Rewrite: "/",
HealthCheck: "",
Blocklist: []string{},
Cors: Cors{
Origins: []string{"http://localhost:3000", "https://dev.example.com"},
Headers: map[string]string{
@@ -292,7 +289,7 @@ func initConfig(configFile string) {
"Access-Control-Max-Age": "1728000",
},
},
Middlewares: []string{"basic-auth"},
Middlewares: []string{"basic-auth", "api-forbidden-paths"},
},
{
Name: "Hostname example",
@@ -307,14 +304,23 @@ func initConfig(configFile string) {
Middlewares: []Middleware{
{
Name: "basic-auth",
Type: "basic",
Type: BasicAuth,
Paths: []string{
"/user",
"/admin",
"/account",
},
Rule: BasicRuleMiddleware{
Username: "goma",
Password: "goma",
},
}, {
Name: "jwt",
Type: "jwt",
Type: JWTAuth,
Paths: []string{
"/protected-access",
"/example-of-jwt",
},
Rule: JWTRuleMiddleware{
URL: "https://www.googleapis.com/auth/userinfo.email",
RequiredHeaders: []string{
@@ -324,6 +330,17 @@ func initConfig(configFile string) {
Params: map[string]string{},
},
},
{
Name: "api-forbidden-paths",
Type: AccessMiddleware,
Paths: []string{
"/swagger-ui/*",
"/v2/swagger-ui/*",
"/api-docs/*",
"/internal/*",
"/actuator/*",
},
},
},
}
yamlData, err := yaml.Marshal(&conf)