Skip to content

Commit

Permalink
Merge pull request #194 from zhu327/ft_rbac
Browse files Browse the repository at this point in the history
v1.12.2
  • Loading branch information
zhu327 committed Sep 13, 2022
2 parents f24b656 + c88494f commit fb83acb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 45 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.1
1.12.2
34 changes: 0 additions & 34 deletions pkg/api/model/handler/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,9 @@ import (
"github.com/TencentBlueKing/gopkg/collection/set"
"github.com/gin-gonic/gin"

"iam/pkg/service"
"iam/pkg/util"
)

// ListSystem godoc
// @Summary list system
// @Description get the list of systems
// @ID api-model-share-systems-list
// @Tags model_share
// @Accept json
// @Produce json
// @Success 200 {object} util.Response{data=systemClientsResponse}
// @Header 200 {string} X-Request-Id "the request id"
// @Security AppCode
// @Security AppSecret
// @Router /api/v1/model/share/systems [get]
func ShareListSystem(c *gin.Context) {
// NOTE: 1) only id/name/name_en 2) no pagination
svc := service.NewSystemService()
allSystems, err := svc.ListAll()
if err != nil {
util.SystemErrorJSONResponse(c, err)
return
}

systems := make([]systemListResponse, 0, len(allSystems))
for _, sys := range allSystems {
systems = append(systems, systemListResponse{
ID: sys.ID,
Name: sys.Name,
NameEn: sys.NameEn,
})
}

util.SuccessJSONResponse(c, "ok", systems)
}

// ShareSystemInfoQuery godoc
// @Summary system info query
// @Description query the system
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/model/handler/system_config_slz.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ type actionIDSerializer struct {
type commonActionSerializer struct {
Name string `json:"name" binding:"required" example:"admin"`
NameEn string `json:"name_en" binding:"required" example:"admin"`
Actions []actionIDSerializer `json:"actions" binding:"required,gt=1"`
Actions []actionIDSerializer `json:"actions" binding:"required,gte=1"`
}

func getAllFromCommonActions(commonActions []commonActionSerializer) []string {
Expand Down
6 changes: 0 additions & 6 deletions pkg/api/model/handler/system_slz.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,3 @@ type systemCreateResponse struct {
type systemClientsResponse struct {
Clients string `json:"clients" example:"bk_paas,bk_esb"`
}

type systemListResponse struct {
ID string `json:"id" example:"bk_paas"`
Name string `json:"name" example:"bk_paas"`
NameEn string `json:"name_en" example:"bk_paas"`
}
3 changes: 0 additions & 3 deletions pkg/api/model/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ func Register(r *gin.RouterGroup) {
}

func RegisterShare(r *gin.RouterGroup) {
// GET /api/v1/model/share/systems
r.GET("/systems", handler.ShareListSystem)

// all resource in system
s := r.Group("/systems/:system_id")
s.Use(common.SystemExists())
Expand Down
9 changes: 9 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.12.2

- add: subject group quota check api
- add: task stats metrics

# 1.12.1

- add: transfer worker checker rbac command
Expand All @@ -6,6 +11,10 @@

- add: rbac action support

# 1.11.8

- bugfix: common actions length gte 1

# 1.11.7

- add api for subject freeze/unfreeze
Expand Down

0 comments on commit fb83acb

Please sign in to comment.