IBM / taxinomitis

Source code for Machine Learning for Kids site
https://machinelearningforkids.co.uk
Apache License 2.0
143 stars 137 forks source link

Automate creating new managed classes #5

Closed dalelane closed 4 years ago

dalelane commented 6 years ago

Managed classes are currently created manually.

This involves:

  1. Creating a new entry in the tenants DB table, with the restrictions to be applied to the new class
  2. Creating Watson Assistant and Visual Recognition service instances and service credentials in IBM Cloud
  3. Creating new entries in the bluemixcredentials DB table, to store the newly created service credentials
  4. Creating a new user in Auth0 for the teacher
  5. Email the teacher with their new username/password

Steps 1 and 3 involve running manually written SQL queries against the live production DB.

This isn’t without risk. It’s also a time-consuming process that will only get more challenging to complete if the site popularity increases.

This should be automated, with a simple web interface for performing all of these steps in one easy go. The interface should be available only to site admins.

dalelane commented 6 years ago

ignore the commit above.... in moving the repo from Github Enterprise to public Github, the issue numbers don't match up, so it refers to a closed issue from the old repo :(

dalelane commented 6 years ago
  1. Creating a new entry in the tenants DB table, with the restrictions to be applied to the new class

That will look something a little like this: https://github.com/IBM/taxinomitis/blob/0f30eed534d6fb0a97caffd3ab120e8a3df8e9ec/src/lib/db/store.ts#L1633-L1650

dalelane commented 6 years ago
  1. Creating new entries in the bluemixcredentials DB table, to store the newly created service credentials

There is already a REST endpoint that supports this: https://github.com/IBM/taxinomitis/blob/0f30eed534d6fb0a97caffd3ab120e8a3df8e9ec/src/lib/restapi/watsonapis.ts#L98-L154

However, the auth for the endpoint is set so that only teachers for a class can do this https://github.com/IBM/taxinomitis/blob/0f30eed534d6fb0a97caffd3ab120e8a3df8e9ec/src/lib/restapi/watsonapis.ts#L175-L180

This will need modifying to allow a site admin to do it.

dalelane commented 6 years ago
  1. Creating a new user in Auth0 for the teacher

Code to do this is here: https://github.com/IBM/taxinomitis/blob/0f30eed534d6fb0a97caffd3ab120e8a3df8e9ec/src/lib/auth0/users.ts#L128-L141

dalelane commented 6 years ago

So looking at the above list, we have a lot of the bits we need.

We need: