Skip to content

Commit 8953b63

Browse files
committed
chore: Move the security schema for the controller to its own file
1 parent f3b9af2 commit 8953b63

2 files changed

Lines changed: 26 additions & 20 deletions

File tree

app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitMediaFileTypeApiController.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,6 @@
2424
use OpenApi\Attributes as OA;
2525
use Symfony\Component\HttpFoundation\Response;
2626

27-
28-
#[OA\SecurityScheme(
29-
type: 'oauth2',
30-
securityScheme: 'summit_media_file_type_oauth2',
31-
flows: [
32-
new OA\Flow(
33-
authorizationUrl: L5_SWAGGER_CONST_AUTH_URL,
34-
tokenUrl: L5_SWAGGER_CONST_TOKEN_URL,
35-
flow: 'authorizationCode',
36-
scopes: [
37-
SummitScopes::ReadSummitMediaFileTypes => 'Read Summit Media File Types',
38-
SummitScopes::WriteSummitMediaFileTypes => 'Write Summit Media File Types',
39-
],
40-
),
41-
],
42-
)
43-
]
44-
class SummitMediaFileTypeAuthSchema{}
45-
46-
4727
/**
4828
* Class OAuth2SummitMediaFileTypeApiController
4929
* @package App\Http\Controllers
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use App\Security\SummitScopes;
6+
use OpenApi\Attributes as OA;
7+
8+
9+
10+
#[OA\SecurityScheme(
11+
type: 'oauth2',
12+
securityScheme: 'summit_media_file_type_oauth2',
13+
flows: [
14+
new OA\Flow(
15+
authorizationUrl: L5_SWAGGER_CONST_AUTH_URL,
16+
tokenUrl: L5_SWAGGER_CONST_TOKEN_URL,
17+
flow: 'authorizationCode',
18+
scopes: [
19+
SummitScopes::ReadSummitMediaFileTypes => 'Read Summit Media File Types',
20+
SummitScopes::WriteSummitMediaFileTypes => 'Write Summit Media File Types',
21+
],
22+
),
23+
],
24+
)
25+
]
26+
class SummitMediaFileTypeAuthSchema{}

0 commit comments

Comments
 (0)