Add support for kerberos token based auth (#5809)

* 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
This commit is contained in:
Naveen Sinha
2021-04-17 10:02:58 +03:00
committed by GitHub
parent 48890c22b7
commit daf07451f8
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ SCHEMA = {
"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,
+4 -2
View File
@@ -84,8 +84,9 @@ class HDFSFileSystem(BaseFileSystem):
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
@@ -100,6 +101,7 @@ class HDFSFileSystem(BaseFileSystem):
path_info.host,
path_info.port,
user=path_info.user,
kerb_ticket=self.kerb_ticket,
)
@contextmanager