Skip to content

Commit

Permalink
Add support for kerberos token based auth (#5809)
Browse files Browse the repository at this point in the history
* Add support for kerberos token based auth

* Added kerb_ticket as attribute to HDFSFileSystem

* Lint fix for config schema

* Updated black style changes

* Removed staticmethod decorator from hdfs
  • Loading branch information
naveen24691 authored Apr 17, 2021
1 parent 48890c2 commit daf0745
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dvc/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class RelPath(str):
"allow_agent": Bool,
**REMOTE_COMMON,
},
"hdfs": {"user": str, **REMOTE_COMMON},
"hdfs": {"user": str, "kerb_ticket": str, **REMOTE_COMMON},
"webhdfs": {
"hdfscli_config": str,
"webhdfs_token": str,
Expand Down
6 changes: 4 additions & 2 deletions dvc/fs/hdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ def __init__(self, repo, config):
path=parsed.path,
)

@staticmethod
def hdfs(path_info):
self.kerb_ticket = config.get("kerb_ticket")

def hdfs(self, path_info):
import pyarrow.fs

# NOTE: HadoopFileSystem is not meant to be closed by us and doesn't
Expand All @@ -100,6 +101,7 @@ def close(self):
path_info.host,
path_info.port,
user=path_info.user,
kerb_ticket=self.kerb_ticket,
)

@contextmanager
Expand Down

0 comments on commit daf0745

Please sign in to comment.