From 55f672051858d465e2c25a4ecf7623edaf14e8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Franke?= Date: Mon, 9 Jan 2023 13:17:08 +0100 Subject: [PATCH] Change naming --- services/graph/pkg/config/config.go | 2 +- services/graph/pkg/config/defaults/defaultconfig.go | 2 +- services/graph/pkg/service/v0/groups.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/graph/pkg/config/config.go b/services/graph/pkg/config/config.go index 880a21cdef9..5fa9843a319 100644 --- a/services/graph/pkg/config/config.go +++ b/services/graph/pkg/config/config.go @@ -89,7 +89,7 @@ type Identity struct { // API represents API configuration parameters. type API struct { - UserPatchLimit int `yaml:"user_patch_limit" env:"GRAPH_USER_PATCH_LIMIT" desc:"The amount of users allowed to be changed in PATCH requests."` + GroupMembersPatchLimit int `yaml:"group_members_patch_limit" env:"GRAPH_GROUP_MEMBERS_PATCH_LIMIT" desc:"The amount of group members allowed to be added with a single patch request."` } // Events combines the configuration options for the event bus. diff --git a/services/graph/pkg/config/defaults/defaultconfig.go b/services/graph/pkg/config/defaults/defaultconfig.go index f5016163dff..5f4d15cdb67 100644 --- a/services/graph/pkg/config/defaults/defaultconfig.go +++ b/services/graph/pkg/config/defaults/defaultconfig.go @@ -31,7 +31,7 @@ func DefaultConfig() *config.Config { Name: "graph", }, API: config.API{ - UserPatchLimit: 20, + GroupMembersPatchLimit: 20, }, Reva: shared.DefaultRevaConfig(), Spaces: config.Spaces{ diff --git a/services/graph/pkg/service/v0/groups.go b/services/graph/pkg/service/v0/groups.go index 07bd86c60fe..e17584b8668 100644 --- a/services/graph/pkg/service/v0/groups.go +++ b/services/graph/pkg/service/v0/groups.go @@ -123,13 +123,13 @@ func (g Graph) PatchGroup(w http.ResponseWriter, r *http.Request) { if memberRefs, ok := changes.GetMembersodataBindOk(); ok { // The spec defines a limit of 20 members maxium per Request - if len(memberRefs) > g.config.API.UserPatchLimit { + if len(memberRefs) > g.config.API.GroupMembersPatchLimit { logger.Debug(). Int("number", len(memberRefs)). - Int("limit", g.config.API.UserPatchLimit). + Int("limit", g.config.API.GroupMembersPatchLimit). Msg("could not create group, exceeded members limit") errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, - fmt.Sprintf("Request is limited to %d members", g.config.API.UserPatchLimit)) + fmt.Sprintf("Request is limited to %d members", g.config.API.GroupMembersPatchLimit)) return } memberIDs := make([]string, 0, len(memberRefs))