openwisp-controller
openwisp-controller copied to clipboard
undocumented endpoints and swagger API access
i was going through the openwisp-config script and found out that the core endpoints, such as download-configuration: https://github.com/openwisp/openwisp-config/blob/master/openwisp-config/files/openwisp.agent#L920 are undocumented on the openwisp-controller doc. indeed it seems the controller doc is actually using a different API spec: https://github.com/openwisp/openwisp-controller/tree/1.0#download-device-configuration since the config endpoints are flagged as legacy in the code: https://github.com/openwisp/openwisp-controller/blob/master/openwisp_controller/config/utils.py#L153
why is there a discrepancy between the 2 APIs and how could one access the API documentation currently in use by the controller to serve openwisp-config clients?
also: is there an online version of the swagger API available via the demo: https://openwisp.org/demo.html ?
also, it seems that some endpoints, such as "checksum" are undocumented in this repo. where to find those ?
The logic is here: https://github.com/openwisp/openwisp-controller/blob/master/openwisp_controller/config/utils.py#L113-L180 https://github.com/openwisp/openwisp-controller/tree/master/openwisp_controller/config/controller
It's been developed before django-rest-framework and swagger were integrated, it's not REST API but some HTTP endpoints designed specifically for the OpenWrt agent, which retain some logic which was previosuly built in ruby on rails (2008-2016).
ok, are you planning to release a new version of the agent to adapt to the new API or is it not planned yet?
t's been developed before django-rest-framework and swagger were integrated, it's not REST API but some HTTP endpoints designed specifically for the OpenWrt agent, which retain some logic which was previosuly built in ruby on rails (2008-2016).
i understand that this API is therefore undocumented right ? is there any hint of what needs to be bundled in the configuration compressed folder ?
ok, are you planning to release a new version of the agent to adapt to the new API or is it not planned yet?
It's been working well enough so far so if it's not broken we shouldn't fix it. In the future we may look at impementing something more performant and scalable but we need to secure funding beause it requires months of work.
t's been developed before django-rest-framework and swagger were integrated, it's not REST API but some HTTP endpoints designed specifically for the OpenWrt agent, which retain some logic which was previosuly built in ruby on rails (2008-2016).
i understand that this API is therefore undocumented right ? is there any hint of what needs to be bundled in the configuration compressed folder ?
Yes, it's not documented because it's not supposed to be used by humans. Developers wanting to use these endpoints are expected to be able to read the code. I don't understand the question, if you could be more specific I can try to help.