Commit Graph

198 Commits

Author SHA1 Message Date
Min RK
5e55753baa various cleanup to get most tests passing (yay!) 2017-05-04 12:16:47 +02:00
Min RK
66cb630b86 separate OAuth access tokens from API tokens
OAuth access tokens can only be used to identify users, not perform actions on their behalf, which API tokens do.

Implementing OAuth scopes would allow us to achieve this limitation without separating the two items, but that would be a much bigger change, including having an OAuth "Would you like to grant permissions..." confirmation page.
2017-04-21 14:52:07 +02:00
Christian Barra
76b589bc90 fix named_servers, change server.base_url 2017-04-15 03:47:09 +03:00
Min RK
e866651f96 update admin access deprecation message 2017-04-06 11:59:31 +02:00
Min RK
4bb8e47f3b implement admin-access with OAuth 2017-03-30 19:15:43 +02:00
Min RK
52b9060415 remove debug-print in self handler 2017-03-30 16:35:50 +02:00
Min RK
d0eb4e0946 add /api/user handler for identifying the requester 2017-03-28 16:19:56 +02:00
Christian Barra
2294dc0ad9 from multiservers to namedservers 2017-03-03 03:42:24 +01:00
Christian Barra
746912cece fix *args and **kwargs 2017-02-24 00:37:41 +01:00
Christian Barra
4fdf405d77 add JupyterHub.allow_multiple_servers 2017-02-24 00:37:41 +01:00
Christian Barra
a85bc5cad4 change classes for creating/deleting a server, add server_name param for delete method 2017-02-24 00:09:48 +01:00
Christian Barra
3808067dd7 better docs 2017-01-19 10:57:18 +01:00
Christian Barra
e96e0acc9f more pythonic 2017-01-19 03:05:28 +01:00
Christian Barra
7284ef6e06 change from username to name 2017-01-19 02:35:42 +01:00
Christian Barra
f5dc3ad753 fix to have unique username value 2017-01-19 02:30:04 +01:00
Christian Barra
fc0d0031bf typo correct 2017-01-16 17:03:47 +01:00
Christian Barra
b0b13bfcb9 fix AttributeError when a service ask for a cookie 2017-01-14 05:48:07 +01:00
Min RK
7528fb7d9b notice dead servers more often
call poll_and_notify to ensure triggering of dead-server events in a few places:

- `/hub/home` page view
- user start and stop API endpoints

This should avoid the failure to stop a server that's died uncleanly because the server hasn't noticed yet
2016-05-04 11:07:28 +02:00
Min RK
195eea55f3 log.warning 2016-03-29 09:22:32 -07:00
Min RK
aa93384f47 Include system-user creation error message in API reply
when system-user creation fails
2016-01-13 14:02:50 +01:00
Min RK
9441fa37c5 validate usernames
via Authenticator.validate_username

base class configurable with Authenticator.username_pattern
2016-01-13 14:02:50 +01:00
Min RK
887fdaf9d3 add username normalization
Handlers call `get_authenticated_user`, which in turn calls

- authenticate
- normalize_username
- check_whitelist

get_authenticated_user shouldn't need to be overridden.

Normalization can be handled via overriding normalize_username.
2016-01-13 14:02:50 +01:00
Min RK
4534bea86e delete users via UserDict API
avoids reusing user IDs when user creation fails
2016-01-06 15:14:28 +01:00
Min RK
ba634354dd Add Spawner form
If Spawner.options_form is specified, a form providing input controls is shown to the user prior to launch.

Spawners access the result via the `self.user_options` dict.

The default spawners offer no form.
2015-12-30 13:55:01 +01:00
Min RK
6f128758db move non-persisted User objects (spawner-related) off of orm.User
adds higher level User object, which handles spawning.
This object has running, spawner, etc. attributes.
2015-11-30 14:05:00 +01:00
Jessica B. Hamrick
ea5bfa9999 Unset all login cookies 2015-08-21 19:24:44 -07:00
Min RK
4d73f4eedb note that admin is a single value 2015-05-06 15:35:23 -07:00
Min RK
612cc73c3c skip existing users on bulk user creation
rather than aborting if any already exist

if no users are to be created, throw 400
2015-05-06 15:24:34 -07:00
Min RK
c9d02382e3 fixup 2015-05-06 15:14:08 -07:00
Min RK
546d86e888 allow creating multiple users with one API request 2015-05-06 14:01:31 -07:00
Min RK
c467c64e01 move user_model handling to base APIHandler 2015-05-01 13:41:08 -07:00
Min RK
5f1abf4461 check user.running in delete handler
missed a spot in #147
2015-02-19 20:36:02 +01:00
Min RK
edfb39c74c Merge pull request #148 from minrk/poke-proxy-api
add proxy API
2015-02-08 10:24:42 -08:00
Min RK
c82903b85e add 'pending' to user REST model 2015-02-08 10:19:48 -08:00
Min RK
4fd58b2bf2 add proxy API
- GET fetches proxy table (relays same request to proxy's API endpoint)
- POST prods routing table sync (useful when proxy restarts)
- PATCH allows updating the proxy API location, auth token
2015-02-06 17:06:41 -08:00
Min RK
b5eda9d785 add User.running
as the one true way to check whether a user is running or not

User.running will be True if spawn or stop is pending.
2015-02-06 15:42:57 -08:00
Min RK
f2b818e685 Merge pull request #132 from minrk/admin-access
add JupyterHub.admin_access
2015-01-31 16:48:32 -08:00
Min RK
09d9efb44c handle Spawners that are slow to stop
e.g. docker, which can take a long time to stop,
especially if several docker actions are already queued.

Use status `202: Accepted` for API replies sent with spawn/stop still pending
2015-01-28 11:35:38 -08:00
Min RK
6b9f73ba1f add JupyterHub.admin_access
optionally allow admin users to login to user servers by visiting a special admin-only URL that sets the relevant cookie

- disabled by default
- an 'access server' button is added to the admin panel, which sets the necessary cookie to log in to the user server
2015-01-27 17:04:30 -08:00
Min RK
d657d42c9a allow some auth methods to be async
- add_user
- add_system_user
- system_user_exists
- delete_user
2015-01-12 16:26:37 -08:00
Min RK
e066ac1863 add last_activity to user API model 2015-01-06 15:41:41 -08:00
Min RK
40a99e61ac drop support for old Python, IPython < 3
Require IPython >= 3.0, Python >= 3.3
2014-11-02 15:51:06 -08:00
MinRK
e2f12f7071 raise 400 when failing to create users 2014-09-25 14:49:06 -07:00
MinRK
1a29328d06 Add Authenticator.add_user hook
and .delete_user

This hook can be used to trigger events,
such as user validation, or creating of system users.

Adds a LocalAuthenticator class that implements
checking for and rudimentary creation of system users.
2014-09-24 21:51:25 -07:00
MinRK
485ddd039c check if spawners are running before starting new ones 2014-09-21 22:44:51 -07:00
MinRK
294fa8ceb6 add/remove users from whitelist when adding/deleting 2014-09-15 01:21:01 -07:00
MinRK
0a8759b0a5 flesh out REST API
can now list/view/add/create/modify users
and start/stop single-user servers
2014-09-14 16:47:09 -07:00
MinRK
833835b0f3 add user list handler, first of many 2014-09-14 11:54:37 -07:00