Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

API Authorization #217

Closed
7 tasks done
amercader opened this issue May 16, 2017 · 0 comments · Fixed by #242
Closed
7 tasks done

API Authorization #217

amercader opened this issue May 16, 2017 · 0 comments · Fixed by #242
Assignees

Comments

@amercader
Copy link
Member

amercader commented May 16, 2017

On top of #166 we need to implement some form of authorization.

I think that the best approach will be to implement API tokens. Goals are:

  • Be able to authenticate calls being done to the API, specially POST calls to create sources, jobs. All these need to be linked to an actual user in the system
  • Be able to mark sources are private so reports are not visible by default

For a first simple implementation we could go for:

  • One token per user (if it really makes things easier, but at least on the backend it might be really easy to support multiple ones per user)
  • Token needs to be able to be revoked / regenerated
  • All API sources / reports are public

Tasks:

  • Changes in user model to store API token(s).
  • Methods to create / update / delete tokens
  • Check authorization on API blueprint endpoints based on incoming Authorization header. We can use flask-login for this.
  • Show user token on settings page (New tab on "Manage sources"?)

Second stage

  • Sources created have a public param that defaults to True, but that can be set on creation time to False (or on update)
  • Users can have multiple tokens. Tokens can have a descriptor to help identify them.
  • Changes in model to store n tokens
  • Check authorization on API source pages / reports to see if the source is private or not - MOVED Sources support in job API #166
  • UI for handling multiple tokens
@amercader amercader added this to the Gamma milestone May 16, 2017
@amercader amercader self-assigned this May 17, 2017
@amercader amercader assigned roll and unassigned amercader May 26, 2017
This was referenced Jun 7, 2017
@roll roll closed this as completed in #242 Jun 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants