Move integration credentials into encrypted dashboard settings
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m42s

This commit is contained in:
Hickmeister
2026-10-11 16:15:02 +01:00
parent 96561dc3d2
commit ff9960fe06
23 changed files with 493 additions and 41 deletions
@@ -0,0 +1,28 @@
<?php
namespace Database\Factories;
use App\Models\IntegrationSetting;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<IntegrationSetting>
*/
class IntegrationSettingFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'provider' => 'bambuddy',
'settings' => [
'url' => 'https://bambuddy.example.test',
'api_key' => 'example-api-key',
],
];
}
}
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('integration_settings', function (Blueprint $table) {
$table->string('provider')->primary();
$table->longText('settings');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('integration_settings');
}
};
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('etsy_app_credentials', function (Blueprint $table) {
$table->text('shop_name')->nullable();
$table->text('redirect_uri')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('etsy_app_credentials', function (Blueprint $table) {
$table->dropColumn(['shop_name', 'redirect_uri']);
});
}
};
@@ -0,0 +1,19 @@
<?php
namespace Database\Seeders;
use App\Models\IntegrationSetting;
use Illuminate\Database\Seeder;
class IntegrationSettingSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
if (app()->isLocal()) {
IntegrationSetting::factory()->create();
}
}
}