Add a REST-like API to webservice
Add a REST-like API to webservice
Link issues together to show that they're related. Learn more.
Activity
- Côme Chilliet changed milestone to %FusionDirectory 1.4
changed milestone to %FusionDirectory 1.4
- Côme Chilliet added plugin-webservice label
added plugin-webservice label
- Author Reporter
We need to look into what is commonly used for auth on REST APIs.
Basic ideas regarding the API itself once logged in:
-
/objects/<type>
-
GET: list objects of
<type>
- POST: create an object
-
GET: list objects of
-
/objects/<type>/<dn>
- GET: Get an objects fields from main tab
- PATCH: Update an object fields values
- DELETE: Delete the object
-
/objects/<type>/<dn>/<tab>
- GET: Get an objects fields from a tab
- PATCH: Update an object tab fields values
- DELETE: Deactivate the tab
-
/objects/<type>/<dn>/<tab>/<field>
- GET: Get a field value(s)
- PUT: Replace value(s) of the field
- DELETE: Reset the field to its default value
-
/objects/<type>/<dn>/<tab>/<field>/values
- PATCH: Add values to multivaluated field
- DELETE: Remove values from multivaluated field
-
/search
- GET/POST: Complex search, possibly of several types
-
/user/<dn>/lock
- GET/POST: Get/Set lock status?
-
/types
- GET: List types
-
/types/<type>
- GET: Get type info
I think the login process should involve specifying which API version we want, so that future updates are possible.
Edited by Côme Chilliet -
- Côme Chilliet added 3h 30m of time spent at 2019-02-26
added 3h 30m of time spent at 2019-02-26
- Côme Chilliet mentioned in commit add41c1d
mentioned in commit add41c1d
- Côme Chilliet mentioned in commit 91f80b69
mentioned in commit 91f80b69
- Author Reporter
New files:
- webservice/include/webservice/class_fdRPCService.inc
- webservice/html/rest.php
- webservice/html/openapi.yaml
- Côme Chilliet added packaging label
added packaging label
- Côme Chilliet added 7h of time spent at 2019-02-28
added 7h of time spent at 2019-02-28
- Côme Chilliet added 5h of time spent at 2019-02-28
added 5h of time spent at 2019-02-28
- Côme Chilliet mentioned in commit aac9f713
mentioned in commit aac9f713
- Côme Chilliet mentioned in commit 7b78fce5
mentioned in commit 7b78fce5
- bmortier added user-manual label
added user-manual label
- Author Reporter
This should now all be possible:
- have webservice call to update images in user profile (binary case)
PUT /objects/user/<dn>/user/jpegPhoto
with as body the image content, base64 encoded in a json string. - have webservice call to create/update supannrefid (multivaluated case)
PUT /objects/user/<dn>/supannAccount/supannRefId
with as body the list of all wanted values (json-encoded)
POST /objects/user/<dn>/supannAccount/supannRefId
with as body the list of values to add to existing ones (json-encoded)
DELETE /objects/user/<dn>/supannAccount/supannRefId
with as body the list of values to remove from existing ones (json-encoded) - have webservice call to use template at user creation
POST /objects/user
with as body a JSON objects with two fields:
attrs: contains field values, grouped by tab.
template: contains the dn of the template to use, if any.
Example in our test: https://gitlab.fusiondirectory.org/automated-testing/automated-testing/blob/1.4-dev/plugins/webservice/webserviceRestTest.php#L54
Edited by Côme Chilliet - have webservice call to update images in user profile (binary case)
- Please register or sign in to reply