Skip to content

Commit

Permalink
Move security scheme to abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Apr 10, 2024
1 parent 086f6c2 commit 356e0f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
2 changes: 2 additions & 0 deletions src/Controller/Api/AbstractApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ abstract class AbstractApiController extends AbstractController

public const API_PATH = '/studio/api';

public const SECURITY_SCHEME = [['auth_token' => []]];

public function __construct(protected readonly SerializerInterface $serializer)
{

Expand Down
6 changes: 1 addition & 5 deletions src/Controller/Api/Assets/CollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ public function __construct(
path: self::API_PATH . '/assets',
description: 'Get paginated assets',
summary: 'Get all assets',
security: [
[
'auth_token' => [],
],
],
security: self::SECURITY_SCHEME,
tags: ['Assets'],
)]
#[PageParameter]
Expand Down
6 changes: 1 addition & 5 deletions src/Controller/Api/Assets/GetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ public function __construct(
path: self::API_PATH . '/assets/{id}',
description: 'Get paginated assets',
summary: 'Get all assets',
security: [
[
'auth_token' => [],
],
],
security: self::SECURITY_SCHEME,
tags: ['Assets']
)]
#[IdParameter(type: 'asset')]
Expand Down
6 changes: 1 addition & 5 deletions src/Controller/Api/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ public function __construct(
path: self::API_PATH . self::PATH,
description: 'Get translations for given keys and locale',
summary: 'Get translations',
security: [
[
'auth_token' => [],
],
],
security: self::SECURITY_SCHEME,
tags: ['Translation']
)]
#[TranslationRequestBody]
Expand Down

0 comments on commit 356e0f1

Please sign in to comment.