Commit graph

106 commits

Author SHA1 Message Date
Hypolite Petovan
1b9ec3a214 Rename BaseApi->logErrorAndJsonExit to logAndJsonError to better match the functionality
- Also it's shorter and we're paying by the character
2023-10-11 09:44:03 -04:00
Hypolite Petovan
696c56b6be Move jsonError out of Factory\Api\Mastodon\Error->Forbidden 2023-10-11 09:44:03 -04:00
Hypolite Petovan
9e71610711 Make BaseApi->checkAllowedScope into an object method
- It isn't called from static contexts anymore
2023-10-11 09:43:57 -04:00
Hypolite Petovan
f70a64891c Add Factory\Api\Mastodon\Error dependency to BaseApi
- Copy Factory\Api\Mastodon\Error->logError functionality to BaseApi
2023-10-11 09:43:54 -04:00
Hypolite Petovan
46180d7d5b Move System::jsonError to BaseModule->jsonError
- This will ensure headers set in BaseModule->run will be carried in jsonError scenarios
- Make BaseApi->checkThrottleLimit an object method to use BaseModule->jsonError
- Deprecate jsonError() method in Core\System
2023-09-24 07:08:15 -04:00
Michael
701681ea21 Don't perform BasicAuth on public endpoints 2023-04-08 19:17:57 +00:00
Hank Grabowski
1e48978664 Use Mastodon standard edited_at field for tracking edit time 2023-02-28 15:02:02 -05:00
Hank G
c7457c7a72
Update src/Module/BaseApi.php
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
2023-02-28 13:49:23 -05:00
Hank Grabowski
13672bccf4 Only allow explicitly known order types through 2023-02-28 13:10:45 -05:00
Hank Grabowski
f0b3864c7a Add default getLinkHeader asDate to be false (the previous ID-only way) 2023-02-28 12:48:25 -05:00
Hank Grabowski
260f4e46ab Correct format/style errors 2023-02-28 11:43:12 -05:00
Hank Grabowski
32bb097604 Correct format/style errors 2023-02-28 11:41:53 -05:00
Hank Grabowski
1f6578229e Add additional Mastodon timeline sorting date types and data to output 2023-02-28 10:36:11 -05:00
Hank Grabowski
1adb23d8fd Change timestamp to be DateTime object not integers in Mastodon Timeline API 2023-02-28 08:20:08 -05:00
Hank Grabowski
9a6ebc94c4 Add support for since_id field into the timeline API 2023-02-23 07:04:12 -05:00
Hank Grabowski
a67fe069e8 Add order/limit building func and fix reverse order requirement on min_id 2023-02-22 11:27:54 -05:00
Hank Grabowski
9c5f3ae58f Simply Timeline Home temporal endpoint to reuse min_id and max_id 2023-02-22 11:02:52 -05:00
Hank Grabowski
818075d039 Implement time based paging for Mastodon Home Timeline Endpoint 2023-02-21 15:37:32 -05:00
Hank Grabowski
2754cdc5d6 Add Link headers by offset/limit capability to BaseApi 2023-02-17 13:24:00 -05:00
Michael
49d513f8d2 API: added positiv list for quote support 2023-01-25 06:26:17 +00:00
Hypolite Petovan
1874a32728 Happy New Year 2023! 2023-01-01 09:36:24 -05:00
Philipp
4f1bb0d274
Use X-REQUEST-ID for Error pages 2022-12-26 21:18:05 +01:00
Michael
5312b23f03 Don't send the header 2022-12-12 03:13:24 +00:00
Roland Häder
da66730e4f
Rewrite:
- moved constants GRAVITY_* from boot.php to Friendica\Model\Item
- also rewrote some array initialization:

From:
````
<?php
$arr = [];
$arr['foo'] = "FOO";
````

To:
````
<?php
$arr['foo'] = "FOO";
````
- added a few type-hints
2022-10-15 00:44:06 +02:00
Michael
f7b85092b0 Some more changed log levels 2022-08-31 05:01:22 +00:00
Hypolite Petovan
71084cf9f0 Use L10n->tt instead of t() for plural string in Module\BaseApi 2022-08-08 02:08:43 -04:00
Philipp
4e67bfed8d
Use Args::getMethod() at various places 2022-01-04 20:59:26 +01:00
Philipp
322b7c856c
Merge pull request #11129 from urbalazs/copyright-2022
Update copyright
2022-01-02 09:45:35 +01:00
Balázs Úr
e56a53647b Update copyright 2022-01-02 08:27:47 +01:00
Michael
0a3026abce Issue 11101: Fix API authentification 2021-12-17 07:04:52 +00:00
Michael
799baeda10 Issue 11063: Fix check for current user 2021-12-04 04:30:46 +00:00
Philipp
2dc60cfd33 Make API call permission checks more reliable
- don't need to inherit every Module method anymore
2021-11-30 01:07:59 -05:00
Philipp
2e4d654c0a Make $_REQUEST processing independent of sub-calls
- Move HTTPInputData::process() into App::runFrontend()
- Pass $_REQUEST (including processed Input) to every Module method
- Delete $_POST parameters at Module post() calls because of $_REQUEST
2021-11-30 01:07:58 -05:00
Philipp
f580d8e5c0 extract "BaseApi::checkDefaults()" method for later usage 2021-11-30 01:07:57 -05:00
Philipp
d576bb136b
Fix BaseApi and corresponding tests 2021-11-28 13:11:12 +01:00
Hypolite Petovan
9cc675233d Add a second parameter to BaseApi::getRequest to enable API tests 2021-11-27 18:38:09 -05:00
Philipp
537b74f307
Inherit ApiResponse from Response 2021-11-27 12:40:54 +01:00
Philipp
8bdd90066f
Make BaseModule a real entity
- Add all dependencies, necessary to run the content (baseUrl, Arguments)
- Encapsulate all POST/GET/DELETE/PATCH/PUT methods as protected methods inside the BaseModule
- Return Module content ONLY per `BaseModule::run()` (including the Hook logic there as well)
2021-11-27 12:40:36 +01:00
Michael
0e3c8e3f5e Mixed parameter order 2021-11-26 08:16:06 +00:00
Michael
fb47389c69 API: Fix profile_url handling / missing constant 2021-11-26 07:55:02 +00:00
Michael
a3aab4a75a Entities, Source and api functions rearranged 2021-11-24 06:44:25 +00:00
Michael
a4ef4589e6 Reworked friendship API endpoints 2021-11-21 16:59:09 +00:00
Michael
0e5f876680 function moved 2021-11-21 09:55:42 +00:00
Michael
2c6afe65a7 Use correct function to fetch the self user 2021-11-21 00:26:35 +00:00
Michael
ae99144f57 Tests again 2021-11-21 00:15:36 +00:00
Michael
0f09b4f636 Fixing (some) tests 2021-11-20 23:47:03 +00:00
Michael
647ecd4bd3 Relocate RSS header stuff, cleaning up the code 2021-11-20 13:44:12 +00:00
Michael
4327ccddcb Some more removed functions and parameters 2021-11-20 09:36:17 +00:00
Michael
8fd738f550 Removed "api_get_user" 2021-11-18 22:20:19 +00:00
Michael
b67c10812a Merge remote-tracking branch 'upstream/develop' into api4 2021-11-18 20:15:57 +00:00