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
+12
View File
@@ -14,6 +14,15 @@ server:
server_timing_headers: false
csp_directives: null
authentication:
# The authentication types may be "none" or "session"
# none: No authentication support, features like user_annotations must not be enabled.
# session: A session based userid is automatically generated.
type: session
# a dictionary of parameters that may be required for an authentication type
params: null
multi_dataset:
# If dataroot is set, then cellxgene may serve multiple datasets. This parameter is not
# compatible with single_dataset/datapath.
@@ -132,6 +141,9 @@ dataset:
about_legal_tos: null
about_legal_privacy: null
# allow authentication support
authentication_enable: true
presentation:
max_categories: 1000
custom_colors: true