diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-15 16:37:08 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-17 16:30:22 -0600 |
| commit | 45df4d0d9b577fecee798d672695fe24ff57fb1b (patch) | |
| tree | 1b99bf645035b58e0d6db08c7a83521f41f7a75b /vendor/logos-codegen/src/generator/rope.rs | |
| parent | f94f79608393d4ab127db63cc41668445ef6b243 (diff) | |
feat: migrate from Cedar to SpiceDB authorization system
This is a major architectural change that replaces the Cedar policy-based
authorization system with SpiceDB's relation-based authorization.
Key changes:
- Migrate from Rust to Go implementation
- Replace Cedar policies with SpiceDB schema and relationships
- Switch from envoy `ext_authz` with Cedar to SpiceDB permission checks
- Update build system and dependencies for Go ecosystem
- Maintain Envoy integration for external authorization
This change enables more flexible permission modeling through SpiceDB's
Google Zanzibar inspired relation-based system, supporting complex
hierarchical permissions that were difficult to express in Cedar.
Breaking change: Existing Cedar policies and Rust-based configuration
will no longer work and need to be migrated to SpiceDB schema.
Diffstat (limited to 'vendor/logos-codegen/src/generator/rope.rs')
| -rw-r--r-- | vendor/logos-codegen/src/generator/rope.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/vendor/logos-codegen/src/generator/rope.rs b/vendor/logos-codegen/src/generator/rope.rs deleted file mode 100644 index ae3b07ad..00000000 --- a/vendor/logos-codegen/src/generator/rope.rs +++ /dev/null @@ -1,39 +0,0 @@ -use proc_macro2::TokenStream; -use quote::quote; - -use crate::generator::{Context, Generator}; -use crate::graph::Rope; - -impl Generator<'_> { - pub fn generate_rope(&mut self, rope: &Rope, mut ctx: Context) -> TokenStream { - let miss = ctx.miss(rope.miss.first(), self); - let read = ctx.read(rope.pattern.len()); - let then = self.goto(rope.then, ctx.advance(rope.pattern.len())); - - let pat = match rope.pattern.to_bytes() { - Some(bytes) => byte_slice_literal(&bytes), - None => { - let ranges = rope.pattern.iter(); - - quote!([#(#ranges),*]) - } - }; - - quote! { - match #read { - Some(#pat) => #then, - _ => #miss, - } - } - } -} - -fn byte_slice_literal(bytes: &[u8]) -> TokenStream { - if bytes.iter().any(|&b| !(0x20..0x7F).contains(&b)) { - return quote!(&[#(#bytes),*]); - } - - let slice = std::str::from_utf8(bytes).unwrap(); - - syn::parse_str(&format!("b{:?}", slice)).unwrap() -} |
