Skip to main content

create_token_deadlines

Function create_token_deadlines 

Source
pub fn create_token_deadlines(
    now_ms: i64,
    requested_ms: i64,
    ceiling_ms: i64,
    default_renew_period_ms: i64,
) -> TokenCreateDecision
Expand description

Derive both stored deadlines of a new token.

Matches DelegationTokenControlManager.createDelegationToken in Kafka trunk: the lifetime is delegation.token.max.lifetime.ms (ceiling_ms) for a request of 0 or less and the smaller of the two otherwise, the maximum timestamp is now plus that lifetime, and the first expiry is now plus delegation.token.expiry.time.ms (default_renew_period_ms), capped at the maximum timestamp. Both sums saturate at i64::MAX. Kafka’s configuration validation rejects a period below 1, so a non-positive host setting is Invalid here.