Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test:
docker compose exec api bash -c 'LOG_CHANNEL=stderr LOG_LEVEL=debug vendor/bin/phpunit ${FILTER}'

init:
docker compose exec api bash -c 'php artisan migrate:fresh && php artisan passport:install && php artisan key:generate'
docker compose exec api bash -c 'php artisan migrate:fresh && php artisan passport:install --no-interaction && php artisan key:generate'

test-fresh: init test

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ docker compose down --volumes
Run everything in one go:

```sh
docker compose exec api bash -c 'php artisan migrate:fresh && php artisan passport:install && php artisan db:seed && php artisan key:generate && php artisan storage:link'
docker compose exec api bash -c 'php artisan migrate:fresh && php artisan passport:install --no-interaction && php artisan db:seed && php artisan key:generate && php artisan storage:link'
```

Or each command separately:
Expand All @@ -60,7 +60,7 @@ Or each command separately:
docker compose exec api php artisan migrate:fresh

# Create some certs needed for authentication (passport is a laravel plugin)
docker compose exec api php artisan passport:install
docker compose exec api php artisan passport:install --no-interaction

# Seed some useful development data
docker compose exec api php artisan db:seed
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"license": "MIT",
"type": "project",
"require": {
"absszero/laravel-stackdriver-error-reporting": "^1.7",
"absszero/laravel-stackdriver-error-reporting": "^1.9",
"doctrine/dbal": "^3.1",
"firebase/php-jwt": "^6.10",
"firebase/php-jwt": "^7.0",
"google/recaptcha": "^1.2",
"guzzlehttp/guzzle": "^7.8",
"guzzlehttp/psr7": "^2.9",
"hackzilla/password-generator": "^1.6",
"intervention/image": "^2.5",
"laravel/framework": "^10.10",
"laravel/horizon": "^5.23",
"laravel/passport": "^11.0",
"laravel/passport": "^12.4",
"laravel/tinker": "^3.0",
"laravel/ui": "^4.4",
"lcobucci/jwt": "^5.6",
Expand Down
843 changes: 441 additions & 402 deletions composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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('oauth_auth_codes', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->unsignedBigInteger('user_id')->index();
$table->unsignedBigInteger('client_id');
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void {
Schema::dropIfExists('oauth_auth_codes');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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('oauth_access_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->unsignedBigInteger('user_id')->nullable()->index();
$table->unsignedBigInteger('client_id');
$table->string('name')->nullable();
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->timestamps();
$table->dateTime('expires_at')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void {
Schema::dropIfExists('oauth_access_tokens');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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('oauth_refresh_tokens', function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void {
Schema::dropIfExists('oauth_refresh_tokens');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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('oauth_clients', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id')->nullable()->index();
$table->string('name');
$table->string('secret', 100)->nullable();
$table->string('provider')->nullable();
$table->text('redirect');
$table->boolean('personal_access_client');
$table->boolean('password_client');
$table->boolean('revoked');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void {
Schema::dropIfExists('oauth_clients');
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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('oauth_personal_access_clients', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('client_id');
$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void {
Schema::dropIfExists('oauth_personal_access_clients');
}
};
3 changes: 2 additions & 1 deletion tests/Routes/Auth/LoginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\User;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Artisan;
use Tests\Routes\Traits\OptionsRequestAllowed;
use Tests\TestCase;

Expand All @@ -15,7 +16,7 @@ class LoginTest extends TestCase {

protected function setUp(): void {
parent::setUp();
$this->artisan('passport:install', ['--no-interaction' => true]);
Artisan::call('passport:install', ['--no-interaction' => true]);
}

public function testLoginFailNoExistingUser() {
Expand Down
Loading