MM-43202: Change some 501 response codes to fix SLO violations (#20767)
There were lots of cases where we were using the code 501 in an incorrect manner, and since 5xx codes are considered as SLO violations, these were flagged by our monitoring incorrectly. These were the guidelines to change the codes: 1. Any case of missing license or config not correctly enabled is set as Forbidden. The logic is that the user is correctly authenticated with a session, but does not have enough privileges to have the higher license, or hasn't changed the config correctly. 2. Any case of incorrectly formed request is obviously a 400. https://mattermost.atlassian.net/browse/MM-43202 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f0e4794cda
Коммит
97b3ffd7ea
@@ -1188,7 +1188,7 @@ func TestSearchUsers(t *testing.T) {
|
||||
t.Run("Requires ldap license when searching in group", func(t *testing.T) {
|
||||
_, resp, err = th.SystemAdminClient.SearchUsers(search)
|
||||
require.Error(t, err)
|
||||
CheckNotImplementedStatus(t, resp)
|
||||
CheckForbiddenStatus(t, resp)
|
||||
})
|
||||
|
||||
th.App.Srv().SetLicense(model.NewTestLicense("ldap"))
|
||||
@@ -2719,7 +2719,7 @@ func TestGetUsersInGroup(t *testing.T) {
|
||||
t.Run("Requires ldap license", func(t *testing.T) {
|
||||
_, response, err := th.SystemAdminClient.GetUsersInGroup(group.Id, 0, 60, "")
|
||||
require.Error(t, err)
|
||||
CheckNotImplementedStatus(t, response)
|
||||
CheckForbiddenStatus(t, response)
|
||||
})
|
||||
|
||||
th.App.Srv().SetLicense(model.NewTestLicense("ldap"))
|
||||
|
||||
Ссылка в новой задаче
Block a user