mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
feat: allow jwks to include the certs from non-admin owner (#3749)
This commit is contained in:
parent
eae69c41d7
commit
36f5de3203
@ -63,7 +63,11 @@ func GetCertCount(owner, field, value string) (int64, error) {
|
||||
|
||||
func GetCerts(owner string) ([]*Cert, error) {
|
||||
certs := []*Cert{}
|
||||
err := ormer.Engine.Where("owner = ? or owner = ? ", "admin", owner).Desc("created_time").Find(&certs, &Cert{})
|
||||
db := ormer.Engine.NewSession()
|
||||
if owner != "" {
|
||||
db = db.Where("owner = ? or owner = ? ", "admin", owner)
|
||||
}
|
||||
err := db.Desc("created_time").Find(&certs, &Cert{})
|
||||
if err != nil {
|
||||
return certs, err
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ func GetOidcDiscovery(host string) OidcDiscovery {
|
||||
|
||||
func GetJsonWebKeySet() (jose.JSONWebKeySet, error) {
|
||||
jwks := jose.JSONWebKeySet{}
|
||||
certs, err := GetCerts("admin")
|
||||
certs, err := GetCerts("")
|
||||
if err != nil {
|
||||
return jwks, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user