Add application API keys
linter / quality (pull_request) Successful in 1m19s
tests / ci (8.4) (pull_request) Successful in 1m32s

This commit is contained in:
2026-04-20 19:58:24 +02:00
parent a6a4615ad5
commit bf0e50464a
31 changed files with 1124 additions and 46 deletions
+5 -5
View File
@@ -24,7 +24,7 @@ class ProjectApiTest extends TestCase
$this->syncProjectPermissions($visibleProject, $user, ['view']);
$this->actingAs($user)
$this->withApplicationKey($user)
->getJson(route('api.projects.index'))
->assertOk()
->assertJsonPath('data.0.name', 'Visible project')
@@ -36,7 +36,7 @@ class ProjectApiTest extends TestCase
$user = User::factory()->create();
$this->syncGlobalPermissions($user, ['create']);
$this->actingAs($user)
$this->withApplicationKey($user)
->postJson(route('api.projects.store'), [
'key' => 'api',
'name' => 'API Project',
@@ -61,20 +61,20 @@ class ProjectApiTest extends TestCase
app(InitializeProjectTicketMetadata::class)->handle($project);
$this->actingAs($user)
$this->withApplicationKey($user)
->getJson(route('api.projects.show', $project))
->assertForbidden();
$this->syncProjectPermissions($project, $user, ['view']);
$this->actingAs($user)
$this->withApplicationKey($user)
->getJson(route('api.projects.show', $project))
->assertOk()
->assertJsonPath('data.key', 'CORE');
$this->syncGlobalPermissions($admin, ['admin']);
$this->actingAs($admin)
$this->withApplicationKey($admin)
->deleteJson(route('api.projects.destroy', $project), [
'confirmation_key' => 'CORE',
])