edina / nbexchange

External exchange for nbgrader
Other
6 stars 2 forks source link

Create a test for a simple auth plugin #1

Open BertR opened 4 years ago

BertR commented 4 years ago

Example configuration to test with:


from nbexchange.handlers.abc.user_handler import UserHandler

class MyUserHandler(UserHandler):

    def get_current_user(self, request):
        return {
          "name": "myname",
          "course_id": "cool_course_id",
          "course_title": "cool course",
          "course_role": "Student",
          "org_id": 1,
    }

c.NbExchange.user_plugin_class = MyUserHandler
perllaghu commented 4 years ago

This has been added to the documentation