You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Daryn Sharp (JIRA)" <ji...@apache.org> on 2019/05/03 20:26:00 UTC

[jira] [Commented] (HADOOP-16277) Expose getTokenKind method in FileSystem

    [ https://issues.apache.org/jira/browse/HADOOP-16277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16832804#comment-16832804 ] 

Daryn Sharp commented on HADOOP-16277:
--------------------------------------

I'm opposed to another api for what should be a private implementation detail – thanks [~jojochuang] for pointing that out.  Anytime a customer comes to me with custom code trying to do something with tokens I tell them to rip it all out.  Hadoop's security is supposed to be generally invisible.  If you feel the need to do explicit token manipulation then it's likely you are attacking a problem incorrectly.

Steve is referring to this api:
{code:java}
FileSystem#addDelegationTokens(String renewer, Credentials creds);{code}
I specifically added this years ago to support multi-token filesystems.  At the time it was viewfs, now it's hdfs/webhdfs+kms, internal s3+RBAC, etc.

It will only fetch tokens that it doesn't already have, so pass either an empty credentials or pass your current ugi's credentials.

> Expose getTokenKind method in FileSystem
> ----------------------------------------
>
>                 Key: HADOOP-16277
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16277
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Venkatesh Sridharan
>            Priority: Trivial
>
> It would be nice to have a getTokenKind() method exposed in [FileSystem|[https://github.com/apache/hadoop-common/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java]] . Currently WebHdfsFileSystem class has getTokenKind() which is protected. Having it in FileSystem makes it easier to use at runtime when the consumer doesn't know what the underlying FileSystem implementation is. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org