| | | |
Offset 997, 561 lines modified | Offset 997, 14 lines modified |
997 | #·· | 997 | #·· |
998 | #··It·should·return·the·new·URL·to·redirect·to,·or·None·to·preserve·current | 998 | #··It·should·return·the·new·URL·to·redirect·to,·or·None·to·preserve·current |
999 | #··behavior. | 999 | #··behavior. |
1000 | #··Default:·None | 1000 | #··Default:·None |
1001 | #·c.JupyterHub.user_redirect_hook·=·None | 1001 | #·c.JupyterHub.user_redirect_hook·=·None |
| |
1002 | #------------------------------------------------------------------------------ | 1002 | #------------------------------------------------------------------------------ |
1003 | #·Authenticator(LoggingConfigurable)·configuration | |
1004 | #------------------------------------------------------------------------------ | |
1005 | ##·Base·class·for·implementing·an·authentication·provider·for·JupyterHub | |
| |
1006 | ##·Set·of·users·that·will·be·granted·admin·rights·on·this·JupyterHub. | |
1007 | #·· | |
1008 | #··Note: | |
1009 | #·· | |
1010 | #······As·of·JupyterHub·2.0, | |
1011 | #······full·admin·rights·should·not·be·required, | |
1012 | #······and·more·precise·permissions·can·be·managed·via·roles. | |
1013 | #·· | |
1014 | #··Caution: | |
1015 | #·· | |
1016 | #······Adding·users·to·`admin_users`·can·only·*grant*·admin·rights, | |
1017 | #······removing·a·username·from·the·admin_users·set·**DOES·NOT**·remove·admin·rights·previously·granted. | |
1018 | #·· | |
1019 | #······For·an·authoritative,·restricted·set·of·admins, | |
1020 | #······assign·explicit·membership·of·the·`admin`·*role*:: | |
1021 | #·· | |
1022 | #··········c.JupyterHub.load_roles·=·[ | |
1023 | #··············{ | |
1024 | #··················"name":·"admin", | |
1025 | #··················"users":·["admin1",·"..."], | |
1026 | #··············} | |
1027 | #··········] | |
1028 | #·· | |
1029 | #··Admin·users·can·take·every·possible·action·on·behalf·of·all·users,·for | |
1030 | #··example: | |
1031 | #·· | |
1032 | #··-·Use·the·admin·panel·to·see·list·of·users·logged·in·-·Add·/·remove·users·in | |
1033 | #··some·authenticators·-·Restart·/·halt·the·hub·-·Start·/·stop·users'·single-user | |
1034 | #··servers·-·Can·access·each·individual·users'·single-user·server | |
1035 | #·· | |
1036 | #··Admin·access·should·be·treated·the·same·way·root·access·is. | |
1037 | #·· | |
1038 | #··Defaults·to·an·empty·set,·in·which·case·no·user·has·admin·access. | |
1039 | #··Default:·set() | |
1040 | #·c.Authenticator.admin_users·=·set() | |
| |
1041 | ##·Allow·every·user·who·can·successfully·authenticate·to·access·JupyterHub. | |
1042 | #·· | |
1043 | #··False·by·default,·which·means·for·most·Authenticators,·_some_·allow-related | |
1044 | #··configuration·is·required·to·allow·users·to·log·in. | |
1045 | #·· | |
1046 | #··Authenticator·subclasses·may·override·the·default·with·e.g.:: | |
1047 | #·· | |
1048 | #······@default("allow_all") | |
1049 | #······def·_default_allow_all(self): | |
1050 | #··········#·if·_any_·auth·config·(depends·on·the·Authenticator) | |
1051 | #··········if·self.allowed_users·or·self.allowed_groups·or·self.allow_existing_users: | |
1052 | #··············return·False | |
1053 | #··········else: | |
1054 | #··············return·True | |
1055 | #·· | |
1056 | #··..·versionadded::·5.0 | |
1057 | #·· | |
1058 | #··..·versionchanged::·5.0 | |
1059 | #······Prior·to·5.0,·`allow_all`·wasn't·defined·on·its·own, | |
1060 | #······and·was·instead·implicitly·True·when·no·allow·config·was·provided, | |
1061 | #······i.e.·`allowed_users`·unspecified·or·empty·on·the·base·Authenticator·class. | |
1062 | #·· | |
1063 | #······To·preserve·pre-5.0·behavior, | |
1064 | #······set·`allow_all·=·True`·if·you·have·no·other·allow·configuration. | |
1065 | #··Default:·False | |
1066 | #·c.Authenticator.allow_all·=·False | |
| |
1067 | ##·Allow·existing·users·to·login. | |
1068 | #·· | |
1069 | #··Defaults·to·True·if·`allowed_users`·is·set·for·historical·reasons,·and·False | |
1070 | #··otherwise. | |
1071 | #·· | |
1072 | #··With·this·enabled,·all·users·present·in·the·JupyterHub·database·are·allowed·to | |
1073 | #··login.·This·has·the·effect·of·any·user·who·has·_previously_·been·allowed·to | |
1074 | #··login·via·any·means·will·continue·to·be·allowed·until·the·user·is·deleted·via | |
1075 | #··the·/hub/admin·page·or·REST·API. | |
1076 | #·· | |
1077 | #··..·warning:: | |
1078 | #·· | |
1079 | #·····Before·enabling·this·you·should·review·the·existing·users·in·the | |
1080 | #·····JupyterHub·admin·panel·at·`/hub/admin`.·You·may·find·users·existing | |
1081 | #·····there·because·they·have·previously·been·declared·in·config·such·as | |
1082 | #·····`allowed_users`·or·allowed·to·sign·in. | |
1083 | #·· | |
1084 | #··..·warning:: | |
1085 | #·· | |
1086 | #·····When·this·is·enabled·and·you·wish·to·remove·access·for·one·or·more | |
1087 | #·····users·previously·allowed,·you·must·make·sure·that·they | |
1088 | #·····are·removed·from·the·jupyterhub·database.·This·can·be·tricky·to·do | |
1089 | #·····if·you·stop·allowing·an·externally·managed·group·of·users·for·example. | |
1090 | #·· | |
1091 | #··With·this·enabled,·JupyterHub·admin·users·can·visit·`/hub/admin`·or·use | |
1092 | #··JupyterHub's·REST·API·to·add·and·remove·users·to·manage·who·can·login. | |
1093 | #·· | |
1094 | #··..·versionadded::·5.0 | |
1095 | #··Default:·False | |
1096 | #·c.Authenticator.allow_existing_users·=·False | |
| |
1097 | ##·Set·of·usernames·that·are·allowed·to·log·in. | |
1098 | #·· | |
1099 | #··Use·this·to·limit·which·authenticated·users·may·login.·Default·behavior:·only | |
1100 | #··users·in·this·set·are·allowed. | |
1101 | #·· | |
1102 | #··If·empty,·does·not·perform·any·restriction,·in·which·case·any·authenticated | |
1103 | #··user·is·allowed. | |
1104 | #·· | |
1105 | #··Authenticators·may·extend·:meth:`.Authenticator.check_allowed`·to·combine | |
1106 | #··`allowed_users`·with·other·configuration·to·either·expand·or·restrict·access. | |
1107 | #·· | |
1108 | #··..·versionchanged::·1.2 | |
1109 | #······`Authenticator.whitelist`·renamed·to·`allowed_users` | |
1110 | #··Default:·set() | |
1111 | #·c.Authenticator.allowed_users·=·set() | |
| |
1112 | ##·Is·there·any·allow·config? | |
1113 | #·· | |
1114 | #··········Used·to·show·a·warning·if·it·looks·like·nobody·can·access·the·Hub, | |
1115 | #··········which·can·happen·when·upgrading·to·JupyterHub·5, | |
1116 | #··········now·that·`allow_all`·defaults·to·False. | |
1117 | #·· | |
Max diff block lines reached; 30525/50527 bytes (60.41%) of diff not shown.
|