Skip to main content

AclSource

Trait AclSource 

Source
pub trait AclSource {
    // Required methods
    fn matching_acls<'a>(
        &'a self,
        rt: ResourceType,
        name: &'a str,
    ) -> AclEntries<'a>;
    fn acls_of_type(&self, rt: ResourceType) -> AclEntries<'_>;
    fn cidr_hosts_supported(&self) -> bool;
}
Expand description

A source of ACL entries the authorizer can match against.

matching_acls MUST return every entry whose resource pattern matches (rt, name): LITERAL entries equal to name, the LITERAL * wildcard, and PREFIXED entries where name.starts_with(entry.resource_name).

Mirror krabka_metadata::MetadataImage::matching_acls in crates/metadata/src/image.rs.

Required Methods§

Source

fn matching_acls<'a>( &'a self, rt: ResourceType, name: &'a str, ) -> AclEntries<'a>

Source

fn acls_of_type(&self, rt: ResourceType) -> AclEntries<'_>

Every stored entry of resource type rt, regardless of resource name.

crate::SimpleAclAuthorizer’s authorize_by_resource_type scans this set for an ALLOW grant that no DENY covers, so unlike matching_acls it is not scoped to one candidate resource name.

Source

fn cidr_hosts_supported(&self) -> bool

Whether a stored host containing / is a CIDR range (KIP-1276) rather than plain text. Kafka 4.3.1 compares every host as text, and trunk reads a range only once the cluster’s metadata.version reaches 4.4-IV1, so a source says here whether the cluster it reads from has reached it. There is no default: a source that holds only entries, such as crate::AclCache, must carry the answer of the broker it fetched them from, or it would read a range where that broker compares text.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AclSource for MetadataImage

Source§

fn cidr_hosts_supported(&self) -> bool

An unfinalized metadata.version is the bootstrap level, 4.3-IV0, which is below the CIDR floor.

Source§

fn matching_acls<'a>( &'a self, rt: ResourceType, name: &'a str, ) -> AclEntries<'a>

Source§

fn acls_of_type(&self, rt: ResourceType) -> AclEntries<'_>

Implementors§