Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HiveServer Credential Provider #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions yarnspawner/spawner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import skein
from jupyterhub.spawner import Spawner
from jupyterhub.traitlets import Command, ByteSpecification
from traitlets import Unicode, Dict, Integer
from traitlets import Unicode, Dict, Integer, List
from tornado import gen


Expand Down Expand Up @@ -131,6 +131,22 @@ class YarnSpawner(Spawner):
config=True,
)

credential_providers = List(
[],
help="""
Collection of systems for which to collect the kerberos delegation token.
It is a list of tuples. Each tuple has 3 elements: (``system-name``, ``sistem-uri``, ``system-principal``).
Example:
.. code::
c.YarnSpawner.credential_providers = [{
'name':'hive',
'uri':'hive2://127.0.0.1:10000/myDatabase',
'principal':'hive/[email protected]'
}]
""",
config=True,
)

# A cache of clients by (principal, keytab). In most cases this will only
# be a single client. These should persist for the lifetime of jupyterhub.
clients = {}
Expand Down Expand Up @@ -183,7 +199,8 @@ def _build_specification(self):
name='jupyterhub',
queue=self.queue,
user=self.user.name,
master=master
master=master,
credential_providers=self.credential_providers
)

def load_state(self, state):
Expand Down