Skip to content

Commit

Permalink
Change naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ainmosni committed Jan 9, 2023
1 parent c3f4e7b commit 55f6720
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion services/graph/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion services/graph/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func DefaultConfig() *config.Config {
Name: "graph",
},
API: config.API{
UserPatchLimit: 20,
GroupMembersPatchLimit: 20,
},
Reva: shared.DefaultRevaConfig(),
Spaces: config.Spaces{
Expand Down
6 changes: 3 additions & 3 deletions services/graph/pkg/service/v0/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 55f6720

Please sign in to comment.