Commit Graph

212 Commits

Author SHA1 Message Date
87ed669504 Move User form types to Core 2024-01-25 20:34:40 +01:00
a37ded9101 Move User entity to Core 2024-01-25 20:34:40 +01:00
2190174754 Move Annotation entity to Core 2024-01-25 20:34:39 +01:00
2ed8c219cc Move Annotation controller to Core 2024-01-25 20:34:39 +01:00
0178c7356d Fix PHPStan errors 2024-01-22 19:15:54 +01:00
0a117958c9 Apply PHP-CS-Fixer fixes 2024-01-22 19:15:54 +01:00
51c68655fb Fix some typos 2023-09-18 11:16:19 +02:00
c6ff0bc691 Remove remaining MOBI stuff 2023-08-23 08:49:56 +02:00
1c2190fd68 Merge pull request #6769 from wallabag/add-not-parsed-boolean
Add `isNotParsed` field on Entry entity
2023-08-21 20:18:44 +02:00
20578f0b8e Add isNotParsed field on Entry entity
Fix #4350
2023-08-21 13:16:42 +02:00
0f17a8cf8a PHPStan level 3 2023-08-21 12:03:38 +02:00
ca879c36de Prepare wallabag 2.6.3 2023-08-21 11:52:16 +02:00
c3d1f92278 Replace GET way to POST way to delete API client 2023-08-09 21:54:40 +02:00
c1cba72a19 Replace hardcoded url by current wallabag url 2023-07-30 10:09:54 +02:00
4c797162bf ApiDoc: Add response description to UserRestController 2023-07-02 08:31:11 +02:00
0fff56ea68 ApiDoc: Add response description to WallabagRestController 2023-06-27 20:59:43 +02:00
66b7bdd07c Merge remote-tracking branch 'origin/2.5.x' 2023-04-24 14:36:32 +02:00
5a5148707c Fix API allowed_registration
Two configuration options need to be enabled to allow user registration via the API:
1) fosuser_registration, which indicates whether registration is allowed at all (frontend and API)
2) api_user_registration, which indicates whether registration is allowed via the API
2023-03-28 20:12:55 +02:00
3ed7f2b751 AnnotationController: fix improper authorization vulnerability
This PR is based on 2.5.x branch.

We fix the improper authorization by retrieving the annotation using id
and user id.

We also replace the ParamConverter used to get the requested Annotation
on put and delete actions with an explicit call to AnnotationRepository
in order to prevent a resource enumeration through response discrepancy.

Fixes GHSA-mrqx-mjc4-vfh3

Co-authored-by: Jeremy Benoist <jeremy.benoist@gmail.com>
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-01-27 23:34:14 +01:00
4f9c7a92a1 Update annotations to OpenApi 3
Most of the API annotations are directly converted. The changes in meaning are:
- Parameters "in body" is not supported anymore. These are changed to "in query" or to a request body (depending on the code).
2022-12-23 14:54:55 +01:00
6aca334d53 Move to controller as a service
Mostly using autowiring to inject deps.
The only tricky part was for import because all producer use the same class and have a different alias. So we must write them down in the service definition, autowiring doesn't work in that case.

Usually:
- if a controller has a constructor, it means injected services are at least re-used once in actions
- otherwise, service are injected per action
2022-12-19 10:38:08 +01:00
d47c208743 Fix EventDispatcer & events
Looks like parameter for the `->dispatch(` have been flipped (event first then event name).
Define events should now extends `Symfony\Contracts\EventDispatcher\Event`
2022-12-15 21:47:31 +01:00
33267f0736 Update to FOSUserBundle 3.1
Also remove some deprecation from Symfony.
Use `LegacyEventDispatcherProxy` to handle Symfony 4 dispatch from FOSUser
2022-12-14 09:42:17 +01:00
aa5c7f05b8 Upgrade to Symfony 4.4
- disable autowiring for Event (because the Entry entity was injected)
- rename `getClient()` for test to `getTestClient()` to avoid error while overriding (from `BrowserKitAssertionsTrait`)
2022-11-29 18:01:46 -08:00
b7dba18cb2 Cleanup 2022-11-23 15:51:33 +01:00
1d3935fbd3 Remove LiipThemeBundle
As baggy theme was removed and material is the only remaining theme, we don't need a theme switched anymore.
So:
- move all `*.twig` files from the material theme folder to the root
- remove useless translations
2022-11-23 14:52:06 +01:00
27e788d0be Re-create all API routes 2022-11-23 12:44:55 +01:00
470a8575c0 Update to nelmio/api-doc 3.0
Convert ApiDoc to Swagger
2022-11-16 16:10:33 +01:00
c372d68cc1 Merge remote-tracking branch 'origin/master' into 2.6.0 2022-10-18 11:11:02 +02:00
f994ab8b5d Add domain_name to entries api endpoint 2022-10-16 18:36:41 +03:00
812b4a906f Add nbEntries to the API tags list response
So client will be able to do the same as in the web UI.

Also remove empty `div` from the tags template.
2022-09-23 15:16:38 +02:00
98af2e25f2 Use ::class notation where possible 2022-09-01 20:54:56 +02:00
d1d56fbe25 Import used classes 2022-09-01 19:21:45 +02:00
eb43c78720 Use FQCN instead of service alias 2022-09-01 09:07:19 +02:00
481283bbee Migrate controller and action references 2022-08-26 17:47:46 +02:00
1c880883e2 Migrate ParamConverter class parameter 2022-08-26 17:47:46 +02:00
8b7b4975d6 Migrate getRepository with entities 2022-08-26 17:47:46 +02:00
0f9c359476 Use FQCN as service name for repositories 2022-08-24 23:24:25 +02:00
844e8e9d22 Use FQCN as service name for helper services 2022-08-24 23:24:24 +02:00
5a55a64fee Use fosuser_registration directly instead of wallabag_user.registration_enabled 2022-08-15 17:23:16 +02:00
aaa03cc395 Added serialization group 2022-04-20 22:12:49 +02:00
bb12538fab Added new endpoint for API: config 2022-04-20 22:12:49 +02:00
19802d8bd5 Improve performance of REST exists call
I've noticed that the endpoint `/api/entries/exists` used by the "Sweep
articles" feature on the Android app failed almost all the time on my
instance.

After checking the corresponding method I found that
`EntryRestController::getEntriesExistsAction()` could be improved.

Here is the former way the method worked:

```
for id in [list of ids]
  get full entry by id
  if null
    get full entry by given id

return array of ids or array of hashes
```

With this behavior on my instance I could expect up to 13k SQL requests
when sweeping articles from the Android app. Morever the repository
fetches all fields (content included) while the method only returns ids
or hashes.

The new behavior is described as follow:

```
get ids, hashes by [list of ids]
merge with provided [list of ids] // this part will complete the final
                                  // array with not found ids

return array of ids or array of hashes
```

In my case this change reduces the number of SQL requests to only 135
(_considering one request for 50 articles_)

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2021-08-05 23:19:08 +02:00
c10b79e82f Update PagerFanta deprecation 2020-07-29 06:36:43 +02:00
a07872238b Fixed bug when we delete entry via API
Fixes #4291
2020-04-06 16:11:05 +02:00
86c1751186 Optionnal quote because the frontend does not use it 2019-11-27 14:38:35 +01:00
8197f08266 API return an error with empty quote
Fix #4137
2019-11-27 14:38:35 +01:00
8d4ed0df06 Update deps
Also CS (because cs-fixer got an update)

Package operations: 0 installs, 26 updates, 0 removals
  - Updating twig/twig (v2.12.1 => v2.12.2)
  - Updating symfony/symfony (v3.4.33 => v3.4.34)
  - Updating doctrine/event-manager (v1.0.0 => 1.1.0)
  - Updating doctrine/collections (v1.6.2 => 1.6.3)
  - Updating doctrine/cache (v1.8.1 => 1.9.0)
  - Updating doctrine/persistence (1.1.1 => 1.2.0)
  - Updating doctrine/inflector (v1.3.0 => 1.3.1)
  - Updating symfony/mime (v4.3.5 => v4.3.7)
  - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3)
  - Updating symfony/swiftmailer-bundle (v3.3.0 => v3.3.1)
  - Updating doctrine/dbal (v2.9.2 => v2.9.3)
  - Updating doctrine/instantiator (1.2.0 => 1.3.0)
  - Updating j0k3r/graby-site-config (1.0.93 => 1.0.94)
  - Updating phpoption/phpoption (1.5.0 => 1.5.2)
  - Updating symfony/http-client-contracts (v1.1.7 => v1.1.8)
  - Updating symfony/http-client (v4.3.5 => v4.3.7)
  - Updating sensiolabs/security-checker (v6.0.2 => v6.0.3)
  - Updating paragonie/constant_time_encoding (v2.2.3 => v2.3.0)
  - Updating scheb/two-factor-bundle (v4.7.1 => v4.8.0)
  - Updating symfony/phpunit-bridge (v4.3.6 => v4.3.7)
  - Updating composer/xdebug-handler (1.3.3 => 1.4.0)
  - Updating friendsofphp/php-cs-fixer (v2.15.3 => v2.16.0)
  - Updating doctrine/data-fixtures (v1.3.2 => 1.3.3)
  - Updating nette/schema (v1.0.0 => v1.0.1)
  - Updating nikic/php-parser (v4.2.4 => v4.3.0)
  - Updating sentry/sentry (2.2.2 => 2.2.4)
2019-11-12 14:18:58 +01:00
34be2d5de4 Add ability to import/export tagging rules
- Add missing translations
- Add some tests
- Add `/api/taggingrule/export` API endpoint
- Add baggy theme
- Add error message when importing tagging rules failed
- Also fix all translations (I think we are good now)
2019-07-08 09:38:32 +02:00
52e8d93248 Fix some Scrutinizer issues 2019-05-29 12:50:44 +02:00