SolarArbiter / solarforecastarbiter-api

HTTP API and database schema for the Solar Forecast Arbiter
https://api.solarforecastarbiter.org
MIT License
10 stars 6 forks source link

add job user for an org #189

Closed alorenzo175 closed 4 years ago

alorenzo175 commented 4 years ago

The idea is that each org will have a number of background jobs (daily data validation, automatic report generation, automatic forecast generation in trials), and these jobs require an authenticated user. So, we create a job user (in auth0 and the db) for each org and store an encrypted refresh token in the database to be used when a scheduled job runs.

alorenzo175 commented 4 years ago

A future PR will contain a procedure to actually get the refresh token and to store/run jobs.

alorenzo175 commented 4 years ago

The motivation for having separate jobs is to allow org. admins to remove roles if they don't want certain jobs to be performed in the backend (or really for the role not to be added in the first place). For example, the forecast generation role is really only for reference and trials until we want to support reference forecasts owned by an organization other than reference.