io.kubernetes.client.openapi.models.V1LabelSelectorAttributes Maven / Gradle / Ivy
/*
Copyright 2025 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package io.kubernetes.client.openapi.models;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.kubernetes.client.openapi.models.V1LabelSelectorRequirement;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 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.
*/
@ApiModel(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.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-05-22T21:20:49.874193Z[Etc/UTC]")
public class V1LabelSelectorAttributes {
public static final String SERIALIZED_NAME_RAW_SELECTOR = "rawSelector";
@SerializedName(SERIALIZED_NAME_RAW_SELECTOR)
private String rawSelector;
public static final String SERIALIZED_NAME_REQUIREMENTS = "requirements";
@SerializedName(SERIALIZED_NAME_REQUIREMENTS)
private List requirements = null;
public V1LabelSelectorAttributes rawSelector(String rawSelector) {
this.rawSelector = rawSelector;
return this;
}
/**
* 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.
* @return rawSelector
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "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.")
public String getRawSelector() {
return rawSelector;
}
public void setRawSelector(String rawSelector) {
this.rawSelector = rawSelector;
}
public V1LabelSelectorAttributes requirements(List requirements) {
this.requirements = requirements;
return this;
}
public V1LabelSelectorAttributes addRequirementsItem(V1LabelSelectorRequirement requirementsItem) {
if (this.requirements == null) {
this.requirements = new ArrayList<>();
}
this.requirements.add(requirementsItem);
return this;
}
/**
* 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.
* @return requirements
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "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.")
public List getRequirements() {
return requirements;
}
public void setRequirements(List requirements) {
this.requirements = requirements;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
V1LabelSelectorAttributes v1LabelSelectorAttributes = (V1LabelSelectorAttributes) o;
return Objects.equals(this.rawSelector, v1LabelSelectorAttributes.rawSelector) &&
Objects.equals(this.requirements, v1LabelSelectorAttributes.requirements);
}
@Override
public int hashCode() {
return Objects.hash(rawSelector, requirements);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class V1LabelSelectorAttributes {\n");
sb.append(" rawSelector: ").append(toIndentedString(rawSelector)).append("\n");
sb.append(" requirements: ").append(toIndentedString(requirements)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy