Commit graph

248 commits

Author SHA1 Message Date
Yassine Guedidi 81577ef6b0 Move Api entities to Core 2024-01-25 20:34:40 +01:00
Yassine Guedidi 3fc0b5fa5b Move Api controllers to Core 2024-01-25 20:34:40 +01:00
Yassine Guedidi 020c616c9d Remove unused routing file 2024-01-25 20:34:40 +01:00
Yassine Guedidi 87ed669504 Move User form types to Core 2024-01-25 20:34:40 +01:00
Yassine Guedidi a37ded9101 Move User entity to Core 2024-01-25 20:34:40 +01:00
Yassine Guedidi 2190174754 Move Annotation entity to Core 2024-01-25 20:34:39 +01:00
Yassine Guedidi 2ed8c219cc Move Annotation controller to Core 2024-01-25 20:34:39 +01:00
Yassine Guedidi 0178c7356d Fix PHPStan errors 2024-01-22 19:15:54 +01:00
Yassine Guedidi 0a117958c9 Apply PHP-CS-Fixer fixes 2024-01-22 19:15:54 +01:00
Jeremy Benoist 2149ef4510
Add ObjectManagedLoader for PHPStan 2023-11-16 09:50:02 +01:00
Rotzbua 51c68655fb Fix some typos 2023-09-18 11:16:19 +02:00
Jeremy Benoist c6ff0bc691
Remove remaining MOBI stuff 2023-08-23 08:49:56 +02:00
Nicolas Lœuillet 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
Nicolas Lœuillet 20578f0b8e Add isNotParsed field on Entry entity
Fix #4350
2023-08-21 13:16:42 +02:00
Yassine Guedidi 0f17a8cf8a PHPStan level 3 2023-08-21 12:03:38 +02:00
Nicolas Lœuillet ca879c36de Prepare wallabag 2.6.3 2023-08-21 11:52:16 +02:00
Nicolas Lœuillet c3d1f92278 Replace GET way to POST way to delete API client 2023-08-09 21:54:40 +02:00
Nicolas Lœuillet c1cba72a19 Replace hardcoded url by current wallabag url 2023-07-30 10:09:54 +02:00
Casper Meijn 4c797162bf ApiDoc: Add response description to UserRestController 2023-07-02 08:31:11 +02:00
Casper Meijn 0fff56ea68 ApiDoc: Add response description to WallabagRestController 2023-06-27 20:59:43 +02:00
Jeremy Benoist 66b7bdd07c
Merge remote-tracking branch 'origin/2.5.x' 2023-04-24 14:36:32 +02:00
Casper Meijn 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
Kevin Decherf 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
Casper Meijn 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
Jeremy Benoist 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
Jeremy Benoist 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
Jeremy Benoist 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
Jeremy Benoist 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
Jeremy Benoist b7dba18cb2
Cleanup 2022-11-23 15:51:33 +01:00
Jeremy Benoist 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
Jeremy Benoist 27e788d0be
Re-create all API routes 2022-11-23 12:44:55 +01:00
Casper Meijn 470a8575c0 Update to nelmio/api-doc 3.0
Convert ApiDoc to Swagger
2022-11-16 16:10:33 +01:00
Jeremy Benoist c372d68cc1
Merge remote-tracking branch 'origin/master' into 2.6.0 2022-10-18 11:11:02 +02:00
Yotam Nachum f994ab8b5d Add domain_name to entries api endpoint 2022-10-16 18:36:41 +03:00
Jeremy Benoist 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
Yassine Guedidi 98af2e25f2 Use ::class notation where possible 2022-09-01 20:54:56 +02:00
Yassine Guedidi d1d56fbe25 Import used classes 2022-09-01 19:21:45 +02:00
Yassine Guedidi eb43c78720 Use FQCN instead of service alias 2022-09-01 09:07:19 +02:00
Yassine Guedidi 1bee0eeb29 Make repositories use ServiceEntityRepository 2022-08-31 02:05:30 +02:00
Yassine Guedidi 481283bbee Migrate controller and action references 2022-08-26 17:47:46 +02:00
Yassine Guedidi 1c880883e2 Migrate ParamConverter class parameter 2022-08-26 17:47:46 +02:00
Yassine Guedidi 8b7b4975d6 Migrate getRepository with entities 2022-08-26 17:47:46 +02:00
Yassine Guedidi 0f9c359476 Use FQCN as service name for repositories 2022-08-24 23:24:25 +02:00
Yassine Guedidi 844e8e9d22 Use FQCN as service name for helper services 2022-08-24 23:24:24 +02:00
Yassine Guedidi 5a55a64fee Use fosuser_registration directly instead of wallabag_user.registration_enabled 2022-08-15 17:23:16 +02:00
Nicolas Lœuillet aaa03cc395
Added serialization group 2022-04-20 22:12:49 +02:00
Nicolas Lœuillet bb12538fab
Added new endpoint for API: config 2022-04-20 22:12:49 +02:00
Kevin Decherf 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
Jeremy Benoist c10b79e82f
Update PagerFanta deprecation 2020-07-29 06:36:43 +02:00
Nicolas Lœuillet a07872238b
Fixed bug when we delete entry via API
Fixes #4291
2020-04-06 16:11:05 +02:00