feat: support shared cert in GetCert() API

This commit is contained in:
Yang Luo 2025-02-28 23:02:13 +08:00
parent cc82d292f0
commit 3297db688b

View File

@ -146,7 +146,12 @@ func getCertByName(name string) (*Cert, error) {
func GetCert(id string) (*Cert, error) {
owner, name := util.GetOwnerAndNameFromId(id)
return getCert(owner, name)
cert, err := getCert(owner, name)
if cert == nil && owner != "admin" {
return getCert("admin", name)
} else {
return cert, err
}
}
func UpdateCert(id string, cert *Cert) (bool, error) {