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
|
// @generated
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchPermissionsRequest {
/// permissions is a list of permissions to watch for changes. At least one permission must be specified, and it must
/// be a subset or equal to the permissions that were enabled for the service.
#[prost(message, repeated, tag="1")]
pub permissions: ::prost::alloc::vec::Vec<WatchedPermission>,
/// optional_starting_after is the revision token to start watching from. If not provided, the stream
/// will start from the current revision at the moment of the request.
#[prost(message, optional, tag="2")]
pub optional_starting_after: ::core::option::Option<super::super::v1::ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchedPermission {
/// resource_type is the type of the resource to watch for changes.
#[prost(string, tag="1")]
pub resource_type: ::prost::alloc::string::String,
/// permission is the permission to watch for changes.
#[prost(string, tag="2")]
pub permission: ::prost::alloc::string::String,
/// subject_type is the type of the subject to watch for changes.
#[prost(string, tag="3")]
pub subject_type: ::prost::alloc::string::String,
/// optional_subject_relation is the relation on the subject to watch for changes.
#[prost(string, tag="4")]
pub optional_subject_relation: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchPermissionsResponse {
#[prost(oneof="watch_permissions_response::Response", tags="1, 2")]
pub response: ::core::option::Option<watch_permissions_response::Response>,
}
/// Nested message and enum types in `WatchPermissionsResponse`.
pub mod watch_permissions_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
/// change is the computed permission delta that has occurred as result of a mutation in origin SpiceDB.
/// The consumer should apply this change to the current state of the computed permissions in their target system.
/// Once an event arrives with completed_revision instead, the consumer shall consider there are not more changes
/// originating from that revision.
///
/// The consumer should keep track of the revision in order to resume streaming in the event of consumer restarts.
#[prost(message, tag="1")]
Change(super::PermissionChange),
/// completed_revision is the revision token that indicates all changes originating from a revision have been
/// streamed and thus the revision should be considered completed. It may also be
/// received without accompanying set of changes, indicating that a mutation in the origin SpiceDB cluster did
/// not yield any effective changes in the computed permissions
#[prost(message, tag="2")]
CompletedRevision(super::super::super::v1::ZedToken),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PermissionChange {
/// revision represents the revision at which the change occurred.
#[prost(message, optional, tag="1")]
pub revision: ::core::option::Option<super::super::v1::ZedToken>,
/// resource is the resource that the permission change is related to.
#[prost(message, optional, tag="2")]
pub resource: ::core::option::Option<super::super::v1::ObjectReference>,
/// permission is the permission that has changed.
#[prost(string, tag="3")]
pub permission: ::prost::alloc::string::String,
/// subject is the subject that the permission change is related to.
#[prost(message, optional, tag="4")]
pub subject: ::core::option::Option<super::super::v1::SubjectReference>,
/// permissionship is the new permissionship of the subject over the resource after the change.
#[prost(enumeration="permission_change::Permissionship", tag="5")]
pub permissionship: i32,
}
/// Nested message and enum types in `PermissionChange`.
pub mod permission_change {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Permissionship {
Unspecified = 0,
NoPermission = 1,
HasPermission = 2,
ConditionalPermission = 3,
}
impl Permissionship {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Permissionship::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
Permissionship::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
Permissionship::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
Permissionship::ConditionalPermission => "PERMISSIONSHIP_CONDITIONAL_PERMISSION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
"PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
"PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
"PERMISSIONSHIP_CONDITIONAL_PERMISSION" => Some(Self::ConditionalPermission),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchPermissionSetsRequest {
/// optional_starting_after is used to specify the SpiceDB revision to start watching from.
/// If not specified, the watch will start from the current SpiceDB revision time of the request ("head revision").
#[prost(message, optional, tag="1")]
pub optional_starting_after: ::core::option::Option<super::super::v1::ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchPermissionSetsResponse {
#[prost(oneof="watch_permission_sets_response::Response", tags="1, 2, 3, 4")]
pub response: ::core::option::Option<watch_permission_sets_response::Response>,
}
/// Nested message and enum types in `WatchPermissionSetsResponse`.
pub mod watch_permission_sets_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
/// change is the permission set delta that has occurred as result of a mutation in origin SpiceDB.
/// The consumer should apply this change to the current state of the permission sets in their target system.
/// Once an event arrives with completed_revision instead, the consumer shall consider the set of
/// changes originating from that revision completed.
///
/// The consumer should keep track of the revision in order to resume streaming in the event of consumer restarts.
#[prost(message, tag="1")]
Change(super::PermissionSetChange),
/// completed_revision is the revision token that indicates the completion of a set of changes. It may also be
/// received without accompanying set of changes, indicating that a mutation in the origin SpiceDB cluster did
/// not yield any effective changes in the permission sets
#[prost(message, tag="2")]
CompletedRevision(super::super::super::v1::ZedToken),
/// lookup_permission_sets_required is a signal that the consumer should perform a LookupPermissionSets call because
/// the permission set snapshot needs to be rebuilt from scratch. This typically happens when the origin SpiceDB
/// cluster has seen its schema changed.
#[prost(message, tag="3")]
LookupPermissionSetsRequired(super::LookupPermissionSetsRequired),
/// breaking_schema_change is a signal that a breaking schema change has been written to the origin SpiceDB cluster,
/// and that the consumer should expect delays in the ingestion of new changes,
/// because the permission set snapshot needs to be rebuilt from scratch. Once the snapshot is ready, the consumer
/// will receive a LookupPermissionSetsRequired event.
#[prost(message, tag="4")]
BreakingSchemaChange(super::BreakingSchemaChange),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cursor {
/// limit is the number of permission sets to stream over a single LookupPermissionSets call that was requested.
#[prost(uint32, tag="1")]
pub limit: u32,
/// token is the snapshot revision at which the cursor was computed.
#[prost(message, optional, tag="4")]
pub token: ::core::option::Option<super::super::v1::ZedToken>,
/// starting_index is an offset of the permission set represented by this cursor
#[prost(uint32, tag="5")]
pub starting_index: u32,
/// completed_members is a boolean flag that indicates that the cursor has reached the end of the permission sets
#[prost(bool, tag="6")]
pub completed_members: bool,
/// starting_key is a string cursor used by some backends to resume the stream from a specific point.
#[prost(string, tag="7")]
pub starting_key: ::prost::alloc::string::String,
/// cursor is a string-encoded internal materialize cursor.
#[prost(string, tag="8")]
pub cursor: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupPermissionSetsRequest {
/// limit is the number of permission sets to stream over a single LookupPermissionSets. Once the limit is reached,
/// the server will close the stream. If more permission sets are available, the consume should open a new stream
/// providing optional_starting_after_cursor, using the cursor from the last response.
#[prost(uint32, tag="1")]
pub limit: u32,
/// optional_at_revision specifies the client is requesting to lookup PermissionSets at a specific revision. It's
/// optional, and if not provided, PermissionSets will be looked up at the current revision. The cursor always
/// takes precedence in defining the revision when present.
#[prost(message, optional, tag="2")]
pub optional_at_revision: ::core::option::Option<super::super::v1::ZedToken>,
/// optional_starting_after_cursor is used to specify the offset to start streaming permission sets from.
#[prost(message, optional, tag="4")]
pub optional_starting_after_cursor: ::core::option::Option<Cursor>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupPermissionSetsResponse {
/// change represents the permission set delta necessary to transition an uninitialized target system to
/// a specific snapshot revision. In practice it's not different from the WatchPermissionSetsResponse.change, except
/// all changes will be of time SET_OPERATION_ADDED because it's assumed there is no known previous state.
///
/// Applying the deltas to a previously initialized target system would yield incorrect results.
#[prost(message, optional, tag="1")]
pub change: ::core::option::Option<PermissionSetChange>,
/// cursor points to a specific permission set in a revision.
/// The consumer should keep track of the cursor in order to resume streaming in the event of consumer restarts. This
/// is particularly important in backfill scenarios that may take hours or event days to complete.
#[prost(message, optional, tag="2")]
pub cursor: ::core::option::Option<Cursor>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PermissionSetChange {
/// revision represents the revision at which the permission set change occurred.
#[prost(message, optional, tag="1")]
pub at_revision: ::core::option::Option<super::super::v1::ZedToken>,
/// operation represents the type of set operation that took place as part of the change
#[prost(enumeration="permission_set_change::SetOperation", tag="2")]
pub operation: i32,
/// parent_set represents the permission set parent of either another set or a member
#[prost(message, optional, tag="3")]
pub parent_set: ::core::option::Option<SetReference>,
#[prost(oneof="permission_set_change::Child", tags="4, 5")]
pub child: ::core::option::Option<permission_set_change::Child>,
}
/// Nested message and enum types in `PermissionSetChange`.
pub mod permission_set_change {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SetOperation {
Unspecified = 0,
Added = 1,
Removed = 2,
}
impl SetOperation {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SetOperation::Unspecified => "SET_OPERATION_UNSPECIFIED",
SetOperation::Added => "SET_OPERATION_ADDED",
SetOperation::Removed => "SET_OPERATION_REMOVED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SET_OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
"SET_OPERATION_ADDED" => Some(Self::Added),
"SET_OPERATION_REMOVED" => Some(Self::Removed),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Child {
/// child_set represents the scenario where another set is considered member of the parent set
#[prost(message, tag="4")]
ChildSet(super::SetReference),
/// child_member represents the scenario where an specific object is considered member of the parent set
#[prost(message, tag="5")]
ChildMember(super::MemberReference),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetReference {
/// object_type is the type of object in a permission set
#[prost(string, tag="1")]
pub object_type: ::prost::alloc::string::String,
/// object_id is the ID of a permission set
#[prost(string, tag="2")]
pub object_id: ::prost::alloc::string::String,
/// permission_or_relation is the permission or relation referenced by this permission set
#[prost(string, tag="3")]
pub permission_or_relation: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberReference {
/// object_type is the type of object of a permission set member
#[prost(string, tag="1")]
pub object_type: ::prost::alloc::string::String,
/// object_id is the ID of a permission set member
#[prost(string, tag="2")]
pub object_id: ::prost::alloc::string::String,
/// optional_permission_or_relation is the permission or relation referenced by this permission set member
#[prost(string, tag="3")]
pub optional_permission_or_relation: ::prost::alloc::string::String,
}
/// LookupPermissionSetsRequired is a signal that the consumer should perform a LookupPermissionSets call because
/// the permission set snapshot needs to be rebuilt from scratch. This typically happens when the origin SpiceDB
/// cluster has seen its schema changed, see BreakingSchemaChange event.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupPermissionSetsRequired {
/// required_lookup_at is the snapshot revision at which the permission set needs to be rebuilt to.
#[prost(message, optional, tag="1")]
pub required_lookup_at: ::core::option::Option<super::super::v1::ZedToken>,
}
/// BreakingSchemaChange is used to signal a breaking schema change has happened, and that the consumer should
/// expect delays in the ingestion of new changes, because the permission set snapshot needs to be rebuilt from scratch.
/// Once the snapshot is ready, the consumer will receive a LookupPermissionSetsRequired event.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BreakingSchemaChange {
/// change_at is the revision at which a breaking schema event has happened.
#[prost(message, optional, tag="1")]
pub change_at: ::core::option::Option<super::super::v1::ZedToken>,
}
// @@protoc_insertion_point(module)
|