diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-02 10:19:33 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-02 11:32:38 +0200 |
commit | 426bb453d295900fb3e35dce2f9081a42639cf27 (patch) | |
tree | 77fc6aedf17640a9d13a817e25fbd06ab89b471f /src/Wallabag/CoreBundle/DependencyInjection | |
parent | a687c8d915276eee0c0494156700f7d0c0606735 (diff) | |
download | wallabag-426bb453d295900fb3e35dce2f9081a42639cf27.tar.gz wallabag-426bb453d295900fb3e35dce2f9081a42639cf27.tar.zst wallabag-426bb453d295900fb3e35dce2f9081a42639cf27.zip |
API user creation behing a toggle
I've added a toggle feature (in internal settings) so that user api creation can be disabled while form registration still can be enabled.
Also, the /api/user endpoint shouldn't require authentication. Even if we check the authentication when sending a GET request, to retrieve current user information.
I've moved all the internal settings definition to config to avoid duplicated place to define them.
I don't know why we didn't did that earlier.
Diffstat (limited to 'src/Wallabag/CoreBundle/DependencyInjection')
-rw-r--r-- | src/Wallabag/CoreBundle/DependencyInjection/Configuration.php | 11 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index 8b5b5744..33df92d3 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php | |||
@@ -52,6 +52,17 @@ class Configuration implements ConfigurationInterface | |||
52 | ->scalarNode('api_limit_mass_actions') | 52 | ->scalarNode('api_limit_mass_actions') |
53 | ->defaultValue(10) | 53 | ->defaultValue(10) |
54 | ->end() | 54 | ->end() |
55 | ->arrayNode('default_internal_settings') | ||
56 | ->prototype('array') | ||
57 | ->children() | ||
58 | ->scalarNode('name')->end() | ||
59 | ->scalarNode('value')->end() | ||
60 | ->enumNode('section') | ||
61 | ->values(['entry', 'misc', 'api', 'analytics', 'export', 'import']) | ||
62 | ->end() | ||
63 | ->end() | ||
64 | ->end() | ||
65 | ->end() | ||
55 | ->end() | 66 | ->end() |
56 | ; | 67 | ; |
57 | 68 | ||
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index a2a703cb..b4d8a386 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php | |||
@@ -28,6 +28,7 @@ class WallabagCoreExtension extends Extension | |||
28 | $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); | 28 | $container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']); |
29 | $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']); | 29 | $container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']); |
30 | $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']); | 30 | $container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']); |
31 | $container->setParameter('wallabag_core.default_internal_settings', $config['default_internal_settings']); | ||
31 | 32 | ||
32 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | 33 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
33 | $loader->load('services.yml'); | 34 | $loader->load('services.yml'); |