Merge pull request #7780 from swordqiu/hotfix/qj-user-idps-include-template

fix: user idps attributes includes template name
This commit is contained in:
yunion-ci-robot
2020-09-07 15:24:42 +08:00
committed by GitHub
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -59,6 +59,9 @@ type IdpResourceInfo struct {
// 认证源类型, 例如sql, cas, ldap等
IdpDriver string `json:"idp_driver"`
// 认证源模板
Template string `json:"template"`
}
type IdentityProviderCreateInput struct {
+4
View File
@@ -44,6 +44,9 @@ func expandIdpAttributes(entType string, idList []string, fields stringutils2.SS
if len(fields) == 0 || fields.Contains("idp_driver") {
rows[i].IdpDriver = idp[0].IdpDriver
}
if len(fields) == 0 || fields.Contains("template") {
rows[i].Template = idp[0].Template
}
}
}
} else if err != nil {
@@ -66,6 +69,7 @@ func fetchIdmappings(idList []string, resType string) (map[string][]sIdpInfo, er
idmappings.Field("local_id", "idp_entity_id"),
idps.Field("name", "idp"),
idps.Field("driver", "idp_driver"),
idps.Field("template", "template"),
idmappings.Field("public_id"),
)
q = q.Join(idps, sqlchemy.Equals(idps.Field("id"), idmappings.Field("domain_id")))