Skip to content

Commit

Permalink
[init]Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xuybin committed Dec 13, 2017
1 parent f9457b0 commit 6e24c58
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions server/ends.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,"")
}

2 changes: 2 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6e24c58

Please sign in to comment.