[MM-10346] CSRF Token Implementation + Tests (#10067)

* CSRF Token Implementation + Tests

Remove debug statements

Implement requested changes

* Fix non-cookie authentication methods stripping auth data from requests

* Fail when CSRF cookie is not returned as part of login
Этот коммит содержится в:
Daniel Schalla
2019-01-31 20:39:02 +01:00
коммит произвёл GitHub
родитель 86aa01cf36
Коммит 7cc66ee1d4
10 изменённых файлов: 202 добавлений и 36 удалений

Просмотреть файл

@@ -283,6 +283,7 @@ type ServiceSettings struct {
DEPRECATED_DO_NOT_USE_ImageProxyOptions *string `json:"ImageProxyOptions"` // This field is deprecated and must not be used.
EnableAPITeamDeletion *bool
ExperimentalEnableHardenedMode *bool
ExperimentalStrictCSRFEnforcement *bool
EnableEmailInvitations *bool
ExperimentalLdapGroupSync *bool
}
@@ -611,6 +612,10 @@ func (s *ServiceSettings) SetDefaults() {
if s.ExperimentalLdapGroupSync == nil {
s.ExperimentalLdapGroupSync = NewBool(false)
}
if s.ExperimentalStrictCSRFEnforcement == nil {
s.ExperimentalStrictCSRFEnforcement = NewBool(false)
}
}
type ClusterSettings struct {