Skip to content

Commit 2d6e474

Browse files
authored
fix(openapi)!: oauth scopes with dashes in name (#7853)
1 parent e036b5f commit 2d6e474

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/Symfony/Bundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ private function addOAuthSection(ArrayNodeDefinition $rootNode): void
269269
->scalarNode('authorizationUrl')->defaultValue('')->info('The oauth authentication url.')->end()
270270
->scalarNode('refreshUrl')->defaultValue('')->info('The oauth refresh url.')->end()
271271
->arrayNode('scopes')
272+
->normalizeKeys(false)
272273
->prototype('scalar')->end()
273274
->end()
274275
->end()

tests/Symfony/Bundle/DependencyInjection/ConfigurationTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,4 +528,20 @@ public function testElasticsearchSslCaBundleAndVerificationDisabledMutuallyExclu
528528
],
529529
]);
530530
}
531+
532+
public function testOauthScopeNaming(): void
533+
{
534+
$config = $this->processor->processConfiguration($this->configuration, [
535+
'api_platform' => [
536+
'oauth' => [
537+
'enabled' => true,
538+
'scopes' => [
539+
'resource:read-write' => 'Read and write resource data',
540+
],
541+
],
542+
],
543+
]);
544+
545+
$this->assertEquals(['resource:read-write' => 'Read and write resource data'], $config['oauth']['scopes']);
546+
}
531547
}

0 commit comments

Comments
 (0)