docs-xml: Fix rid idmap backend documentation
[Samba.git] / librpc / idl / claims.idl
blobd190988fb98703447ef01f092f495d4cbe333dae
1 /*
2 claims
4 claim: An assertion about a security principal
6 From MS-ADTS:
8 For ease of implementation, the full IDL for the data types used for
9 claims is provided
11 The below was initially obtained from MS-ADTS which is
12 Copyright © 2022 Microsoft Corporation as permitted
13 by the Open Specifications terms reproduced in IDL_LICENCE.txt
16 #include "idl_types.h"
19 uuid("bba9cb76-eb0c-462c-aa1b-5d8c34415701"),
20 version(1.0),
21 pointer_default(unique),
22 helpstring("Active Directory Claims"),
23 helper("../librpc/ndr/ndr_claims.h")
25 interface claims
27 #define wchar_t uint16
28 #define CLAIM_ID [string, charset(UTF16)] wchar_t *
30 const int CLAIM_MINIMUM_BYTES_TO_COMPRESS = 384;
32 typedef enum {
33 CLAIM_TYPE_INT64 = 1,
34 CLAIM_TYPE_UINT64 = 2,
35 CLAIM_TYPE_STRING = 3,
36 CLAIM_TYPE_BOOLEAN = 6
37 } CLAIM_TYPE;
39 typedef enum {
40 CLAIMS_SOURCE_TYPE_AD = 1,
41 CLAIMS_SOURCE_TYPE_CERTIFICATE = 2
42 } CLAIMS_SOURCE_TYPE;
44 typedef enum {
45 CLAIMS_COMPRESSION_FORMAT_NONE = 0,
46 CLAIMS_COMPRESSION_FORMAT_LZNT1 = 2,
47 CLAIMS_COMPRESSION_FORMAT_XPRESS = 3,
48 CLAIMS_COMPRESSION_FORMAT_XPRESS_HUFF = 4
49 } CLAIMS_COMPRESSION_FORMAT;
51 typedef struct {
52 [range(1, 10*1024*1024)] uint32 value_count;
53 [size_is(value_count)] dlong *values;
54 } CLAIM_INT64;
56 typedef struct {
57 [range(1, 10*1024*1024)] uint32 value_count;
58 [size_is(value_count)] hyper *values;
59 } CLAIM_UINT64;
61 typedef struct {
62 [range(1, 10*1024*1024)] uint32 value_count;
63 [size_is(value_count), string, charset(UTF16)] wchar_t **values;
64 } CLAIM_STRING;
66 typedef [switch_type(CLAIM_TYPE),nodiscriminant,flag(NDR_ALIGN8)] union {
67 [case(CLAIM_TYPE_INT64)] CLAIM_INT64 claim_int64;
68 [case(CLAIM_TYPE_UINT64)] CLAIM_UINT64 claim_uint64;
69 [case(CLAIM_TYPE_STRING)] CLAIM_STRING claim_string;
70 [case(CLAIM_TYPE_BOOLEAN)] CLAIM_UINT64 claim_boolean;
71 [default];
72 } CLAIM_ENTRY_VALUES;
74 typedef struct {
75 CLAIM_ID id;
76 CLAIM_TYPE type;
77 [switch_is(type)] CLAIM_ENTRY_VALUES values;
78 } CLAIM_ENTRY;
80 typedef struct {
81 CLAIMS_SOURCE_TYPE claims_source_type;
82 uint32 claims_count;
83 [size_is(claims_count)] CLAIM_ENTRY *claim_entries;
84 } CLAIMS_ARRAY;
86 typedef struct {
87 CLAIMS_SET_METADATA *metadata;
88 } CLAIMS_SET_METADATA_CTR;
90 typedef struct {
91 CLAIMS_SET *claims;
92 } CLAIMS_SET_CTR;
94 /* Public structures. */
96 typedef [public] struct {
97 uint32 claims_array_count;
98 [size_is(claims_array_count)] CLAIMS_ARRAY *claims_arrays;
99 uint16 reserved_type;
100 uint32 reserved_field_size;
101 [size_is(reserved_field_size)] uint8 *reserved_field;
102 } CLAIMS_SET;
104 typedef [public, gensize] struct {
105 [subcontext(0xFFFFFC01)] CLAIMS_SET_CTR claims;
106 } CLAIMS_SET_NDR;
108 typedef [public] struct {
109 [subcontext(0xFFFFFC01)] CLAIMS_SET_METADATA_CTR claims;
110 } CLAIMS_SET_METADATA_NDR;
112 typedef [public] struct {
113 [value(ndr_claims_compressed_size(claims_set,
114 r->compression_format,
115 ndr->flags))] uint32 claims_set_size;
116 [subcontext(4),
117 compression(ndr_claims_compression_alg(compression_format),
118 claims_set_size,
119 uncompressed_claims_set_size)
120 ] CLAIMS_SET_NDR *claims_set;
122 * The second argument to
123 * ndr_claims_actual_wire_compression_alg() in the
124 * value() below should be
125 * uncompressed_claims_set_size but the value()
126 * handling isn't recursive (enough) so we have to
127 * specify that manually otherwise the
128 * compression_format in the above includes the struct
129 * member, not the value()
131 * The caller should set compression_format to
132 * CLAIMS_COMPRESSION_FORMAT_XPRESS_HUFF and this will
133 * be reset to CLAIMS_COMPRESSION_FORMAT_NONE if the
134 * buffer is not large enough to compress.
136 * Otherwise setting CLAIMS_COMPRESSION_FORMAT_NONE
137 * disabled compression entirely.
139 [value(ndr_claims_actual_wire_compression_alg(r->compression_format,
140 ndr_size_CLAIMS_SET_NDR(claims_set,
141 ndr->flags)))] CLAIMS_COMPRESSION_FORMAT compression_format;
142 [value(ndr_size_CLAIMS_SET_NDR(claims_set,
143 ndr->flags))] uint32 uncompressed_claims_set_size;
144 uint16 reserved_type;
145 uint32 reserved_field_size;
146 [size_is(reserved_field_size)] uint8 *reserved_field;
147 } CLAIMS_SET_METADATA;