From 6099a0a9ff1323e8bca426eb57651fac47dce0e9 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 16 Jul 2025 13:27:37 -0600 Subject: chore: add google type protos --- src/rpc/mod.rs | 68 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 18 deletions(-) (limited to 'src') 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, - pub permission: String, - pub subject: Option, +// 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, - 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 -- cgit v1.2.3