46 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Jun Pataleta
9dcffb4a93
MDL-76723 core_external: Handle format properties properly
- If a text format property defines the 'optional' attribute as true,
then the $required parameter that
is passed to \core\external\exporter::get_format_structure() should be
VALUE_OPTIONAL.
- If a default value is provided for a format property,
\core\external\exporter::get_format_structure() should pass the default
value to the external_format_value constructor.
- Added validation for external_format_value for the default parameter.
  Debugging will be shown in case an invalid default value is passed.
- Amended unit tests for better coverage.
2023-12-19 15:48:07 +08:00
Mihail Geshoski
8958667c9a MDL-78294 core_external: Generate the file url based on the request
The file url for each returned area file in get_area_files() is now
generated based on the request type. If AJAX request, a standard file
plugin url will be created. Otherwise, a webservice plugin file will be
created.
2023-11-24 15:57:18 +08:00
Mihail Geshoski
5f10f82301 MDL-78294 core_external: New return value 'icon' in external_files
New return value 'icon' has been added to the webservice structure
external_files. This return value represents the relative icon path
for a given file. Also, get_area_files() from the core external utility
class now includes this information in its return.
2023-11-24 15:02:20 +08:00
Andrew Nicols
9f676d6cb3
Merge branch 'MDL-78917' of https://github.com/paulholden/moodle 2023-09-08 22:14:28 +08:00
Paul Holden
6e9e73aba0
MDL-79205 webservice: gracefully handle invalid functions in docs. 2023-09-05 08:51:51 +01:00
Paul Holden
17dae8a036
MDL-78917 webservice: extra data in exception for missing classpath.
Include the external function classname & methodname properties in
the thrown exception, to aid diagnostic.
2023-08-31 14:15:17 +01:00
Ilya Tregubov
ab6dc892e4
Merge branch 'MDL-76656-master' of https://github.com/meirzamoodle/moodle 2023-06-28 18:08:21 +08:00
meirzamoodle
f69a420be1 MDL-76656 webservice: generated token can only read once
Generated tokens should only read once.
Therefore removing the token column at the table view of the manage tokens page and the user's page.
The token should not be able to search.
2023-06-28 09:27:31 +07:00
Andrew Nicols
ee9144cadb
MDL-78192 external: Fix typo in constant name 2023-06-24 21:57:04 +08:00
Petr Skoda
16729b7f02 MDL-78192 external: allow nullable non-scalar params and results 2023-06-23 11:12:08 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Petr Skoda
176191dab5 MDL-74936 core: tidy up context API 2023-03-31 23:09:39 +02:00
Andrew Nicols
8aa7812ff8 MDL-75085 external: Whitespace fix 2023-02-02 12:38:46 +08:00
Jun Pataleta
60fe64d786 MDL-75085 core_external: Validate $required param
Make sure that the $required param for external_description and its
subclasses are either VALUE_DEFAULT, VALUE_REQUIRED, or VALUE_OPTIONAL.
2023-02-02 09:13:43 +08:00
Andrew Nicols
c435f5d95b MDL-76583 core_external: Update service management functions 2023-01-19 07:33:47 +08:00
Andrew Nicols
47814221e5 MDL-76583 core_external: Update util string formatting functions 2023-01-19 07:33:47 +08:00
Andrew Nicols
d5d4ff8986 MDL-76583 core_external: Update token functions 2023-01-19 07:33:47 +08:00
Andrew Nicols
7a4f57cbfa MDL-76583 core_external: util class coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
93d0f2f2c1 MDL-76583 core_external: external_files coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
be1c3877c5 MDL-76583 core_external: external_value coding style fixes 2023-01-19 07:33:47 +08:00
Andrew Nicols
1125fa94f6 MDL-76583 core_external: external_format_value coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
b46a72c1aa MDL-76583 core_external: external_single_structure coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
135fae604c MDL-76583 core_external: external_multiple_structure coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
8e336beac3 MDL-76583 core_external: external_function_params coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
59c9577912 MDL-76583 core_external: external_warnings coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
ca7305f0c6 MDL-76583 core_external: external_description coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
8bc2011d3d MDL-76583 core_external: external settings coding style fixes 2023-01-19 07:33:46 +08:00
Andrew Nicols
c978cd8cc3 MDL-76583 core_external: core_external\external_api coding style fixes 2023-01-19 07:33:38 +08:00
Andrew Nicols
fa676b4776 MDL-76583 core_external: Implement Privacy API for core_external
AMOS BEGIN
 MOV [privacy:metadata:serviceusers,core_webservice],[privacy:metadata:serviceusers,core_external]
 MOV [privacy:metadata:serviceusers:iprestriction,core_webservice],[privacy:metadata:serviceusers:iprestriction,core_external]
 MOV [privacy:metadata:serviceusers:timecreated,core_webservice],[privacy:metadata:serviceusers:timecreated,core_external]
 MOV [privacy:metadata:serviceusers:userid,core_webservice],[privacy:metadata:serviceusers:userid,core_external]
 MOV [privacy:metadata:serviceusers:validuntil,core_webservice],[privacy:metadata:serviceusers:validuntil,core_external]
 MOV [privacy:metadata:tokens,core_webservice],[privacy:metadata:tokens,core_external]
 MOV [privacy:metadata:tokens:creatorid,core_webservice],[privacy:metadata:tokens:creatorid,core_external]
 MOV [privacy:metadata:tokens:iprestriction,core_webservice],[privacy:metadata:tokens:iprestriction,core_external]
 MOV [privacy:metadata:tokens:lastaccess,core_webservice],[privacy:metadata:tokens:lastaccess,core_external]
 MOV [privacy:metadata:tokens:privatetoken,core_webservice],[privacy:metadata:tokens:privatetoken,core_external]
 MOV [privacy:metadata:tokens:timecreated,core_webservice],[privacy:metadata:tokens:timecreated,core_external]
 MOV [privacy:metadata:tokens:token,core_webservice],[privacy:metadata:tokens:token,core_external]
 MOV [privacy:metadata:tokens:tokentype,core_webservice],[privacy:metadata:tokens:tokentype,core_external]
 MOV [privacy:metadata:tokens:userid,core_webservice],[privacy:metadata:tokens:userid,core_external]
 MOV [privacy:metadata:tokens:validuntil,core_webservice],[privacy:metadata:tokens:validuntil,core_external]
 MOV [privacy:request:notexportedsecurity,core_webservice],[privacy:request:notexportedsecurity,core_external]
AMOS END
2023-01-19 07:33:35 +08:00
Andrew Nicols
0392551bcb MDL-76583 core_external: Migrate service management to util 2023-01-19 07:33:35 +08:00
Andrew Nicols
caddb452f0 MDL-76583 core_external: Migrate string formatting functions to util 2023-01-19 07:33:35 +08:00
Andrew Nicols
7f5fb6a592 MDL-76583 core_external: Migrate token functions class 2023-01-19 07:33:35 +08:00
Andrew Nicols
3f8fdc8e33 MDL-76583 core_external: Move settings test and update 2023-01-19 07:33:35 +08:00
Andrew Nicols
ecbb31b160 MDL-76583 core_external: Migrate external_settings class 2023-01-19 07:33:35 +08:00
Andrew Nicols
e460e2e43f MDL-76583 core_external: Migrate external_format_value class 2023-01-19 07:33:35 +08:00
Andrew Nicols
780ba1333b MDL-76583 core_external: Migrate external_warnings class 2023-01-19 07:33:35 +08:00
Andrew Nicols
c42831cec6 MDL-76583 core_external: Migrate external_files class 2023-01-19 07:33:35 +08:00
Andrew Nicols
ebbf342127 MDL-76583 core_external: Migrate external_util class 2023-01-19 07:33:35 +08:00
Andrew Nicols
fff2c7420f MDL-76583 core_external: Migrate restricted_context_exception class 2023-01-19 07:33:35 +08:00
Andrew Nicols
698f06edeb MDL-76583 core_external: Migrate external_function_parameters class 2023-01-19 07:33:35 +08:00
Andrew Nicols
279ae4d5b3 MDL-76583 core_external: Migrate external_multiple_structure class 2023-01-19 07:33:35 +08:00
Andrew Nicols
967bed2954 MDL-76583 core_external: Migrate external_single_structure class 2023-01-19 07:33:34 +08:00
Andrew Nicols
61d59eaa11 MDL-76583 core_external: Migrate external_value class 2023-01-19 07:33:34 +08:00
Andrew Nicols
6f185f1873 MDL-76583 core_external: Migrate external_description class 2023-01-19 07:33:34 +08:00
Andrew Nicols
56bcaf409f MDL-76583 core_external: Migrate external_api to core_external\external_api 2023-01-19 07:33:18 +08:00