🚀 feat(dependencies): add spatie/laravel-ciphersweet package for encryption support

 feat(profile): integrate email and fax fields in association profile

🆕 feat(migrations): create blind_indexes table for encrypted data

🔧 feat(model): implement CipherSweet in EinundzwanzigPleb for email encryption

🔧 config: add ciphersweet configuration file for encryption settings

🗄️ migration: add email field to einundzwanzig_plebs table for user data
This commit is contained in:
fsociety
2024-10-25 16:15:28 +02:00
parent e8817f5e71
commit f600c7983c
7 changed files with 395 additions and 21 deletions

View File

@@ -4,9 +4,14 @@ namespace App\Models;
use App\Enums\AssociationStatus;
use Illuminate\Database\Eloquent\Model;
use ParagonIE\CipherSweet\BlindIndex;
use ParagonIE\CipherSweet\EncryptedRow;
use Spatie\LaravelCipherSweet\Concerns\UsesCipherSweet;
use Spatie\LaravelCipherSweet\Contracts\CipherSweetEncrypted;
class EinundzwanzigPleb extends Model
class EinundzwanzigPleb extends Model implements CipherSweetEncrypted
{
use UsesCipherSweet;
protected $guarded = [];
@@ -17,6 +22,13 @@ class EinundzwanzigPleb extends Model
];
}
public static function configureCipherSweet(EncryptedRow $encryptedRow): void
{
$encryptedRow
->addOptionalTextField('email')
->addBlindIndex('email', new BlindIndex('email_index'));
}
public function profile()
{
return $this->hasOne(Profile::class, 'pubkey', 'pubkey');