import { ModelData, Model } from "@kubernetes-models/base"; /** * PortRule is a list of Kafka protocol constraints. All fields are * optional, if all fields are empty or missing, the rule will match all * Kafka messages. */ export interface IPortRule { /** * APIKey is a case-insensitive string matched against the key of a * request, e.g. "produce", "fetch", "createtopic", "deletetopic", et al * Reference: https://kafka.apache.org/protocol#protocol_api_keys * * If omitted or empty, and if Role is not specified, then all keys are allowed. */ "apiKey"?: string; /** * APIVersion is the version matched against the api version of the * Kafka message. If set, it has to be a string representing a positive * integer. * * If omitted or empty, all versions are allowed. */ "apiVersion"?: string; /** * ClientID is the client identifier as provided in the request. * * From Kafka protocol documentation: * This is a user supplied identifier for the client application. The * user can use any identifier they like and it will be used when * logging errors, monitoring aggregates, etc. For example, one might * want to monitor not just the requests per second overall, but the * number coming from each client application (each of which could * reside on multiple servers). This id acts as a logical grouping * across all requests from a particular client. * * If omitted or empty, all client identifiers are allowed. */ "clientID"?: string; /** * Role is a case-insensitive string and describes a group of API keys * necessary to perform certain higher-level Kafka operations such as "produce" * or "consume". A Role automatically expands into all APIKeys required * to perform the specified higher-level operation. * * The following values are supported: * - "produce": Allow producing to the topics specified in the rule * - "consume": Allow consuming from the topics specified in the rule * * This field is incompatible with the APIKey field, i.e APIKey and Role * cannot both be specified in the same rule. * * If omitted or empty, and if APIKey is not specified, then all keys are * allowed. */ "role"?: "produce" | "consume"; /** * Topic is the topic name contained in the message. If a Kafka request * contains multiple topics, then all topics must be allowed or the * message will be rejected. * * This constraint is ignored if the matched request message type * doesn't contain any topic. Maximum size of Topic can be 249 * characters as per recent Kafka spec and allowed characters are * a-z, A-Z, 0-9, -, . and _. * * Older Kafka versions had longer topic lengths of 255, but in Kafka 0.10 * version the length was changed from 255 to 249. For compatibility * reasons we are using 255. * * If omitted or empty, all topics are allowed. */ "topic"?: string; } /** * PortRule is a list of Kafka protocol constraints. All fields are * optional, if all fields are empty or missing, the rule will match all * Kafka messages. */ export declare class PortRule extends Model implements IPortRule { "apiKey"?: string; "apiVersion"?: string; "clientID"?: string; "role"?: "produce" | "consume"; "topic"?: string; constructor(data?: ModelData); } export type { IPortRule as IComGithubCiliumProxyPkgPolicyApiKafkaPortRule, PortRule as ComGithubCiliumProxyPkgPolicyApiKafkaPortRule };