Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We will bump the version of the CreateTokenRequest API to include the owner details and "Token requester"  in reponse. For old versions, we will skip the owner and owner will be equivalent to same as token request principal.

Code Block
linenumberstrue
CreateDelegationTokenRequest => [Renewer] MaxDateMs
  Owner => Nullable string  // New
  Renewer => string
  MaxDateMs => INT64

...

Code Block
languagejava
linenumberstrue


AdminClient {
    //create delegation token with supplied options
	public abstract CreateDelegationTokenResult createDelegationToken(CreateDelegationTokenOptions options)
}


public class CreateDelegationTokenOptions extends AbstractOptions<CreateDelegationTokenOptions> {
    private long maxLifeTimeMs = -1;
    private List<KafkaPrincipal> renewers =  new LinkedList<>();
    private Optional<KafkaPrincipal> owner = Optional.empty(); // New

    public CreateDelegationTokenOptions owner(KafkaPrincipal owner) {  // New
        this.owner = Optional.of(owner);
        return this;
    }

    public CreateDelegationTokenOptions renewers(List<KafkaPrincipal> renewers) {
        this.renewers = renewers;
        return this;
    }

    public Optional<KafkaPrincipal> owner() {
        return owner;
    }

    public List<KafkaPrincipal> renewers() {
        return renewers;
    }

    public CreateDelegationTokenOptions maxlifeTimeMs(long maxLifeTimeMs) {
        this.maxLifeTimeMs = maxLifeTimeMs;
        return this;
    }

    public long maxlifeTimeMs() {
        return maxLifeTimeMs;
    }
}


Update TokenInformation class to include "token request" details.


Code Block
languagejava
linenumberstrue
public class TokenInformation {

    private KafkaPrincipal owner;
    private KafkaPrincipal tokenRequester; /// New
    private Collection<KafkaPrincipal> renewers;
    private long issueTimestamp;
    private long maxTimestamp;
    private long expiryTimestamp;
    private String tokenId;

    public TokenInformation(String tokenId, KafkaPrincipal owner, KafkaPrincipal tokenRequester,
        Collection<KafkaPrincipal> renewers, long issueTimestamp, long maxTimestamp, long expiryTimestamp) {
     ....
     ....
    }
    
}

ACL Changes:

DelegationTokenCommand Changes:

...