Skip to content

Commit 6c97f6b

Browse files
committed
fix: Security schema
1 parent add2f0d commit 6c97f6b

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* limitations under the License.
1313
**/
1414
use App\Models\Foundation\Summit\Repositories\ISpeakerOrganizationalRoleRepository;
15+
use App\Security\SummitScopes;
1516
use models\oauth2\IResourceServerContext;
1617
use Illuminate\Support\Facades\Log;
1718
use models\exceptions\EntityNotFoundException;
@@ -20,6 +21,26 @@
2021
use utils\PagingResponse;
2122
use Illuminate\Support\Facades\Request;
2223
use OpenApi\Attributes as OA;
24+
25+
26+
#[OA\SecurityScheme(
27+
type: 'oauth2',
28+
securityScheme: 'speaker_organizational_role_oauth2',
29+
flows: [
30+
new OA\Flow(
31+
authorizationUrl: L5_SWAGGER_CONST_AUTH_URL,
32+
tokenUrl: L5_SWAGGER_CONST_TOKEN_URL,
33+
flow: 'authorizationCode',
34+
scopes: [
35+
SummitScopes::ReadAllSummitData => 'Read All Summit Data',
36+
SummitScopes::ReadSummitData => 'Read Summit Data',
37+
],
38+
),
39+
],
40+
)
41+
]
42+
class SpeakerOrganizationalRoleAuthSchema{}
43+
2344
/**
2445
* Class OAuth2SpeakerOrganizationalRoleApiController
2546
* @package App\Http\Controllers
@@ -47,7 +68,7 @@ public function __construct
4768
summary: 'Get all default speaker organizational roles',
4869
description: 'Retrieves a list of default organizational roles for speakers. These are predefined role types that speakers can select to describe their position or role within an organization (e.g., "Developer", "Manager", "Architect", "Executive").',
4970
operationId: 'getAllSpeakerOrganizationalRoles',
50-
security: [['oauth2_scopes' => [
71+
security: [['speaker_organizational_role_oauth2' => [
5172
SummitScopes::ReadSummitData,
5273
SummitScopes::ReadAllSummitData
5374
]]],

0 commit comments

Comments
 (0)