mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: ignore undecryptable keys from view (#1528)
This commit is contained in:
parent
a393d549fb
commit
efc90b382c
@ -1,10 +1,12 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
"time"
|
||||
|
||||
"github.com/caos/logging"
|
||||
|
||||
"github.com/caos/zitadel/internal/crypto"
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
)
|
||||
|
||||
@ -90,15 +92,16 @@ func SigningKeyFromKeyView(key *KeyView, alg crypto.EncryptionAlgorithm) (*Signi
|
||||
}
|
||||
|
||||
func PublicKeysFromKeyView(keys []*KeyView, alg crypto.EncryptionAlgorithm) ([]*PublicKey, error) {
|
||||
converted := make([]*PublicKey, len(keys))
|
||||
var err error
|
||||
for i, key := range keys {
|
||||
converted[i], err = PublicKeyFromKeyView(key, alg)
|
||||
convertedKeys := make([]*PublicKey, 0, len(keys))
|
||||
for _, key := range keys {
|
||||
converted, err := PublicKeyFromKeyView(key, alg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logging.Log("MODEL-adB3f").WithError(err).Debug("cannot convert to public key") //TODO: change log level to warning when keys can be revoked
|
||||
continue
|
||||
}
|
||||
convertedKeys = append(convertedKeys, converted)
|
||||
}
|
||||
return converted, nil
|
||||
return convertedKeys, nil
|
||||
|
||||
}
|
||||
func PublicKeyFromKeyView(key *KeyView, alg crypto.EncryptionAlgorithm) (*PublicKey, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user