Skip to content

KAFKA-6447: Add Delegation Token Operations to KafkaAdminClient (KIP-249)#4427

Merged
junrao merged 4 commits intoapache:trunkfrom
omkreddy:KAFKA-6447
Apr 11, 2018
Merged

KAFKA-6447: Add Delegation Token Operations to KafkaAdminClient (KIP-249)#4427
junrao merged 4 commits intoapache:trunkfrom
omkreddy:KAFKA-6447

Conversation

@omkreddy
Copy link
Copy Markdown
Contributor

  • Update unit and integration tests

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@omkreddy omkreddy changed the title [WIP] KAFKA-6447: Add Delegation Token Operations to KafkaAdminClient (KIP-249) KAFKA-6447: Add Delegation Token Operations to KafkaAdminClient (KIP-249) Jan 23, 2018
@omkreddy
Copy link
Copy Markdown
Contributor Author

retest this please

@omkreddy
Copy link
Copy Markdown
Contributor Author

omkreddy commented Jan 25, 2018

@hachikuji @ijuma @rajinisivaram sorry for bothering you. Pl take a look at
https://cwiki.apache.org/confluence/display/KAFKA/KIP-249%3A+Add+Delegation+Token+Operations+to+KafkaAdminClient
Appreciate your comments and votes on KIP thread.

@omkreddy omkreddy force-pushed the KAFKA-6447 branch 3 times, most recently from e6eb95d to 09ffd41 Compare April 4, 2018 05:54
@omkreddy
Copy link
Copy Markdown
Contributor Author

omkreddy commented Apr 4, 2018

@junrao @rajinisivaram please take a look when you get a chance. Thanks.

Copy link
Copy Markdown
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omkreddy : Thanks for the patch. Left a few comments below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 => -1L ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to document that if owners is null, all delegation tokens will be returned?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since DelegationToken is part of the public api, we need to add org.apache.kafka.common.security.token.delegation to the following section in build.gradle.

  javadoc {
    include "**/org/apache/kafka/clients/admin/*"
    include "**/org/apache/kafka/clients/consumer/*"
    include "**/org/apache/kafka/clients/producer/*"
    include "**/org/apache/kafka/common/*"
    include "**/org/apache/kafka/common/acl/*"
    include "**/org/apache/kafka/common/annotation/*"
    include "**/org/apache/kafka/common/errors/*"
    include "**/org/apache/kafka/common/header/*"
    include "**/org/apache/kafka/common/resource/*"
    include "**/org/apache/kafka/common/serialization/*"
    include "**/org/apache/kafka/common/config/*"
    include "**/org/apache/kafka/common/security/auth/*"
    include "**/org/apache/kafka/server/policy/*"
  }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. moved couple of internal classes to internal package.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just remove all delegation token related methods from this scala class?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think we can delete those methods. since scala client is deprecated and this feature is released recently, hope it wont create any compatibility issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to convert tokenInfo.issueTimestamp to Date before calling format()?

Copy link
Copy Markdown
Contributor Author

@omkreddy omkreddy Apr 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we allow the tool to list all delegation tokens? It would be useful to document this from the command line option and also add a test for that.

Copy link
Copy Markdown
Contributor Author

@omkreddy omkreddy Apr 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the tool to return all user tokens, if the ownerPrincipals are not supplied.
Added a test class for DelegationTokenCommand

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also assert that the return list has size 1?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the default option, the owner list will be empty. In this case, it seems the broker will return an empty list instead of the tokens for the owner?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the default option, the owner list will be null. broker will return user owned tokens and tokens where user have Describe permission. This added to the Javadoc.

@omkreddy omkreddy force-pushed the KAFKA-6447 branch 2 times, most recently from 81e7f4b to 7718247 Compare April 9, 2018 16:36
Copy link
Copy Markdown
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omkreddy : Thanks for the updated patch. LGTM. Just a few minor more comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we can just reference tokens and get rid of describeResult.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be private?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map => foreach ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@junrao Thanks for the latest review. Addressed the review comments.

Copy link
Copy Markdown
Contributor

@junrao junrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omkreddy : Thanks for the updated patch. LGTM

@junrao junrao merged commit 47918f2 into apache:trunk Apr 11, 2018
koqizhao pushed a commit to koqizhao/kafka that referenced this pull request Apr 12, 2018
koqizhao pushed a commit to koqizhao/kafka that referenced this pull request Apr 12, 2018
koqizhao pushed a commit to koqizhao/kafka that referenced this pull request Apr 12, 2018
@omkreddy omkreddy deleted the KAFKA-6447 branch July 3, 2018 15:45
ying-zheng pushed a commit to ying-zheng/kafka that referenced this pull request Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants