pub struct LabelSelectorAttributes {
pub raw_selector: Option<String>,
pub requirements: Vec<LabelSelectorRequirement>,
}Expand description
LabelSelectorAttributes indicates a label limited access. Webhook authors are encouraged to
- ensure rawSelector and requirements are not both set
- consider the requirements field if set
- not try to parse or consider the rawSelector field if set. This is to avoid another CVE-2022-2880 (i.e. getting different systems to agree on how exactly to parse a query is not something we want), see https://www.oxeye.io/resources/golang-parameter-smuggling-attack for more details. For the *SubjectAccessReview endpoints of the kube-apiserver:
- If rawSelector is empty and requirements are empty, the request is not limited.
- If rawSelector is present and requirements are empty, the rawSelector will be parsed and limited if the parsing succeeds.
- If rawSelector is empty and requirements are present, the requirements should be honored
- If rawSelector is present and requirements are present, the request is invalid.
Fields§
§raw_selector: Option<String>rawSelector is the serialization of a field selector that would be included in a query parameter. Webhook implementations are encouraged to ignore rawSelector. The kube-apiserver’s *SubjectAccessReview will parse the rawSelector as long as the requirements are not present. +optional
requirements: Vec<LabelSelectorRequirement>requirements is the parsed interpretation of a label selector. All requirements must be met for a resource instance to match the selector. Webhook implementations should handle requirements, but how to handle them is up to the webhook. Since requirements can only limit the request, it is safe to authorize as unlimited request if the requirements are not understood. +optional +listType=atomic
Implementations§
Source§impl LabelSelectorAttributes
impl LabelSelectorAttributes
Sourcepub fn raw_selector(&self) -> &str
pub fn raw_selector(&self) -> &str
Returns the value of raw_selector, or the default value if raw_selector is unset.
Trait Implementations§
Source§impl Clone for LabelSelectorAttributes
impl Clone for LabelSelectorAttributes
Source§fn clone(&self) -> LabelSelectorAttributes
fn clone(&self) -> LabelSelectorAttributes
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LabelSelectorAttributes
impl Debug for LabelSelectorAttributes
Source§impl Default for LabelSelectorAttributes
impl Default for LabelSelectorAttributes
Source§impl Message for LabelSelectorAttributes
impl Message for LabelSelectorAttributes
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.