From a6474a96ade036e081fa0e976448756b66f848c5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 3 Feb 2025 13:56:54 +0100 Subject: [PATCH] claims.idl: add some helper structs for claims transformation [MS-CTA] Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- librpc/idl/claims.idl | 54 +++++++++++++++++++++++++++++++++++++++++ librpc/ndr/ndr_claims.c | 12 +++++++++ 2 files changed, 66 insertions(+) diff --git a/librpc/idl/claims.idl b/librpc/idl/claims.idl index 618a620ef87..c81d4718ce0 100644 --- a/librpc/idl/claims.idl +++ b/librpc/idl/claims.idl @@ -146,4 +146,58 @@ interface claims uint32 reserved_field_size; [size_is(reserved_field_size)] uint8 *reserved_field; } CLAIMS_SET_METADATA; + + typedef [nopush,nopull] enum { + CLAIMS_TF_CONDITION_OPERATOR_INVALID = 0, + CLAIMS_TF_CONDITION_OPERATOR_EQ = 1, + CLAIMS_TF_CONDITION_OPERATOR_NEQ = 2, + CLAIMS_TF_CONDITION_OPERATOR_REGEXP_MATCH = 3, + CLAIMS_TF_CONDITION_OPERATOR_REGEXP_NOT_MATCH = 4 + } claims_tf_condition_operator; + + typedef [nopush,nopull] enum { + CLAIMS_TF_PROPERTY_INVALID = 0, + CLAIMS_TF_PROPERTY_TYPE = 1, + CLAIMS_TF_PROPERTY_VALUE = 2, + CLAIMS_TF_PROPERTY_VALUE_TYPE = 3 + } claims_tf_property_enum; + + typedef [nopush,nopull] struct { + claims_tf_property_enum property; + claims_tf_condition_operator operator; + [ref,string, charset(UTF8)] char *string; + } claims_tf_condition; + + typedef [nopush,nopull] struct { + [unique, string, charset(UTF8)] char *opt_identifier; + uint32 num_conditions; + claims_tf_condition conditions[num_conditions]; + } claims_tf_condition_set; + + typedef [nopush,nopull] struct claims_tf_property_ref { + [unique, string, charset(UTF8)] char *identifier; + claims_tf_property_enum property; + } claims_tf_property_ref; + + typedef [nopush,nopull] struct claims_tf_property { + claims_tf_property_ref ref; + [unique, string, charset(UTF8)] char *string; + } claims_tf_property; + + typedef [nopush,nopull] struct { + claims_tf_property type; + claims_tf_property value; + claims_tf_property value_type; + } claims_tf_rule_action; + + typedef [nopush,nopull] struct claims_tf_rule { + uint32 num_condition_sets; + claims_tf_condition_set condition_sets[num_condition_sets]; + claims_tf_rule_action action; + } claims_tf_rule; + + typedef [public,nopush,nopull] struct { + uint32 num_rules; + claims_tf_rule rules[num_rules]; + } claims_tf_rule_set; } diff --git a/librpc/ndr/ndr_claims.c b/librpc/ndr/ndr_claims.c index 96126269213..bb77cf38a5b 100644 --- a/librpc/ndr/ndr_claims.c +++ b/librpc/ndr/ndr_claims.c @@ -88,3 +88,15 @@ size_t ndr_claims_compressed_size(struct CLAIMS_SET_NDR *claims_set, return 0; } } + +_PUBLIC_ enum ndr_err_code ndr_push_claims_tf_rule_set(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct claims_tf_rule_set *r) +{ + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, + "ndr_push_claims_tf_rule_set() not implemented"); +} + +_PUBLIC_ enum ndr_err_code ndr_pull_claims_tf_rule_set(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct claims_tf_rule_set *r) +{ + return ndr_pull_error(ndr, NDR_ERR_INVALID_POINTER, + "ndr_pull_claims_tf_rule_set() not implemented"); +} -- 2.47.2