[MM-29845] Add a new handler to allow authentication via CWS API Key (#16319)
* Add a new handler to allow authentication via CWS API Key * Make error better * Add tests and cases for new handler functions * Move some code around * Add test for GetCloudSession function * unset the env after test completion * Remove white space * Change Info to Warn Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -32,6 +32,21 @@ func TestRequireHookId(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestCloudKeyRequired(t *testing.T) {
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.Srv().SetLicense(model.NewTestLicense("cloud"))
|
||||
|
||||
c := &Context{
|
||||
App: th.App,
|
||||
}
|
||||
|
||||
c.CloudKeyRequired()
|
||||
|
||||
assert.Equal(t, c.Err.Id, "api.context.session_expired.app_error")
|
||||
}
|
||||
|
||||
func TestMfaRequired(t *testing.T) {
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user