{"action":"created","comment":{"url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/comments/84995098","pull_request_review_id":5737889,"id":84995098,"diff_hunk":"@@ -124,28 +124,162 @@ c.JupyterHub.services = [\n \n ## Writing your own services\n \n-This Section Under Construction\n+When writing your own services, you have a few decisions to make (in addition to what your service does!):\n+\n+1. Does my service need a public URL?\n+2. Do I want JupyterHub to start/stop the service?\n+3. Does my service need authentication?\n+\n+When a service is managed by JupyterHub,\n+the Hub will pass the necessary information to the service via environment variables described above.\n+To make your service most flexible, you can use these same environment variables,\n+whether your service is managed by the Hub or not.\n+\n+When you run a service that has a url, it will be accessible under a `/services/` prefix, such as `https://myhub.horse/services/my-service/`.\n+For your service to route proxied requests properly, it must take `JUPYTERHUB_SERVICE_PREFIX` into account when routing requests.\n+For example, a web service would normally service its root handler at `'/'`,\n+but the proxied service would need to serve `JUPYTERHUB_SERVICE_PREFIX + '/'`.\n \n-```\n-       /\\      \n-      /  \\     \n-     / _o \\    \n-    / <(\\  \\   \n-   /   />`A \\  \n-  '----------'  \n-```\n \n ### Authenticating with the Hub\n \n-This Section Also Under Construction\n+JupyterHub 0.7 introduces some utilities for using the Hub's authentication mechanism to govern access to your service.\n+When a user logs into JupyterHub, the Hub sets a cookie (`jupyterhub-services`) that your service can use to authenticate requests.\n+\n+JupyterHub ships with a reference implementation of Hub authentication,\n+but you can read on to find details of the process if you plan to implement your own hub-authenticating clients.","path":"docs/source/services.md","position":37,"original_position":37,"commit_id":"85c040ab8e7daf152f6466fe87855208a576d522","original_commit_id":"85c040ab8e7daf152f6466fe87855208a576d522","user":{"login":"willingc","id":2680980,"avatar_url":"https://avatars.githubusercontent.com/u/2680980?v=3","gravatar_id":"","url":"https://api.github.com/users/willingc","html_url":"https://github.com/willingc","followers_url":"https://api.github.com/users/willingc/followers","following_url":"https://api.github.com/users/willingc/following{/other_user}","gists_url":"https://api.github.com/users/willingc/gists{/gist_id}","starred_url":"https://api.github.com/users/willingc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willingc/subscriptions","organizations_url":"https://api.github.com/users/willingc/orgs","repos_url":"https://api.github.com/users/willingc/repos","events_url":"https://api.github.com/users/willingc/events{/privacy}","received_events_url":"https://api.github.com/users/willingc/received_events","type":"User","site_admin":false},"body":"You may go beyond this reference implementation and create custom hub-authenticating clients and services. We describe the process in what follows.","created_at":"2016-10-25T20:36:21Z","updated_at":"2016-10-25T20:36:21Z","html_url":"https://github.com/jupyterhub/jupyterhub/pull/830#discussion_r84995098","pull_request_url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830","_links":{"self":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/comments/84995098"},"html":{"href":"https://github.com/jupyterhub/jupyterhub/pull/830#discussion_r84995098"},"pull_request":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830"}}},"pull_request":{"url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830","id":90788787,"html_url":"https://github.com/jupyterhub/jupyterhub/pull/830","diff_url":"https://github.com/jupyterhub/jupyterhub/pull/830.diff","patch_url":"https://github.com/jupyterhub/jupyterhub/pull/830.patch","issue_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/830","number":830,"state":"open","locked":false,"title":"Flesh out custom services examples","user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"body":"- add flask whoami service example, so we have one non-tornado case\n- allow HubAuthenticated to check groups\n\ncc @willingc for docs and @parente who's looking at testing out using the services auth.\n\ncloses #823","created_at":"2016-10-25T11:30:14Z","updated_at":"2016-10-25T20:36:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5aadd40306e85cf00b4dda4fcf7d5c0e2b47392","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830/commits","review_comments_url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830/comments","review_comment_url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/830/comments","statuses_url":"https://api.github.com/repos/jupyterhub/jupyterhub/statuses/85c040ab8e7daf152f6466fe87855208a576d522","head":{"label":"minrk:services-todo","ref":"services-todo","sha":"85c040ab8e7daf152f6466fe87855208a576d522","user":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"repo":{"id":21696764,"name":"jupyterhub","full_name":"minrk/jupyterhub","owner":{"login":"minrk","id":151929,"avatar_url":"https://avatars.githubusercontent.com/u/151929?v=3","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/minrk/jupyterhub","description":"Multi-user server for Jupyter notebooks","fork":true,"url":"https://api.github.com/repos/minrk/jupyterhub","forks_url":"https://api.github.com/repos/minrk/jupyterhub/forks","keys_url":"https://api.github.com/repos/minrk/jupyterhub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minrk/jupyterhub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minrk/jupyterhub/teams","hooks_url":"https://api.github.com/repos/minrk/jupyterhub/hooks","issue_events_url":"https://api.github.com/repos/minrk/jupyterhub/issues/events{/number}","events_url":"https://api.github.com/repos/minrk/jupyterhub/events","assignees_url":"https://api.github.com/repos/minrk/jupyterhub/assignees{/user}","branches_url":"https://api.github.com/repos/minrk/jupyterhub/branches{/branch}","tags_url":"https://api.github.com/repos/minrk/jupyterhub/tags","blobs_url":"https://api.github.com/repos/minrk/jupyterhub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minrk/jupyterhub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minrk/jupyterhub/git/refs{/sha}","trees_url":"https://api.github.com/repos/minrk/jupyterhub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minrk/jupyterhub/statuses/{sha}","languages_url":"https://api.github.com/repos/minrk/jupyterhub/languages","stargazers_url":"https://api.github.com/repos/minrk/jupyterhub/stargazers","contributors_url":"https://api.github.com/repos/minrk/jupyterhub/contributors","subscribers_url":"https://api.github.com/repos/minrk/jupyterhub/subscribers","subscription_url":"https://api.github.com/repos/minrk/jupyterhub/subscription","commits_url":"https://api.github.com/repos/minrk/jupyterhub/commits{/sha}","git_commits_url":"https://api.github.com/repos/minrk/jupyterhub/git/commits{/sha}","comments_url":"https://api.github.com/repos/minrk/jupyterhub/comments{/number}","issue_comment_url":"https://api.github.com/repos/minrk/jupyterhub/issues/comments{/number}","contents_url":"https://api.github.com/repos/minrk/jupyterhub/contents/{+path}","compare_url":"https://api.github.com/repos/minrk/jupyterhub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minrk/jupyterhub/merges","archive_url":"https://api.github.com/repos/minrk/jupyterhub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minrk/jupyterhub/downloads","issues_url":"https://api.github.com/repos/minrk/jupyterhub/issues{/number}","pulls_url":"https://api.github.com/repos/minrk/jupyterhub/pulls{/number}","milestones_url":"https://api.github.com/repos/minrk/jupyterhub/milestones{/number}","notifications_url":"https://api.github.com/repos/minrk/jupyterhub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minrk/jupyterhub/labels{/name}","releases_url":"https://api.github.com/repos/minrk/jupyterhub/releases{/id}","deployments_url":"https://api.github.com/repos/minrk/jupyterhub/deployments","created_at":"2014-07-10T14:17:50Z","updated_at":"2016-01-12T15:35:54Z","pushed_at":"2016-10-25T11:28:19Z","git_url":"git://github.com/minrk/jupyterhub.git","ssh_url":"git@github.com:minrk/jupyterhub.git","clone_url":"https://github.com/minrk/jupyterhub.git","svn_url":"https://github.com/minrk/jupyterhub","homepage":"","size":1677,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jupyterhub:master","ref":"master","sha":"bb8536b5534d2f46158d5e212af0fdc7e071a822","user":{"login":"jupyterhub","id":17927519,"avatar_url":"https://avatars.githubusercontent.com/u/17927519?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyterhub","html_url":"https://github.com/jupyterhub","followers_url":"https://api.github.com/users/jupyterhub/followers","following_url":"https://api.github.com/users/jupyterhub/following{/other_user}","gists_url":"https://api.github.com/users/jupyterhub/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyterhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyterhub/subscriptions","organizations_url":"https://api.github.com/users/jupyterhub/orgs","repos_url":"https://api.github.com/users/jupyterhub/repos","events_url":"https://api.github.com/users/jupyterhub/events{/privacy}","received_events_url":"https://api.github.com/users/jupyterhub/received_events","type":"Organization","site_admin":false},"repo":{"id":20785986,"name":"jupyterhub","full_name":"jupyterhub/jupyterhub","owner":{"login":"jupyterhub","id":17927519,"avatar_url":"https://avatars.githubusercontent.com/u/17927519?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyterhub","html_url":"https://github.com/jupyterhub","followers_url":"https://api.github.com/users/jupyterhub/followers","following_url":"https://api.github.com/users/jupyterhub/following{/other_user}","gists_url":"https://api.github.com/users/jupyterhub/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyterhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyterhub/subscriptions","organizations_url":"https://api.github.com/users/jupyterhub/orgs","repos_url":"https://api.github.com/users/jupyterhub/repos","events_url":"https://api.github.com/users/jupyterhub/events{/privacy}","received_events_url":"https://api.github.com/users/jupyterhub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyterhub/jupyterhub","description":"Multi-user server for Jupyter notebooks","fork":false,"url":"https://api.github.com/repos/jupyterhub/jupyterhub","forks_url":"https://api.github.com/repos/jupyterhub/jupyterhub/forks","keys_url":"https://api.github.com/repos/jupyterhub/jupyterhub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyterhub/jupyterhub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyterhub/jupyterhub/teams","hooks_url":"https://api.github.com/repos/jupyterhub/jupyterhub/hooks","issue_events_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/events{/number}","events_url":"https://api.github.com/repos/jupyterhub/jupyterhub/events","assignees_url":"https://api.github.com/repos/jupyterhub/jupyterhub/assignees{/user}","branches_url":"https://api.github.com/repos/jupyterhub/jupyterhub/branches{/branch}","tags_url":"https://api.github.com/repos/jupyterhub/jupyterhub/tags","blobs_url":"https://api.github.com/repos/jupyterhub/jupyterhub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyterhub/jupyterhub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyterhub/jupyterhub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyterhub/jupyterhub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyterhub/jupyterhub/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyterhub/jupyterhub/languages","stargazers_url":"https://api.github.com/repos/jupyterhub/jupyterhub/stargazers","contributors_url":"https://api.github.com/repos/jupyterhub/jupyterhub/contributors","subscribers_url":"https://api.github.com/repos/jupyterhub/jupyterhub/subscribers","subscription_url":"https://api.github.com/repos/jupyterhub/jupyterhub/subscription","commits_url":"https://api.github.com/repos/jupyterhub/jupyterhub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyterhub/jupyterhub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyterhub/jupyterhub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyterhub/jupyterhub/contents/{+path}","compare_url":"https://api.github.com/repos/jupyterhub/jupyterhub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyterhub/jupyterhub/merges","archive_url":"https://api.github.com/repos/jupyterhub/jupyterhub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyterhub/jupyterhub/downloads","issues_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues{/number}","pulls_url":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyterhub/jupyterhub/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyterhub/jupyterhub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyterhub/jupyterhub/labels{/name}","releases_url":"https://api.github.com/repos/jupyterhub/jupyterhub/releases{/id}","deployments_url":"https://api.github.com/repos/jupyterhub/jupyterhub/deployments","created_at":"2014-06-12T23:22:10Z","updated_at":"2016-10-24T17:24:47Z","pushed_at":"2016-10-25T11:30:14Z","git_url":"git://github.com/jupyterhub/jupyterhub.git","ssh_url":"git@github.com:jupyterhub/jupyterhub.git","clone_url":"https://github.com/jupyterhub/jupyterhub.git","svn_url":"https://github.com/jupyterhub/jupyterhub","homepage":"https://jupyterhub.readthedocs.io","size":2206,"stargazers_count":1378,"watchers_count":1378,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":300,"mirror_url":null,"open_issues_count":78,"forks":300,"open_issues":78,"watchers":1378,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830"},"html":{"href":"https://github.com/jupyterhub/jupyterhub/pull/830"},"issue":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/830"},"comments":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/830/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/pulls/830/commits"},"statuses":{"href":"https://api.github.com/repos/jupyterhub/jupyterhub/statuses/85c040ab8e7daf152f6466fe87855208a576d522"}}}}
{"actor":{"display_login":"willingc"}}