diff --git a/server/fishtest/__init__.py b/server/fishtest/__init__.py index 3fcf99ec6..7adae958f 100644 --- a/server/fishtest/__init__.py +++ b/server/fishtest/__init__.py @@ -177,5 +177,9 @@ def group_finder(username, request): config.add_route("api_actions", "/api/actions") config.add_route("api_calc_elo", "/api/calc_elo") + # GitHub OAuth Routes + config.add_route("github_oauth", "/github/oauth") + config.add_route("github_callback", "/github/callback") + config.scan() return config.make_wsgi_app() diff --git a/server/fishtest/schemas.py b/server/fishtest/schemas.py index 45ed5db4c..9a7c5ab3b 100644 --- a/server/fishtest/schemas.py +++ b/server/fishtest/schemas.py @@ -87,18 +87,25 @@ def size_is_length(x): size_is_length, ) -user_schema = { - "_id?": ObjectId, - "username": username, - "password": str, - "registration_time": datetime_utc, - "pending": bool, - "blocked": bool, - "email": email, - "groups": [str, ...], - "tests_repo": union("", url), - "machine_limit": uint, -} +user_schema = intersect( + { + "_id?": ObjectId, + "username": username, + "password?": str, + "registration_time": datetime_utc, + "pending": bool, + "blocked": bool, + "email?": email, + "github_id?": str, + "linked_github_username?": str, + "github_access_token?": str, + "groups": [str, ...], + "tests_repo?": union("", url), + "machine_limit": uint, + }, + at_least_one_of("email", "github_id"), + at_least_one_of("password", "github_access_token"), +) worker_schema = { diff --git a/server/fishtest/templates/login.mak b/server/fishtest/templates/login.mak index 7160b2922..1bcfcef1c 100644 --- a/server/fishtest/templates/login.mak +++ b/server/fishtest/templates/login.mak @@ -58,6 +58,16 @@ + +
Or
+ +