Min RK
d66a4af79b
service.stop is a coroutine
...
fixes waiting for services to stop on shutdown
2018-04-26 14:29:50 +02:00
Min RK
6f1ba77608
Merge pull request #1813 from rkdarst/api_server_state
...
add server.state to server model if requester is an admin
2018-04-26 10:33:22 +02:00
Richard Darst
2344d696ca
API: pass 'server_state' through to admin clients only
...
- This will allow, for example, cull_idle_servers to be more
intelligent when culling servers.
- This is only given to admin API users, because we don't know if all
spawners expect their state to be made available to users.
2018-04-24 16:52:18 +03:00
Min RK
bd816310cb
Merge pull request #1817 from minrk/server-model
...
Always include server sub-models in user api requests
2018-04-24 14:12:58 +02:00
Min RK
82a04f7032
Merge pull request #1823 from willingc/test-time
...
Add a pytest ini file for running marked tests and edit testing mock files
2018-04-24 11:38:57 +02:00
Min RK
4281babee4
make server-model inclusion opt-in
...
so only certain API endpoints include server info:
- user list
- get named user
The rest exclude running servers
2018-04-24 11:35:51 +02:00
Min RK
d89f2965cf
handle updated server models in culler
...
- servers sub-models model always defined in 0.9
- explicit 'ready' key added, use user.url fallback only when needed
2018-04-24 11:35:15 +02:00
Min RK
e2a2a9903a
spawner.pending is None when nothing is pending
...
rather than False, which is a bit less convenient since we turn it to None in APIs anyway
2018-04-24 11:35:15 +02:00
Min RK
4401cdc16a
Always have .servers
model on users
...
rather than only when named_servers is enabled.
Put new-in-0.9 state there, rather than continuing to add server fields to top-level user model.
2018-04-24 11:35:15 +02:00
Carol Willing
e8d3fb2920
Document the mock service and mock single user servers
2018-04-23 17:38:02 -07:00
Carol Willing
f7ccc137ea
add comments to header docstring
2018-04-23 17:06:44 -07:00
Carol Willing
07bbb4ea02
add comments to test file header docstring
2018-04-23 17:06:15 -07:00
Carol Willing
b189e70c9b
add a minimal ini file for pytest
2018-04-23 15:31:34 -07:00
Carol Willing
de4c9c1463
mark some api tests as slow
2018-04-23 15:31:00 -07:00
Carol Willing
8bdb73ced4
Merge pull request #1809 from minrk/no-expire-again
...
don't expire objects on commit
2018-04-23 09:26:57 -07:00
Min RK
453e119808
don't bypass spawner.server to delete server
...
this shouldn't happen, it's just breaking things
2018-04-23 12:54:22 +02:00
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