fix(keystone): not allow to disable sql driver

not allow to disable default SQL identity_provider driver
This commit is contained in:
Qiu Jian
2020-12-02 16:39:23 +08:00
parent 6cb7a60d93
commit ef648b5b87
+3
View File
@@ -1481,6 +1481,9 @@ func (idp *SIdentityProvider) PerformDisable(
query jsonutils.JSONObject,
input apis.PerformDisableInput,
) (jsonutils.JSONObject, error) {
if idp.Driver == api.IdentityDriverSQL {
return nil, errors.Wrap(httperrors.ErrForbidden, "not allow to disable sql idp")
}
if idp.Driver == api.IdentityDriverLDAP || idp.AutoCreateUser.IsTrue() {
domains, _ := idp.getLinkedDomains()
for i := range domains {