Add basic authentication in the server (#1670)

* Add basic authentication in the server

A pattern for creating authentication methods is introduced, with three
authentication types defined:
  none - no authentication
  session - like the current session based auth used for user annotations
  test - used to test the login/logout process end to end

The config endpoint now returns informations about the authentication, like if
the user is authenticated and their username.  The redirect uri's for login and
logout are also returned if the authentication type requires login

This is the first a several PRs for authentication.

*. Update server tests to avoid hardcoded ports

test_api and test_nan_rest now use a common function for starting a test server,
than will initially choose a random port.
This commit is contained in:
bmccandless
2020-07-28 13:28:30 -07:00
committed by GitHub
parent bbef27b8c9
commit 5285556415
14 changed files with 498 additions and 132 deletions
+5
View File
@@ -28,6 +28,11 @@ class DataAdaptor(metaclass=ABCMeta):
# parameters set by this data adaptor based on the data.
self.parameters = {}
self.uri_path = None
def set_uri_path(self, path):
# uri path to the dataset, e.g. /d/<datasetname>
self.uri_path = path
@staticmethod
@abstractmethod