Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gak committed Aug 19, 2024
1 parent 87ea00e commit 7991a31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/controller/dal/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ func (d *DAL) decryptJSON(subkey encryption.Subkey, encrypted []byte, v any) err
return nil
}

func (d *DAL) EnsureKey(ctx context.Context, generateKey func() ([]byte, error)) ([]byte, error) {
func (d *DAL) EnsureKey(ctx context.Context, generateKey func() ([]byte, error)) (encryptedKey []byte, err error) {
logger := log.FromContext(ctx)
tx, err := d.Begin(ctx)
if err != nil {
return nil, fmt.Errorf("failed to begin transaction: %w", err)
}
defer tx.CommitOrRollback(ctx, &err)

encryptedKey, err := tx.db.GetOnlyEncryptionKey(ctx)
encryptedKey, err = tx.db.GetOnlyEncryptionKey(ctx)
if err != nil && dal.IsNotFound(err) {
logger.Infof("No encryption key found, generating a new one")
key, err := generateKey()
Expand Down

0 comments on commit 7991a31

Please sign in to comment.