Commit Graph

12409 Commits

Author SHA1 Message Date
Andreas Gohr 0caa81c700 API: move create/delete user calls to usermanager
This only moves the calls. A proper refactoring of the user manager
would make sense:

1) introduce a helper component covering the basic operations including
   proper error signalling using Exceptions
2) refactor admin and cli components to make use of 1)
3) make the operations in 1) available via the API
2024-01-07 13:41:19 +01:00
Andreas Gohr f1cc602f77 OpenAPI Gen: fix requirement handling 2024-01-07 13:41:19 +01:00
Andreas Gohr 6cce3332fb Reworked API definition
This cleans up the API:

* no more compatibility with obsolete wiki API
* no more difference between wiki.* and dokuwiki.* calls -> core.*
* use of optional parameters avoids double definitions
* use Response objects for complex results
* always use named primitives as input
* major cleanup of docblock descriptions
2024-01-07 13:41:19 +01:00
Andreas Gohr dd7472d3f8 OpenAPI Gen: handle Object to Schema transformation correctly
All the basic mechanisms should now be in place to clean up the API
2024-01-07 13:41:19 +01:00
Andreas Gohr 53c2a557e0 OpenApi Gen: add toString method for easier testing 2024-01-07 13:41:19 +01:00
Andreas Gohr 8ddd9b6918 OpenAPI Generator. Better DocBlock parsing [WIP]
This introduces a new DocBlock parser to properly generate API
specifications. It also introduces the concept of Response classes to
better specify the response format.

This is still very much in progress.
2024-01-07 13:41:19 +01:00
Andreas Gohr fe9f11e2d0 improved API docs 2024-01-07 13:41:19 +01:00
Andreas Gohr 66f07661cd OpenAPI Gen: @link tag, examples for known params 2024-01-07 13:41:19 +01:00
Andreas Gohr cd0c7c3ac3 add title to api explorer 2024-01-07 13:41:19 +01:00
Andreas Gohr d0749387d4 fix ApiCall test 2024-01-07 13:41:19 +01:00
Andreas Gohr 0ff4031c08 rename $id to be more clear
It should be more clear if a media or page ID is passed. Also
openapi-explorer will not prefill examples for any parameters called
*id*.
2024-01-07 13:41:19 +01:00
Andreas Gohr 0c6e917818 OpenAPI Explorer basically works 2024-01-07 13:41:19 +01:00
Andreas Gohr 8a9282a2e6 improve the doc blocks in ApiCore 2024-01-07 13:41:19 +01:00
Andreas Gohr b05603ab33 fix type parsing for more complex types 2024-01-07 13:41:19 +01:00
Andreas Gohr e7323dfb8c Do not directly use native function in API
As fedb877023 showed, we can not directly
use native fuctions because they have no proper type hinting in PHP7.4
2024-01-07 13:41:19 +01:00
Andreas Gohr 5b379b5045 fix ApiCall test on PHP7.4
Since PHP7.4 has no primitive type hints and PHP native methods have no
accessible docblocks, we can not use a native function for testing
(types always come back as string).
2024-01-07 13:41:19 +01:00
Andreas Gohr d95846aa88 final set of API tests refactored 2024-01-07 13:41:19 +01:00
Andreas Gohr 285c73a173 More adjusted API tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 01052543c4 Adjust ACL remote component to new system
There is no need to implement getMethods anymore. All data comes from
reflection
2024-01-07 13:41:19 +01:00
Andreas Gohr 535851891f another set of api tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 1468a1289a Fix first set of API tests 2024-01-07 13:41:19 +01:00
Andreas Gohr 42e66c7a3a First go at refactoring the API mechanisms
This introduces an ApiCall class that wraps around the actual method
that produces the result. This replaces various loose array structures
that provided the meta information before.

The ApiCall streamlines the aggregation of meta information between core
and plugin methods. Now all data is produced by Reflection based
introspection. Certain aspects can be overridden if needed. See
ApiCore::getRemoteInfo() for examples

This change removes the _getMethods() method from remote plugins and
introduces a getMethods() method. The two are NOT compatible as the
latter now returns a list of ApiCalls. However when looking at the
existing plugins, it seems that _getMethods() was nearly 100% obsolete
with the Reflection based default implementation. So most plugins will
not be affected at all. Some might now export one or two more methods
than before because of poor visibility settings (eg. not declaring
private/protected methods as such).

This change removes the RPC_CALL_ADD hook. Only a single plugin ever
implemented it. I'm not sure what this hook was supposed to do anyway.
Being able to declare arbitrarily named API endpoints seems wrong to me
anyway.

The new ApiCall now also supports passing named instead of positional
parameters. This will open up a new opportunity to get a proper openapi
spec running.

Next step is fixing the tests.
2024-01-07 13:41:19 +01:00
Andreas Gohr 5ee967131b attempt to model the JSON-RPC API as openapi spec
Failed because positional parameters are not really possible to model.
Named parameter could be introduces when our minimum requirement is
switched to PHP8+
2024-01-07 13:41:19 +01:00
Andreas Gohr cd89aff0a8 fix IP tests
to accommodate the change introduced in e6d2a179db
2024-01-07 13:40:37 +01:00
Andreas Gohr e6d2a179db use private IP addresses in tests 2024-01-06 17:28:47 +01:00
Gerrit Uitslag ae43b43fd2
Merge pull request #4133 from dokuwiki-translate/lang_update_780_1704320486
Translation update (fr)
2024-01-04 07:38:22 +01:00
Schplurtz le Déboulonné 0143b6968f translation update 2024-01-03 23:26:14 +01:00
Andreas Gohr 3e0eab602e
Merge pull request #4130 from dokuwiki-translate/lang_update_775_1704278311
Translation update (pl)
2024-01-03 13:43:24 +01:00
Marek Adamski 0f7e41ab9a translation update 2024-01-03 11:41:22 +01:00
Andreas Gohr 7eae3858a7
Merge pull request #4127 from dokuwiki/logprune
automatically prune old logs
2024-01-03 09:09:42 +01:00
Andreas Gohr 5719588d0f
Merge pull request #4128 from tangdou1/patch-1
Update lang.php
2023-12-24 08:37:01 +01:00
tangdou1 ff1cfe2d0d
Update lang.php 2023-12-24 11:46:57 +08:00
Andreas Gohr df9e4a18ef automatically prune old logs
This adds a new configuration that allows to define how many logfiles
per facility should be kept. Old files are pruned daily via the task
runner.
2023-12-22 19:30:31 +01:00
Phy 11f4950ced
Merge pull request #4125 from dokuwiki-translate/lang_update_764_1702160922
Translation update (fr)
2023-12-09 20:28:47 -05:00
Schplurtz le Déboulonné 49d459669f translation update 2023-12-09 23:31:34 +01:00
Phy b6ed3fee12
Merge pull request #4124 from dokuwiki-translate/lang_update_762_1702042784
Translation update (cs)
2023-12-08 08:51:16 -05:00
Martin Růžička d277f97966 translation update 2023-12-08 14:41:22 +01:00
Andreas Gohr 5a2f35d473
Merge pull request #4123 from annda/rector-0.18.12
Upgrade rector to 0.18.12
2023-12-07 15:36:38 +01:00
Anna Dabrowska 9b944650bd Upgrade rector to 0.18.12
Two classes in DokuWiki's skip rules were removed from rector in 0.18.12
2023-12-07 12:55:15 +01:00
Phy e3f23f2b73
Merge pull request #4122 from dokuwiki-translate/lang_update_753_1701873507
Translation update (zh)
2023-12-06 10:46:42 -05:00
Zhenzhe Huang c7f1640fbb translation update 2023-12-06 15:41:54 +01:00
Phy c6c9188f76
Merge pull request #4120 from dokuwiki-translate/lang_update_748_1701748737
Translation update (vi)
2023-12-04 23:38:30 -05:00
Hoàng Vịnh c60f399943 translation update 2023-12-05 05:01:14 +01:00
Phy e991b33796
Merge pull request #4119 from dokuwiki-translate/lang_update_746_1701626636
Translation update (pl)
2023-12-03 13:27:39 -05:00
Marek Adamski 8a8ac4f085 translation update 2023-12-03 19:06:55 +01:00
Phy cc5b365cf6
Merge pull request #4118 from dokuwiki-translate/lang_update_745_1701517470
Translation update (pt-br)
2023-12-03 09:35:59 -05:00
Thalles Lázaro 6c931de5ac translation update 2023-12-02 12:46:23 +01:00
m-martin-78 c46f56cc7c
Update init_checkssl.test.php 2023-11-30 13:58:02 +01:00
m-martin-78 8033346cf8
coding style 2023-11-30 13:46:18 +01:00
Andreas Gohr 133e2f6d07
Merge pull request #4116 from dokuwiki/bot/autofix
🤖 Automatic code style fixes
2023-11-29 16:11:36 +01:00