GlobaLeaks icon indicating copy to clipboard operation
GlobaLeaks copied to clipboard

Admin API globaleaks

Open gonzalob-ogovsystem opened this issue 2 years ago • 9 comments

Hi, is there a way to interact with admin interface via API, like creating new sites, new users or modify network settings.

Thanks for your time. Best regards

gonzalob-ogovsystem avatar Oct 07 '22 11:10 gonzalob-ogovsystem

Thank you for your question.

The GlobaLeaks backend implements a REST API that is intended to become standard and enable such us cases but unfortunately at the moment we miss proper public documentation.

Techically speaking it does already enable to do everything that the web application does because the web application use that for interacting with the server.

evilaliv3 avatar Oct 07 '22 11:10 evilaliv3

Hi, Regarding the REST API it is possible to have the YAML file for the documentation of the API? Thanks for your time. Best regards

fpandolfi64 avatar May 02 '23 14:05 fpandolfi64

Thank you for your question @fpandolfi64

At the moment unfortunately for the API we have still not a formal documentation. Do you have experience with such an activity? Is there any open source that you would advise to use?

evilaliv3 avatar May 02 '23 15:05 evilaliv3

I know it's an old topic, but I'm also intressted in an API Documentation. I can recommend f.ex. swagger for this task. it could create perfect API Docs.

NerdySoftPaw avatar Jun 26 '23 09:06 NerdySoftPaw

Thank you @KevKugler for the suggestion.

Would you please share a link of reference? Unfortunately the current API interface is designed manually because twisted do not have a native rest support but maybe it wont be difficult to write a component that at least generate a skeleton of documentation.

Do you have any experience on this kind of work?

evilaliv3 avatar Jun 26 '23 09:06 evilaliv3

you're welcome @evilaliv3,

https://swagger.io/tools/swagger-codegen/ with this you can easily generate a documentation it has a lot of integrations.

NerdySoftPaw avatar Jun 26 '23 13:06 NerdySoftPaw

Hi, I know it's an old topic,

I've tried to read the sources and seems that to authenticate an admin using REST API I've to use

/api/auth/authentication

method passing tid (tenant id), username, password and authcode (empty string "") params.

When I try to call the method using POST the backend response is always:

InternalServerError [Invalid request: No token and no session].

Is that the correct method to authenticate and admin using the REST API ?

Any suggestions ?

Many thanks in advance...

giates avatar Oct 30 '23 17:10 giates

Thank you for your question

The current API is for internal use and have unfortunately no bandwidth to follow-up on this topic.

In the future at the first opportunity we will try to implement a simplified API token.

evilaliv3 avatar Oct 30 '23 17:10 evilaliv3

Many thanks Giovanni, hope this happens ASAP, have a nice day...

giates avatar Oct 30 '23 19:10 giates