diff --git a/README.md b/README.md index e0faf8c..fc5b267 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ gateway: - https://dev.example.com - http://localhost:3000 - https://example.com - # Route Cors headers, global cors will be overridden by route + # Route Cors headers, route will override global cors headers: Access-Control-Allow-Methods: 'GET' Access-Control-Allow-Headers: 'Origin, Authorization, Accept, Content-Type, Access-Control-Allow-Headers, X-Client-Id, X-Session-Id' @@ -189,22 +189,22 @@ gateway: - path: /user # Rules defines which specific middleware applies to a route path rules: - - basic-auth #Middleware name + - basic-auth # path to protect - path: /path-example # Rules defines which specific middleware applies to a route path rules: - - jwt #Middleware name + - jwtAuth # path to protect - path: /admin # Rules defines which specific middleware applies to a route path rules: - - basic-auth #Middleware name + - basic-auth # path to protect - path: /path-example # Rules defines which specific middleware applies to a route path rules: - - jwt # Middleware name + - jwtAuth - path: /history http: url: http://security-service:8080/security/authUser @@ -236,17 +236,17 @@ gateway: #Defines proxy middlewares middlewares: # Enable Basic auth authorization based - - name: basic-auth + - name: local-auth-basic # Authentication types | jwtAuth, basicAuth, auth0 - type: basicAuth + type: basic rule: username: admin password: admin #Enables JWT authorization based on the result of a request and continues the request. - - name: jwt + - name: google-auth # Authentication types | jwtAuth, basicAuth, OAuth # jwt authorization based on the result of backend's response and continue the request when the client is authorized - type: jwtAuth + type: jwt rule: # This is an example URL url: https://www.googleapis.com/auth/userinfo.email diff --git a/goma.yml b/goma.yml index ce4d79f..60afbe4 100644 --- a/goma.yml +++ b/goma.yml @@ -58,7 +58,7 @@ gateway: - https://dev.example.com - http://localhost:3000 - https://example.com - # Route Cors headers, global cors will be overridden by route + # Route Cors headers, route will override global cors headers: Access-Control-Allow-Methods: 'GET' Access-Control-Allow-Headers: 'Origin, Authorization, Accept, Content-Type, Access-Control-Allow-Headers, X-Client-Id, X-Session-Id' @@ -127,16 +127,16 @@ gateway: middlewares: # Enable Basic auth authorization based - name: local-auth-basic - # Authentication types | jwtAuth, basicAuth, auth0 - type: basicAuth + # Authentication types | jwt, basic, OAuth + type: basic rule: username: admin password: admin #Enables JWT authorization based on the result of a request and continues the request. - name: google-auth - # Authentication types | jwtAuth, basicAuth, OAuth + # Authentication types | jwt, basic, OAuth # jwt authorization based on the result of backend's response and continue the request when the client is authorized - type: jwtAuth + type: jwt rule: # This is an example URL url: https://www.googleapis.com/auth/userinfo.email diff --git a/pkg/config.go b/pkg/config.go index a70b593..8c82acc 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -296,14 +296,14 @@ func initConfig(configFile string) { Middlewares: []Middleware{ { Name: "basic-auth", - Type: basicAuth, + Type: "basic", Rule: BasicRule{ Username: "goma", Password: "goma", }, }, { Name: "jwt", - Type: jwtAuth, + Type: "jwt", Rule: JWTRuler{ URL: "https://www.googleapis.com/auth/userinfo.email", RequiredHeaders: []string{