(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string)
| 283 | } |
| 284 | |
| 285 | func (f *Factor) GetSecret(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string) (string, bool, error) { |
| 286 | if es := crypto.ParseEncryptedString(f.Secret); es != nil { |
| 287 | bytes, err := es.Decrypt(f.ID.String(), decryptionKeys) |
| 288 | if err != nil { |
| 289 | return "", false, err |
| 290 | } |
| 291 | |
| 292 | return string(bytes), encrypt && es.ShouldReEncrypt(encryptionKeyID), nil |
| 293 | } |
| 294 | |
| 295 | return f.Secret, encrypt, nil |
| 296 | } |
| 297 | |
| 298 | func (f *Factor) SaveWebAuthnCredential(tx *storage.Connection, credential *webauthn.Credential) error { |
| 299 | f.WebAuthnCredential = &MFAWebAuthnCredential{ |
no test coverage detected