diff --git a/docker-compose.yml b/docker-compose.yml index 10c2989..fd9e809 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: gateway: - image: xuybin/go-api-gateway:1.0.0 + image: xuybin/go-api-gateway:v1.0.0 ports: - "8080:80" depends_on: @@ -20,7 +20,7 @@ services: condition: on-failure api: - image: xuybin/go-mysql-api:1.0.0 + image: xuybin/go-mysql-api:v1.0.0 depends_on: - db links: diff --git a/server/ends.go b/server/ends.go index 8027142..6c55a9b 100644 --- a/server/ends.go +++ b/server/ends.go @@ -153,3 +153,11 @@ func (s *GatewayServer) removeRoleFromUser(c echo.Context) (err error) { } +func (s *GatewayServer) upMetadata(c echo.Context) (err error) { + if err = s.Enforcer.LoadPolicy(); err != nil { + err=&ErrorMessage{ERR_PARAMETER, "parameter bind failed."} + return + } + return c.String(http.StatusOK,"") +} + diff --git a/server/server.go b/server/server.go index 203b389..d1b4ffa 100644 --- a/server/server.go +++ b/server/server.go @@ -105,6 +105,8 @@ func (s *GatewayServer) mountAuthorizationEndPoints() { policy.GET("/group/", s.getGroupPolicies).Name = "Get Group Policies" policy.PUT("/group/", s.addGroupPolicy).Name = "Add Group To User" policy.DELETE("/group/", s.removeRoleFromUser).Name = "Remove Group From User" + + policy.HEAD("/metadata/", s.upMetadata).Name = "Remove Group From User" } var userDefinitionModel="auth"