Min RK
a021f910c8
expose expire_on_commit option
...
conservative deployments may set
c.JupyterHub.db_kwargs['expire_on_commit'] = True
as an escape if the optimization is causing problems.
2018-04-23 12:54:22 +02:00
Min RK
e6c2afc4db
fix oauth lookup use of relationships
...
have to lookup orm client/user by id
client/user attributes don't exist on oauth objects, which aren't orm objects
2018-04-23 12:54:20 +02:00
Min RK
e6c7b28057
expire before re-running init_services
...
seems to be required, not sure why
2018-04-23 12:53:38 +02:00
Min RK
b1840e8be7
use relationships everywhere
...
in order to use sqlalchemy's expire_on_commit=False optimization,
we need to make sure that objects are kept up to date.
This means we cannot rely on ForeignKey ondelete/onupdate behavior,
we must use sqlalchemy's local relationship cascades
The main key here is that we must use relationships to set foreign-key relations,
e.g. APIToken.user = user instead of APIToken.user_id = user.id.
It also means that we cannot use passive_deletes,
which allows sqlalchemy to defer to the database's more efficient ON DELETE behavior.
This makes deletions more expensive in particular,
but should improve db performance overall.
2018-04-23 12:53:38 +02:00
yuvipanda
15e4b1ad8b
Don't expire objects on commit
2018-04-23 12:53:38 +02:00
Min RK
2517afcee0
Merge pull request #1800 from minrk/token-api
...
API for managing tokens
2018-04-23 12:52:34 +02:00
Min RK
15c7ba3078
Merge pull request #1788 from NERSC/options-template-variables
...
Options form template variables
2018-04-23 12:49:41 +02:00
Rollin Thomas
f2cb24781a
Pass for_user.spawner
to templating namespace
...
Give access to spawner fields from the spawner form template.
2018-04-20 08:25:13 -07:00
Min RK
e1d346b8c3
add set -e to script
...
to prevent proceeding to docs after failure
2018-04-20 15:34:52 +02:00
Min RK
97bdf4811c
update expected default token note
2018-04-20 15:34:52 +02:00
Min RK
45c871d779
add some description of API and OAuth tokens
2018-04-20 15:34:52 +02:00
Min RK
976fa9c907
update default note for API-requested tokens
2018-04-20 15:34:52 +02:00
Min RK
771c60ca37
update default token page note
2018-04-20 15:34:52 +02:00
Min RK
e15eeccd35
match oauth client description and sever token note
...
for spawner api tokens: "Server at /user/:name"
2018-04-20 15:34:52 +02:00
Min RK
ce535b55bc
Revoking one oauth token revokes all oauth tokens for that client
2018-04-20 15:34:52 +02:00
Min RK
33cb62c2ee
support revoking tokens from token page
2018-04-20 15:34:52 +02:00
Min RK
32fe3cf61d
support adding note to new tokens on token page
...
turn token request into a form
2018-04-20 15:34:52 +02:00
Min RK
73a05498ce
support new token API in jhapi.js
2018-04-20 15:34:52 +02:00
Min RK
034147f604
add token lists to token page
2018-04-20 15:34:52 +02:00
Min RK
b629e520a9
add token api to rest yaml
2018-04-20 15:34:52 +02:00
Min RK
30280cc6a4
add token.api_id
...
id key used in rest api
2018-04-20 15:34:52 +02:00
Min RK
f7f0b72776
retrieve tokens by id in REST API, not full token in URL
2018-04-20 15:34:52 +02:00
Min RK
251289fc05
add new token management to REST API
...
- list tokens
- create new tokens
- delete tokens
2018-04-20 15:34:52 +02:00
Min RK
6437093a67
add token_model method
...
for returning the model of an API or OAuth token
2018-04-20 15:34:52 +02:00
Min RK
be5a878da5
add description to oauth clients for services and user servers
2018-04-20 15:34:52 +02:00
Min RK
8dc73a852d
add oauth client description
2018-04-20 15:34:42 +02:00
Min RK
e37d82951e
Merge pull request #1814 from dhirschfeld/cookie-secret-permissions
...
Skip checking cookie secret permissions on Windows
2018-04-20 12:34:08 +02:00
dhirschf
acc311830e
Skip checking cookie secret permissions on Windows
...
The existing checks are posix specific
2018-04-19 09:47:57 +10:00
Min RK
6b1046697a
Merge pull request #1807 from rkdarst/cull_idle_unknown_times
...
cull_idle_servers.py: Fix problem when age/inactive undefined
2018-04-17 18:15:38 +02:00
Carol Willing
c5befc5b2a
Merge pull request #1810 from minrk/service-stop
...
service.stop is not async
2018-04-17 05:18:37 -07:00
Min RK
e743a5733b
add debug-logging for stopping proxy and services
2018-04-17 14:07:13 +02:00
Richard Darst
5f98801c99
cull_idle_servers.py: Don't try to delete non-running servers
...
- Only run the server handler if a server is actually running. A bug
could occur with non-named servers.
2018-04-17 13:52:13 +03:00
Richard Darst
9858a3db9d
cull_idle_servers.py: Fix problem when age/inactive undefined
...
- Sometimes the inactive or age can be undefined instead of timedelta.
Handle this case.
2018-04-17 13:51:40 +03:00
Min RK
65c1a525b9
service.stop is not async
2018-04-17 11:43:42 +02:00
Min RK
8bd055d4bd
Merge pull request #1804 from consideRatio/query-string-memory-pr
...
/user/someone-else redirection retain query strings
2018-04-16 10:11:11 +02:00
Erik Sundell
5ee14db1f9
/user/someone-else redirection retain query strings
2018-04-15 05:03:56 +02:00
Carol Willing
58069d015b
Merge pull request #1801 from minrk/cascades
...
fix and test deletion cascades
2018-04-13 13:47:27 -07:00
Carol Willing
f2684b59ec
Merge pull request #1802 from minrk/dbutil-shell
...
add `python -m jupyterhub.dbutil shell`
2018-04-13 12:54:23 -07:00
Min RK
e0c0d03c5f
define client_id in oauth token test
2018-04-13 21:52:17 +02:00
Min RK
1ac47d2bb0
consolidate stale client_id check to AccessToken.find
2018-04-13 21:49:57 +02:00
Min RK
bc75c71ca3
ensure oauth tokens with no client id aren’t accepted
...
these should have been deleted by deleting oauth clients
2018-04-13 21:42:38 +02:00
Min RK
c49fc14528
move oauth token relation to user
...
for symmetry with APIToken
2018-04-13 21:26:18 +02:00
Min RK
078bd8c627
fix and test deletion cascades
...
- ensure foreign keys are enabled on sqlite
- fix deletion cascades where relationships were causing dissociation instead of deletion
2018-04-13 21:23:58 +02:00
Min RK
33ba9fb5cf
ensure foreign keys are enabled on sqlite
2018-04-13 21:23:58 +02:00
Min RK
4e7e586cb9
add python -m jupyterhub.dbutil shell
...
allows opening an IPython shell with a connection to your database
alembic moved from `python -m jupyterhub.dbutil` to `python -m jupyterhub.dbutil alembic` subcommand
2018-04-13 21:23:36 +02:00
Min RK
62fa795052
Merge pull request #1803 from minrk/status-code-typeyo
...
typo catching 404 in proxy.delete_route
2018-04-13 21:22:54 +02:00
Min RK
b6d9f89518
typo in test_multi_groups
...
add multiple groups, not users
2018-04-13 21:01:48 +02:00
Min RK
afbf867169
typo catching 404 in proxy.delete_route
...
status code is .code, not .status_code
2018-04-13 20:54:15 +02:00
Carol Willing
dace6ac156
Merge pull request #1793 from minrk/server.port
...
check if server is defined before accessing server.port
2018-04-13 10:31:05 -07:00
Carol Willing
cbf2b8cb78
Merge pull request #1790 from minrk/409-conflict
...
raise 409 conflict on duplicate actions
2018-04-13 10:29:52 -07:00