pub struct TokenInformation { /* private fields */ }Expand description
A class representing delegation token details.
Corresponds to
org.apache.kafka.common.security.token.delegation.TokenInformation.
Implementations§
Source§impl TokenInformation
impl TokenInformation
Sourcepub fn new(
token_id: impl Into<String>,
owner: KafkaPrincipal,
renewers: Vec<KafkaPrincipal>,
issue_timestamp: i64,
max_timestamp: i64,
expiry_timestamp: i64,
) -> Self
pub fn new( token_id: impl Into<String>, owner: KafkaPrincipal, renewers: Vec<KafkaPrincipal>, issue_timestamp: i64, max_timestamp: i64, expiry_timestamp: i64, ) -> Self
Creates token information where the owner is also the requester.
Mirrors the TokenInformation(tokenId, owner, renewers, ...)
constructor.
Sourcepub fn with_token_requester(
token_id: impl Into<String>,
owner: KafkaPrincipal,
token_requester: KafkaPrincipal,
renewers: Vec<KafkaPrincipal>,
issue_timestamp: i64,
max_timestamp: i64,
expiry_timestamp: i64,
) -> Self
pub fn with_token_requester( token_id: impl Into<String>, owner: KafkaPrincipal, token_requester: KafkaPrincipal, renewers: Vec<KafkaPrincipal>, issue_timestamp: i64, max_timestamp: i64, expiry_timestamp: i64, ) -> Self
Creates token information with a distinct token requester.
Mirrors the
TokenInformation(tokenId, owner, tokenRequester, renewers, ...)
constructor.
Sourcepub fn owner(&self) -> &KafkaPrincipal
pub fn owner(&self) -> &KafkaPrincipal
Returns the token owner.
Mirrors TokenInformation.owner.
Sourcepub fn owner_as_string(&self) -> String
pub fn owner_as_string(&self) -> String
Returns the token owner as a type:name string.
Mirrors TokenInformation.ownerAsString.
Sourcepub fn token_requester(&self) -> &KafkaPrincipal
pub fn token_requester(&self) -> &KafkaPrincipal
Returns the token requester.
Mirrors TokenInformation.tokenRequester.
Sourcepub fn token_requester_as_string(&self) -> String
pub fn token_requester_as_string(&self) -> String
Returns the token requester as a type:name string.
Mirrors TokenInformation.tokenRequesterAsString.
Sourcepub fn renewers(&self) -> &[KafkaPrincipal]
pub fn renewers(&self) -> &[KafkaPrincipal]
Returns the renewers.
Mirrors TokenInformation.renewers.
Sourcepub fn renewers_as_string(&self) -> Vec<String>
pub fn renewers_as_string(&self) -> Vec<String>
Returns the renewers as type:name strings.
Mirrors TokenInformation.renewersAsString.
Sourcepub fn issue_timestamp(&self) -> i64
pub fn issue_timestamp(&self) -> i64
Returns the issue timestamp.
Mirrors TokenInformation.issueTimestamp.
Sourcepub fn expiry_timestamp(&self) -> i64
pub fn expiry_timestamp(&self) -> i64
Returns the expiry timestamp.
Mirrors TokenInformation.expiryTimestamp.
Sourcepub fn set_expiry_timestamp(&mut self, expiry_timestamp: i64)
pub fn set_expiry_timestamp(&mut self, expiry_timestamp: i64)
Sets the expiry timestamp.
Mirrors TokenInformation.setExpiryTimestamp.
Sourcepub fn max_timestamp(&self) -> i64
pub fn max_timestamp(&self) -> i64
Returns the maximum timestamp.
Mirrors TokenInformation.maxTimestamp.
Sourcepub fn owner_or_renewer(&self, principal: &KafkaPrincipal) -> bool
pub fn owner_or_renewer(&self, principal: &KafkaPrincipal) -> bool
Returns true if the given principal is the owner, the token requester,
or one of the renewers.
Mirrors TokenInformation.ownerOrRenewer.
Trait Implementations§
Source§impl Clone for TokenInformation
impl Clone for TokenInformation
Source§fn clone(&self) -> TokenInformation
fn clone(&self) -> TokenInformation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TokenInformation
impl Debug for TokenInformation
Source§impl Display for TokenInformation
impl Display for TokenInformation
Source§impl Hash for TokenInformation
impl Hash for TokenInformation
Source§impl PartialEq for TokenInformation
impl PartialEq for TokenInformation
impl Eq for TokenInformation
Auto Trait Implementations§
impl Freeze for TokenInformation
impl RefUnwindSafe for TokenInformation
impl Send for TokenInformation
impl Sync for TokenInformation
impl Unpin for TokenInformation
impl UnsafeUnpin for TokenInformation
impl UnwindSafe for TokenInformation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.