summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-16 13:27:37 -0600
committermo khan <mo@mokhan.ca>2025-07-16 13:27:37 -0600
commit6099a0a9ff1323e8bca426eb57651fac47dce0e9 (patch)
tree83e9e349befdbc369a62a61f2705691ead49e603 /src
parent7db4022711af526ed7606fef65d3ffa0017e8b25 (diff)
chore: add google type protos
Diffstat (limited to 'src')
-rw-r--r--src/rpc/mod.rs68
1 files changed, 50 insertions, 18 deletions
diff --git a/src/rpc/mod.rs b/src/rpc/mod.rs
index 44edacca..cbab1fb2 100644
--- a/src/rpc/mod.rs
+++ b/src/rpc/mod.rs
@@ -1,24 +1,56 @@
-// Simplified SpiceDB types for dependency injection demo
-#[derive(Debug, Clone, Default)]
-pub struct CheckPermissionRequest {
- pub resource: Option<ObjectReference>,
- pub permission: String,
- pub subject: Option<SubjectReference>,
+// Generated protobuf modules
+pub mod authzed {
+ pub mod api {
+ pub mod v1 {
+ include!("authzed.api.v1.rs");
+ }
+ pub mod materialize {
+ pub mod v0 {
+ include!("authzed.api.materialize.v0.rs");
+ }
+ }
+ }
}
-#[derive(Debug, Clone, Default)]
-pub struct CheckPermissionResponse {
- pub permissionship: i32, // 1 = HAS_PERMISSION, 2 = NO_PERMISSION
+pub mod envoy {
+ pub mod service {
+ pub mod auth {
+ pub mod v3 {
+ include!("envoy.service.auth.v3.rs");
+ }
+ }
+ }
+ pub mod extensions {
+ pub mod filters {
+ pub mod http {
+ pub mod ext_authz {
+ pub mod v3 {
+ include!("envoy.extensions.filters.http.ext_authz.v3.rs");
+ }
+ }
+ }
+ }
+ }
+ pub mod r#type {
+ pub mod v3 {
+ include!("envoy.type.v3.rs");
+ }
+ }
}
-#[derive(Debug, Clone, Default)]
-pub struct ObjectReference {
- pub object_type: String,
- pub object_id: String,
+// Use prost-types for Google protobuf types
+pub mod google {
+ pub mod protobuf {
+ // Re-export prost-types to match the generated code expectations
+ pub use prost_types::*;
+ }
+ pub mod rpc {
+ pub use prost_types::*;
+ }
}
-#[derive(Debug, Clone, Default)]
-pub struct SubjectReference {
- pub object: Option<ObjectReference>,
- pub optional_relation: String,
-} \ No newline at end of file
+// Re-export commonly used types
+pub use authzed::api::v1::*;
+pub use envoy::service::auth::v3::*;
+pub use google::protobuf::*;
+pub use google::rpc::*; \ No newline at end of file