Skip to content

Commit 03c7efc

Browse files
matiasperrone-exoCopilot
andcommitted
chore: Add PR's requested changes and additional AI comments
Co-authored-by: Copilot <copilot@github.com>
1 parent 9448328 commit 03c7efc

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

app/Http/Controllers/OAuth2/OAuth2ProviderController.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct
9292
new OA\Parameter(name: 'state', in: 'query', required: false, description: 'Opaque state parameter returned in the redirect', schema: new OA\Schema(type: 'string')),
9393
new OA\Parameter(name: 'nonce', in: 'query', required: false, description: 'Nonce for ID token replay protection (OIDC)', schema: new OA\Schema(type: 'string')),
9494
new OA\Parameter(name: 'response_mode', in: 'query', required: false, description: 'Response mode override', schema: new OA\Schema(type: 'string', enum: ['query', 'fragment', 'form_post', 'direct'])),
95-
new OA\Parameter(name: 'prompt', in: 'query', required: false, description: 'Space-delimited user interaction prompts (OIDC)', schema: new OA\Schema(type: 'string', enum: ['none', 'login', 'consent', 'select_account'])),
95+
new OA\Parameter(name: 'prompt', in: 'query', required: false, description: 'Space-delimited user interaction prompts (OIDC). Allowed tokens: none, login, consent, select_account. "none" cannot be combined with others. Example: "login consent"', schema: new OA\Schema(type: 'string')),
9696
new OA\Parameter(name: 'login_hint', in: 'query', required: false, description: 'Hint about login identifier (OIDC)', schema: new OA\Schema(type: 'string')),
9797
new OA\Parameter(name: 'display', in: 'query', required: false, description: 'UI display preference (OIDC)', schema: new OA\Schema(type: 'string', enum: ['page', 'popup', 'touch', 'wap', 'native'])),
9898
new OA\Parameter(name: 'max_age', in: 'query', required: false, description: 'Maximum authentication age in seconds (OIDC)', schema: new OA\Schema(type: 'integer')),
@@ -255,7 +255,6 @@ public function auth()
255255
summary: 'OAuth2 Token Endpoint',
256256
description: 'Issues access tokens. Supports authorization_code, client_credentials, password, refresh_token, and passwordless grant types.',
257257
tags: ['OAuth2 / OpenID Connect'],
258-
security: [['OAuth2ProviderSecurity' => []]],
259258
requestBody: new OA\RequestBody(
260259
description: 'Token request parameters',
261260
required: true,
@@ -421,9 +420,19 @@ public function certs()
421420

422421
#[OA\Get(
423422
path: '/.well-known/openid-configuration',
424-
operationId: 'oauth2Discovery',
423+
operationId: 'OpenIdDiscovery',
424+
summary: 'OpenID Connect Discovery Endpoint',
425+
description: 'Returns the OpenID Provider Configuration document per OpenID Connect Discovery 1.0.',
426+
tags: ['OAuth2 / OpenID Connect'],
427+
responses: [
428+
new OA\Response(response: HttpResponse::HTTP_OK, description: 'OpenID Connect Discovery document', content: new OA\JsonContent(ref: '#/components/schemas/OpenIDDiscoveryResponse')),
429+
]
430+
)]
431+
#[OA\Get(
432+
path: '/oauth2/.well-known/openid-configuration',
433+
operationId: 'OAclient_secretuth2OpenIdDiscovery',
425434
summary: 'OpenID Connect Discovery Endpoint',
426-
description: 'Returns the OpenID Provider Configuration document per OpenID Connect Discovery 1.0. Also available at /oauth2/.well-known/openid-configuration.',
435+
description: 'Returns the OpenID Provider Configuration document per OpenID Connect Discovery 1.0.',
427436
tags: ['OAuth2 / OpenID Connect'],
428437
responses: [
429438
new OA\Response(response: HttpResponse::HTTP_OK, description: 'OpenID Connect Discovery document', content: new OA\JsonContent(ref: '#/components/schemas/OpenIDDiscoveryResponse')),
@@ -457,6 +466,7 @@ public function checkSessionIFrame()
457466
summary: 'OpenID Connect End Session Endpoint (GET)',
458467
description: 'Initiates RP-Initiated Logout per OpenID Connect Session Management 1.0. Terminates the user session and optionally redirects to the post-logout URI.',
459468
tags: ['OAuth2 / OpenID Connect'],
469+
security: [['OAuth2ProviderSecurity' => []]],
460470
parameters: [
461471
new OA\Parameter(name: 'client_id', in: 'query', required: true, description: 'OAuth2 client identifier', schema: new OA\Schema(type: 'string')),
462472
new OA\Parameter(name: 'id_token_hint', in: 'query', required: false, description: 'Previously issued ID token', schema: new OA\Schema(type: 'string')),
@@ -475,6 +485,7 @@ public function checkSessionIFrame()
475485
summary: 'OpenID Connect End Session Endpoint (POST)',
476486
description: 'Initiates RP-Initiated Logout via POST. Same parameters as GET but sent as form data.',
477487
tags: ['OAuth2 / OpenID Connect'],
488+
security: [['OAuth2ProviderSecurity' => []]],
478489
requestBody: new OA\RequestBody(
479490
description: 'End session parameters',
480491
required: true,

app/Swagger/OAuth2ProviderControllerSchemas.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
title: 'OAuth2 Token Response',
1010
description: 'Successful token response per RFC 6749 §5.1',
1111
type: 'object',
12+
required: ['access_token', 'token_type'],
1213
properties: [
1314
new OA\Property(property: 'access_token', type: 'string', description: 'The access token issued by the authorization server'),
1415
new OA\Property(property: 'token_type', type: 'string', description: 'The type of the token (typically Bearer)', example: 'Bearer'),
@@ -87,6 +88,7 @@ class OAuth2IntrospectionResponseSchema
8788
title: 'JSON Web Key Set',
8889
description: 'JWK Set document per RFC 7517',
8990
type: 'object',
91+
required: ['keys'],
9092
properties: [
9193
new OA\Property(
9294
property: 'keys',
@@ -115,6 +117,7 @@ class JWKSResponseSchema
115117
title: 'OpenID Connect Discovery Document',
116118
description: 'OpenID Provider Configuration per OpenID Connect Discovery 1.0',
117119
type: 'object',
120+
required: ['issuer', 'authorization_endpoint', 'token_endpoint', 'jwks_uri', 'response_types_supported', 'subject_types_supported', 'id_token_signing_alg_values_supported'],
118121
properties: [
119122
new OA\Property(property: 'issuer', type: 'string', format: 'uri', description: 'Issuer identifier URL'),
120123
new OA\Property(property: 'authorization_endpoint', type: 'string', format: 'uri', description: 'Authorization endpoint URL'),

app/Swagger/Requests/OAuth2AuthorizationRequestSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
new OA\Property(property: 'state', type: 'string', description: 'Opaque state parameter'),
1919
new OA\Property(property: 'nonce', type: 'string', description: 'Nonce for ID token replay protection'),
2020
new OA\Property(property: 'response_mode', type: 'string', description: 'Response mode override', enum: ['query', 'fragment', 'form_post', 'direct']),
21-
new OA\Property(property: 'prompt', type: 'string', description: 'User interaction prompts'),
21+
new OA\Property(property: 'prompt', type: 'string', description: 'Space-delimited user interaction prompts (OIDC). Allowed tokens: none, login, consent, select_account. "none" cannot be combined with others. Example: "login consent"'),
2222
new OA\Property(property: 'login_hint', type: 'string', description: 'Login identifier hint'),
2323
new OA\Property(property: 'code_challenge', type: 'string', description: 'PKCE code challenge'),
2424
new OA\Property(property: 'code_challenge_method', type: 'string', description: 'PKCE challenge method', enum: ['plain', 'S256']),

app/Swagger/Requests/OAuth2TokenIntrospectionRequestSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
properties: [
1414
new OA\Property(property: 'token', type: 'string', description: 'The token to introspect'),
1515
new OA\Property(property: 'client_id', type: 'string', description: 'Client identifier (if not using HTTP Basic auth)'),
16-
new OA\Property(property: 'client_secret', type: 'string', description: 'Client secret (if not using HTTP Basic auth)'),
16+
new OA\Property(property: 'client_secret', type: 'string', format: 'password', description: 'Client secret (if not using HTTP Basic auth)'),
1717
]
1818
)]
1919
class OAuth2TokenIntrospectionRequestSchema

0 commit comments

Comments
 (0)