Change naming
This commit is contained in:
committed by
Ralf Haferkamp
parent
49d71ea111
commit
425ebb8084
@@ -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.
|
||||
|
||||
@@ -31,7 +31,7 @@ func DefaultConfig() *config.Config {
|
||||
Name: "graph",
|
||||
},
|
||||
API: config.API{
|
||||
UserPatchLimit: 20,
|
||||
GroupMembersPatchLimit: 20,
|
||||
},
|
||||
Reva: shared.DefaultRevaConfig(),
|
||||
Spaces: config.Spaces{
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user