-
Notifications
You must be signed in to change notification settings - Fork 2
Feature | Extend Swagger Coverage for controller OAuth2GroupsApiController
#365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5bcce22
90450e3
b5f7394
dedf3c7
4f8b596
c0c97b2
196ebea
c6c76d4
8a7cd80
5dff35c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| <?php namespace App\Security; | ||
| <?php | ||
| namespace App\Security; | ||
| /** | ||
| * Copyright 2017 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
|
@@ -119,4 +120,6 @@ final class SummitScopes | |
|
|
||
| const WriteAttendeeNotesData = '%s/attendee/notes/write'; | ||
| const ReadAttendeeNotesData = '%s/attendee/notes/read'; | ||
| } | ||
|
|
||
| const ReadGroupsData = '%s/groups/read'; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @matiasperrone-exo |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?php | ||
|
|
||
| namespace App\Swagger\schemas; | ||
|
|
||
| use OpenApi\Attributes as OA; | ||
|
|
||
|
|
||
| #[OA\Schema( | ||
| schema: 'Group', | ||
| type: 'object', | ||
| properties: [ | ||
| new OA\Property(property: 'id', type: 'integer', example: 1, description: 'Unique identifier'), | ||
| new OA\Property(property: 'created', type: 'integer', example: 1630500518, description: 'Creation timestamp (Unix epoch)'), | ||
| new OA\Property(property: 'last_edited', type: 'integer', example: 1630500518, description: 'Last modification timestamp (Unix epoch)'), | ||
| new OA\Property(property: 'title', type: 'string', example: 'Administrators', description: 'Group title'), | ||
| new OA\Property(property: 'description', type: 'string', example: 'System administrators group', description: 'Group description', nullable: true), | ||
| new OA\Property(property: 'code', type: 'string', example: 'administrators', description: 'Unique group code'), | ||
| new OA\Property( | ||
| property: 'members', | ||
| type: 'array', | ||
| description: 'List of Member objects, only present when requested via ?expand=members', | ||
| items: new OA\Items( | ||
| ref: '#/components/schemas/Member' | ||
| ) | ||
| ), | ||
| ] | ||
| )] | ||
| class GroupSchema | ||
| { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <?php | ||
| namespace App\Swagger\schemas; | ||
|
|
||
| use OpenApi\Attributes as OA; | ||
| use App\Security\SummitScopes; | ||
|
|
||
| #[OA\SecurityScheme( | ||
| type: 'oauth2', | ||
| securityScheme: 'groups_oauth2', | ||
| flows: [ | ||
| new OA\Flow( | ||
| authorizationUrl: L5_SWAGGER_CONST_AUTH_URL, | ||
| tokenUrl: L5_SWAGGER_CONST_TOKEN_URL, | ||
| flow: 'authorizationCode', | ||
| scopes: [ | ||
| SummitScopes::ReadAllSummitData => 'Read All Summit Data', | ||
| SummitScopes::ReadSummitData => 'Read Summit Data', | ||
| SummitScopes::ReadGroupsData => 'Read Groups Data', | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @matiasperrone-exo please review c9726df |
||
| ], | ||
| ), | ||
| ], | ||
| ) | ||
| ] | ||
| class GroupsOAuthSchema | ||
| { | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matiasperrone please review c9726df