MCPcopy Create free account
hub / github.com/supabase/auth / GetSecret

Method GetSecret

internal/models/factor.go:285–296  ·  view source on GitHub ↗
(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string)

Source from the content-addressed store, hash-verified

283}
284
285func (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
298func (f *Factor) SaveWebAuthnCredential(tx *storage.Connection, credential *webauthn.Credential) error {
299 f.WebAuthnCredential = &MFAWebAuthnCredential{

Callers 1

verifyTOTPFactorMethod · 0.80

Calls 4

ParseEncryptedStringFunction · 0.92
DecryptMethod · 0.80
ShouldReEncryptMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected