1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Biscuit {
    #[prost(uint32, optional, tag="1")]
    pub root_key_id: ::core::option::Option<u32>,
    #[prost(message, required, tag="2")]
    pub authority: SignedBlock,
    #[prost(message, repeated, tag="3")]
    pub blocks: ::prost::alloc::vec::Vec<SignedBlock>,
    #[prost(message, required, tag="4")]
    pub proof: Proof,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignedBlock {
    #[prost(bytes="vec", required, tag="1")]
    pub block: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, required, tag="2")]
    pub next_key: PublicKey,
    #[prost(bytes="vec", required, tag="3")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, optional, tag="4")]
    pub external_signature: ::core::option::Option<ExternalSignature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExternalSignature {
    #[prost(bytes="vec", required, tag="1")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, required, tag="2")]
    pub public_key: PublicKey,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublicKey {
    #[prost(enumeration="public_key::Algorithm", required, tag="1")]
    pub algorithm: i32,
    #[prost(bytes="vec", required, tag="2")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
/// Nested message and enum types in `PublicKey`.
pub mod public_key {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Algorithm {
        Ed25519 = 0,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Proof {
    #[prost(oneof="proof::Content", tags="1, 2")]
    pub content: ::core::option::Option<proof::Content>,
}
/// Nested message and enum types in `Proof`.
pub mod proof {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        #[prost(bytes, tag="1")]
        NextSecret(::prost::alloc::vec::Vec<u8>),
        #[prost(bytes, tag="2")]
        FinalSignature(::prost::alloc::vec::Vec<u8>),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
    #[prost(string, repeated, tag="1")]
    pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, optional, tag="2")]
    pub context: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag="3")]
    pub version: ::core::option::Option<u32>,
    #[prost(message, repeated, tag="4")]
    pub facts_v2: ::prost::alloc::vec::Vec<FactV2>,
    #[prost(message, repeated, tag="5")]
    pub rules_v2: ::prost::alloc::vec::Vec<RuleV2>,
    #[prost(message, repeated, tag="6")]
    pub checks_v2: ::prost::alloc::vec::Vec<CheckV2>,
    #[prost(message, repeated, tag="7")]
    pub scope: ::prost::alloc::vec::Vec<Scope>,
    #[prost(message, repeated, tag="8")]
    pub public_keys: ::prost::alloc::vec::Vec<PublicKey>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Scope {
    #[prost(oneof="scope::Content", tags="1, 2")]
    pub content: ::core::option::Option<scope::Content>,
}
/// Nested message and enum types in `Scope`.
pub mod scope {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum ScopeType {
        Authority = 0,
        Previous = 1,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        #[prost(enumeration="ScopeType", tag="1")]
        ScopeType(i32),
        #[prost(int64, tag="2")]
        PublicKey(i64),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FactV2 {
    #[prost(message, required, tag="1")]
    pub predicate: PredicateV2,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleV2 {
    #[prost(message, required, tag="1")]
    pub head: PredicateV2,
    #[prost(message, repeated, tag="2")]
    pub body: ::prost::alloc::vec::Vec<PredicateV2>,
    #[prost(message, repeated, tag="3")]
    pub expressions: ::prost::alloc::vec::Vec<ExpressionV2>,
    #[prost(message, repeated, tag="4")]
    pub scope: ::prost::alloc::vec::Vec<Scope>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckV2 {
    #[prost(message, repeated, tag="1")]
    pub queries: ::prost::alloc::vec::Vec<RuleV2>,
    #[prost(enumeration="check_v2::Kind", optional, tag="2")]
    pub kind: ::core::option::Option<i32>,
}
/// Nested message and enum types in `CheckV2`.
pub mod check_v2 {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Kind {
        One = 0,
        All = 1,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PredicateV2 {
    #[prost(uint64, required, tag="1")]
    pub name: u64,
    #[prost(message, repeated, tag="2")]
    pub terms: ::prost::alloc::vec::Vec<TermV2>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TermV2 {
    #[prost(oneof="term_v2::Content", tags="1, 2, 3, 4, 5, 6, 7")]
    pub content: ::core::option::Option<term_v2::Content>,
}
/// Nested message and enum types in `TermV2`.
pub mod term_v2 {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        #[prost(uint32, tag="1")]
        Variable(u32),
        #[prost(int64, tag="2")]
        Integer(i64),
        #[prost(uint64, tag="3")]
        String(u64),
        #[prost(uint64, tag="4")]
        Date(u64),
        #[prost(bytes, tag="5")]
        Bytes(::prost::alloc::vec::Vec<u8>),
        #[prost(bool, tag="6")]
        Bool(bool),
        #[prost(message, tag="7")]
        Set(super::TermSet),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TermSet {
    #[prost(message, repeated, tag="1")]
    pub set: ::prost::alloc::vec::Vec<TermV2>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpressionV2 {
    #[prost(message, repeated, tag="1")]
    pub ops: ::prost::alloc::vec::Vec<Op>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Op {
    #[prost(oneof="op::Content", tags="1, 2, 3")]
    pub content: ::core::option::Option<op::Content>,
}
/// Nested message and enum types in `Op`.
pub mod op {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        #[prost(message, tag="1")]
        Value(super::TermV2),
        #[prost(message, tag="2")]
        Unary(super::OpUnary),
        #[prost(message, tag="3")]
        Binary(super::OpBinary),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpUnary {
    #[prost(enumeration="op_unary::Kind", required, tag="1")]
    pub kind: i32,
}
/// Nested message and enum types in `OpUnary`.
pub mod op_unary {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Kind {
        Negate = 0,
        Parens = 1,
        Length = 2,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpBinary {
    #[prost(enumeration="op_binary::Kind", required, tag="1")]
    pub kind: i32,
}
/// Nested message and enum types in `OpBinary`.
pub mod op_binary {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Kind {
        LessThan = 0,
        GreaterThan = 1,
        LessOrEqual = 2,
        GreaterOrEqual = 3,
        Equal = 4,
        Contains = 5,
        Prefix = 6,
        Suffix = 7,
        Regex = 8,
        Add = 9,
        Sub = 10,
        Mul = 11,
        Div = 12,
        And = 13,
        Or = 14,
        Intersection = 15,
        Union = 16,
        BitwiseAnd = 17,
        BitwiseOr = 18,
        BitwiseXor = 19,
        NotEqual = 20,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Policy {
    #[prost(message, repeated, tag="1")]
    pub queries: ::prost::alloc::vec::Vec<RuleV2>,
    #[prost(enumeration="policy::Kind", required, tag="2")]
    pub kind: i32,
}
/// Nested message and enum types in `Policy`.
pub mod policy {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Kind {
        Allow = 0,
        Deny = 1,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthorizerPolicies {
    #[prost(string, repeated, tag="1")]
    pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag="2")]
    pub version: ::core::option::Option<u32>,
    #[prost(message, repeated, tag="3")]
    pub facts: ::prost::alloc::vec::Vec<FactV2>,
    #[prost(message, repeated, tag="4")]
    pub rules: ::prost::alloc::vec::Vec<RuleV2>,
    #[prost(message, repeated, tag="5")]
    pub checks: ::prost::alloc::vec::Vec<CheckV2>,
    #[prost(message, repeated, tag="6")]
    pub policies: ::prost::alloc::vec::Vec<Policy>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ThirdPartyBlockRequest {
    #[prost(message, required, tag="1")]
    pub previous_key: PublicKey,
    #[prost(message, repeated, tag="2")]
    pub public_keys: ::prost::alloc::vec::Vec<PublicKey>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ThirdPartyBlockContents {
    #[prost(bytes="vec", required, tag="1")]
    pub payload: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, required, tag="2")]
    pub external_signature: ExternalSignature,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthorizerSnapshot {
    #[prost(message, required, tag="1")]
    pub limits: RunLimits,
    #[prost(uint64, required, tag="2")]
    pub execution_time: u64,
    #[prost(message, required, tag="3")]
    pub world: AuthorizerWorld,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunLimits {
    #[prost(uint64, required, tag="1")]
    pub max_facts: u64,
    #[prost(uint64, required, tag="2")]
    pub max_iterations: u64,
    #[prost(uint64, required, tag="3")]
    pub max_time: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthorizerWorld {
    #[prost(uint32, optional, tag="1")]
    pub version: ::core::option::Option<u32>,
    #[prost(string, repeated, tag="2")]
    pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag="3")]
    pub public_keys: ::prost::alloc::vec::Vec<PublicKey>,
    #[prost(message, repeated, tag="4")]
    pub blocks: ::prost::alloc::vec::Vec<SnapshotBlock>,
    #[prost(message, required, tag="5")]
    pub authorizer_block: SnapshotBlock,
    #[prost(message, repeated, tag="6")]
    pub authorizer_policies: ::prost::alloc::vec::Vec<Policy>,
    #[prost(message, repeated, tag="7")]
    pub generated_facts: ::prost::alloc::vec::Vec<GeneratedFacts>,
    #[prost(uint64, required, tag="8")]
    pub iterations: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Origin {
    #[prost(oneof="origin::Content", tags="1, 2")]
    pub content: ::core::option::Option<origin::Content>,
}
/// Nested message and enum types in `Origin`.
pub mod origin {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Content {
        #[prost(message, tag="1")]
        Authorizer(super::Empty),
        #[prost(uint32, tag="2")]
        Origin(u32),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeneratedFacts {
    #[prost(message, repeated, tag="1")]
    pub origins: ::prost::alloc::vec::Vec<Origin>,
    #[prost(message, repeated, tag="2")]
    pub facts: ::prost::alloc::vec::Vec<FactV2>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotBlock {
    #[prost(string, optional, tag="1")]
    pub context: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag="2")]
    pub version: ::core::option::Option<u32>,
    #[prost(message, repeated, tag="3")]
    pub facts_v2: ::prost::alloc::vec::Vec<FactV2>,
    #[prost(message, repeated, tag="4")]
    pub rules_v2: ::prost::alloc::vec::Vec<RuleV2>,
    #[prost(message, repeated, tag="5")]
    pub checks_v2: ::prost::alloc::vec::Vec<CheckV2>,
    #[prost(message, repeated, tag="6")]
    pub scope: ::prost::alloc::vec::Vec<Scope>,
    #[prost(message, optional, tag="7")]
    pub external_key: ::core::option::Option<PublicKey>,
}