2022-04-12 21:14:09 +08:00
|
|
|
/*
|
2024-01-23 12:51:46 +00:00
|
|
|
* v1_resource_policy_rule.h
|
2022-04-12 21:14:09 +08:00
|
|
|
*
|
|
|
|
|
* ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==\"\"`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
#ifndef _v1_resource_policy_rule_H_
|
|
|
|
|
#define _v1_resource_policy_rule_H_
|
2022-04-12 21:14:09 +08:00
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "../external/cJSON.h"
|
|
|
|
|
#include "../include/list.h"
|
|
|
|
|
#include "../include/keyValuePair.h"
|
|
|
|
|
#include "../include/binary.h"
|
|
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
typedef struct v1_resource_policy_rule_t v1_resource_policy_rule_t;
|
2022-04-12 21:14:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
typedef struct v1_resource_policy_rule_t {
|
2022-04-12 21:14:09 +08:00
|
|
|
list_t *api_groups; //primitive container
|
|
|
|
|
int cluster_scope; //boolean
|
|
|
|
|
list_t *namespaces; //primitive container
|
|
|
|
|
list_t *resources; //primitive container
|
|
|
|
|
list_t *verbs; //primitive container
|
|
|
|
|
|
2025-02-11 19:36:46 +00:00
|
|
|
int _library_owned; // Is the library responsible for freeing this object?
|
2024-01-23 12:51:46 +00:00
|
|
|
} v1_resource_policy_rule_t;
|
2022-04-12 21:14:09 +08:00
|
|
|
|
2025-02-11 19:36:46 +00:00
|
|
|
__attribute__((deprecated)) v1_resource_policy_rule_t *v1_resource_policy_rule_create(
|
2022-04-12 21:14:09 +08:00
|
|
|
list_t *api_groups,
|
|
|
|
|
int cluster_scope,
|
|
|
|
|
list_t *namespaces,
|
|
|
|
|
list_t *resources,
|
|
|
|
|
list_t *verbs
|
|
|
|
|
);
|
|
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
void v1_resource_policy_rule_free(v1_resource_policy_rule_t *v1_resource_policy_rule);
|
2022-04-12 21:14:09 +08:00
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
v1_resource_policy_rule_t *v1_resource_policy_rule_parseFromJSON(cJSON *v1_resource_policy_ruleJSON);
|
2022-04-12 21:14:09 +08:00
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
cJSON *v1_resource_policy_rule_convertToJSON(v1_resource_policy_rule_t *v1_resource_policy_rule);
|
2022-04-12 21:14:09 +08:00
|
|
|
|
2024-01-23 12:51:46 +00:00
|
|
|
#endif /* _v1_resource_policy_rule_H_ */
|
2022-04-12 21:14:09 +08:00
|
|
|
|