shynet icon indicating copy to clipboard operation
shynet copied to clipboard

API Access

Open Lucasthoelke opened this issue 4 years ago • 4 comments

Is there a possibility an API could be added?

Lucasthoelke avatar May 17 '20 17:05 Lucasthoelke

It’s something I’d like to have for v1.0, but I’m not sure exactly what it would look like right now. Feel free to spec out details or submit a draft PR if you have opinions either way. For now, though, it’s not an immediate priority.

milesmcc avatar May 17 '20 19:05 milesmcc

I guess this one of the most important issues. Is there any ETA for this?

ibrahimBeladi avatar Sep 28 '21 22:09 ibrahimBeladi

No clear ETA at the moment. It's a planned feature but a lot of important architectural decisions need to be made (specifically how to deal with authentication and authorization).

milesmcc avatar Sep 29 '21 07:09 milesmcc

I think I could implement some basic API. Here is my vision:

  • add api django app
  • add ApiToken model with at least 3 fields (name, value, user)
  • add ApiTokenAdmin to Django admin
  • add api_token_required decorator and ApiTokenRequiredMixin (It will look for token in header and set user or return 401)
  • add endpoint to return Service.get_core_stats()

haaavk avatar Oct 01 '21 07:10 haaavk