Merge pull request #19851 from swordqiu/automated-cherry-pick-of-#19850-upstream-release-3.11

Automated cherry pick of #19850: fix: idp list query filter by sso_domain
This commit is contained in:
Zexi Li
2024-04-02 10:36:04 +08:00
committed by GitHub
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -337,7 +337,7 @@ type IdentityProviderListInput struct {
// 过滤支持SSO的认证源,如果值为all,则列出所有的全局认证源,否则可出sso为域ID的域认证源
// example: all
SsoDomain string `json:"sso"`
SsoDomain string `json:"sso_domain"`
AutoCreateProject *bool `json:"auto_create_project"`
AutoCreateUser *bool `json:"auto_create_user"`
+4 -1
View File
@@ -1163,7 +1163,10 @@ func (manager *SIdentityProviderManager) ListItemFilter(
return nil, errors.Wrap(err, "FetchDomainByIdOrName")
}
}
q = q.Equals("domain_id", ssoDomain.Id)
q = q.Filter(sqlchemy.OR(
sqlchemy.Equals(q.Field("domain_id"), ssoDomain.Id),
sqlchemy.IsNullOrEmpty(q.Field("domain_id")),
))
}
}
if query.AutoCreateProject != nil {