Commit Graph

194 Commits

Author SHA1 Message Date
52e8d93248 Fix some Scrutinizer issues 2019-05-29 12:50:44 +02:00
2cbee36a01 Merge pull request #3944 from shtrom/always-hash-exists-url
Always hash exists url
2019-05-28 14:18:33 +02:00
5f08426201 Fix because of some breaking changes of Graby 2.0 2019-05-28 11:42:27 +02:00
629a3797bc Remove useless methods
Also fix a phpdoc block
2019-05-24 15:46:28 +02:00
4a5516376b Add Wallabag\CoreBundle\Helper\UrlHasher
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-05-24 15:17:46 +02:00
31e276fc16 EntryRestController::getEntriesExistsAction: always find by hashed url
Simplify the logic from #3158 by hashing all the urls from the request,
and only doing a search by hash. This allows to get performance benefits
from the new indexed hash column even when using older clients that do
not hash the URL in the request.

Fixes: #3158, #3919

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-05-24 15:17:45 +02:00
a2b5d67560 Merge pull request #3960 from wallabag/api-entries-2817
api/entries: add parameter detail to exclude or include content in response
2019-05-21 11:18:19 +02:00
2c290747cb api/entries: add parameter detail to exclude or include content in response
detail=metadata will nullify the content field of entries in order to
make smaller responses.

detail=full keeps the former behavior, it sends the content of entries.
It's the default, for backward compatibility.

Fixes #2817

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-05-18 18:11:08 +02:00
637f0df976 Cascade delete on oauth2 table when deleting a user 2019-05-10 20:36:45 +02:00
76bc05ebc0 Fix ApiDoc about md5/sha1 2019-04-02 22:59:50 +02:00
c579ce2306 Some cleanup
Also, do not run the hashed_url migration into a Doctrine migration
2019-04-01 14:34:20 +02:00
9c2b2aae70 Keep url in exists endpoint
- Add migration
- Use md5 instead of sha512 (we don't need security here, just a hash)
- Update tests
2019-04-01 13:24:40 +02:00
bfe02a0b48 Hash the urls to check if they exist
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-04-01 13:24:40 +02:00
3620dae1e6 Merge remote-tracking branch 'origin/master' into 2.4 2019-04-01 13:16:15 +02:00
508302042f EntryRestController: add support of expect parameter to delete action
The expect parameter enables an application to request the whole entry
or only the id when requesting its deletion.

`expects` defaults to `entry` to prevent any API breakage.

Fixes #3711

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-02-20 15:57:50 +01:00
baa5ee2d42 Force default_protocol to generate an url input 2019-02-08 15:03:52 +01:00
8010425444 Fix third argument to Route 2019-01-22 20:42:25 +01:00
019e1acc49 Factorize sendResponse between Api controllers
And run newer cs fixer
2019-01-22 20:42:25 +01:00
9133bd02d1 [wallabag/wallabag#2611] Fix PHPCS lint errors 2019-01-22 20:42:25 +01:00
b32057980e Fixes [wallabag/wallabag#2611] Add a basic Search REST endpoint
- Adds a new `search` key to `src/Wallabag/ApiBundle/Resources/config/routing_rest.yml`
- Reuses the `getBuilderForSearchByUser` method from the EntryRepository
- Supports, `term`, `page`, and `perPage` query parameters
- Some very basic tests
2019-01-22 20:42:24 +01:00
3bd65991ad Add a new endpoint to retrieve information from the wallabag instance
Useful for api client which required some information.
We might add more inside them in the future.

The endpoint /api/version should be avoided now as it contains not so much information rather the version.
2019-01-15 10:17:11 +01:00
5419a8368e Merge remote-tracking branch 'origin/master' into 2.4 2019-01-15 09:41:18 +01:00
78e3fafa3f Avoid error when a bad order parameter is given
Only allowed parameter are asc & desc
2019-01-14 17:01:21 +01:00
03663530ed Merge pull request #3831 from wallabag/fix/api-bad-client-id
Cast client id to avoid PG error
2019-01-10 17:03:03 +01:00
3a2d4cf9fd Cast client id to avoid PG error
If someone send a malformated client_id when trying to authenticate using the API we got a 500 if wallabag use postgres because the request send a string instead of an integer.
2019-01-09 23:31:14 +01:00
2a0e0a47d8 TagRestController: rewrite delete actions to only retrieve tags related to the user
Fixes #3815

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-12-30 01:34:49 +01:00
877787e5fe Fix utf8mb4 on vendor tables
When creating the schema for test these tables use default length for
string: 255. Which fail when using utf8mb4.

> Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Also move the `setKeepStaticConnections` in before and after class to
avoid:

> SAVEPOINT DOCTRINE2_SAVEPOINT_2 does not exist

See https://github.com/dmaicher/doctrine-test-bundle#troubleshooting
2018-11-28 22:04:55 +01:00
115de64e5b Jump to Symfony 3.4
Thanks to the BC compatibility, almost nothing have to be changed.
All changes are related to new bundle version of:
- SensioFrameworkExtraBundle
- DoctrineFixturesBundle
2018-10-04 14:11:57 +02:00
0e70e81227 Entry: add sort parameter archived 2018-09-21 10:33:33 +02:00
7975395d10 Entry: add archived_at property and updateArchived method 2018-09-21 10:33:33 +02:00
2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
f5ea67e4cf api: copy entry object before sending, to keep id
Workaround for https://github.com/wallabag/android-app/issues/646

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-17 21:07:46 +01:00
af29e1bf07 Fix empty title and domain_name when exception is thrown during fetch
Add a new helper to set a default title when it's empty:
1/ use basename part of entry's path, if any
2/ or use domain name

Fixes #2053

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-13 22:44:31 +01:00
4ac0e65963 Fix bad key matching
I didn't try to find which package introduced a BC (might be user-bundle
or jms serializer)
2017-12-08 12:10:28 +01:00
3b771f51a6 Improve origin_url field description and translations
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-19 15:02:11 +01:00
e0ef1a1c8b Add originUrl property to Entry, handle that in EntryRestController, handle migration
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-19 15:02:11 +01:00
0978bd849e Fix #3361 Entry Rest controller getEntries cast tags params to string 2017-10-13 10:28:05 +02:00
3ef055ced3 CS 2017-10-09 16:47:15 +02:00
f40c88eb1f Jump to Symfony 3.3 & update others deps
Also update tests urls
2017-10-09 16:45:12 +02:00
a991c46eed Set a starred_at field when an entry is starred.
This date is used to sort starred entries.

Can not use Entry::timestamps method otherwise starred_at will be updated each time entry is updated.
Add an updateStar method into Entry class
A migration script has been added in order to set starred_at field.
2017-08-25 21:19:47 +02:00
52b84c11a5 Fix some namespaces and phpdoc 2017-07-29 22:51:50 +02:00
f39152ad6e Merge pull request #3266 from egilli/export-domain-as-author
Use the article publisher as author for exported files
2017-07-11 09:21:49 +02:00
07320a2bd2 Use the article domain as author for export files
When exporting an entry, use the domain name as author name for epub,
mobi and pdf formats, instead of 'wallabag'.
Change the author from array to string, because for now, there is always
only one author.
2017-07-08 19:53:43 +02:00
2e5b2fa808 Revert client_credentials grant types 2017-07-08 19:28:12 +02:00
c18a2476b6 CS 2017-07-03 13:56:39 +02:00
a05b61159e Fix PATCH method
The PATCH method for the entry should only update what user sent to us and not the whole entry as it was before.
Also, sending tags when patching an entry will now remove all current tags & assocatied new ones.
2017-07-03 13:45:04 +02:00
f808b01692 Add a real configuration for CS-Fixer 2017-07-01 09:52:38 +02:00
331e5b0261 CS 2017-06-28 09:18:22 +02:00
39ffaba323 Return null instead of false 2017-06-28 08:15:06 +02:00
18696f77fd Avoid BC on exists endpoint 2017-06-23 08:30:23 +02:00