From 45df4d0d9b577fecee798d672695fe24ff57fb1b Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 15 Jul 2025 16:37:08 -0600 Subject: 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. --- vendor/logos-codegen/src/leaf.rs | 118 --------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 vendor/logos-codegen/src/leaf.rs (limited to 'vendor/logos-codegen/src/leaf.rs') diff --git a/vendor/logos-codegen/src/leaf.rs b/vendor/logos-codegen/src/leaf.rs deleted file mode 100644 index 5e0b810e..00000000 --- a/vendor/logos-codegen/src/leaf.rs +++ /dev/null @@ -1,118 +0,0 @@ -use std::cmp::{Ord, Ordering}; -use std::fmt::{self, Debug, Display}; - -use proc_macro2::{Span, TokenStream}; -use syn::{spanned::Spanned, Ident}; - -use crate::graph::{Disambiguate, Node}; -use crate::util::MaybeVoid; - -#[derive(Clone)] -pub struct Leaf<'t> { - pub ident: Option<&'t Ident>, - pub span: Span, - pub priority: usize, - pub field: MaybeVoid, - pub callback: Option, -} - -#[derive(Clone)] -pub enum Callback { - Label(TokenStream), - Inline(Box), - Skip(Span), -} - -#[derive(Clone)] -pub struct InlineCallback { - pub arg: Ident, - pub body: TokenStream, - pub span: Span, -} - -impl From for Callback { - fn from(inline: InlineCallback) -> Callback { - Callback::Inline(Box::new(inline)) - } -} - -impl Callback { - pub fn span(&self) -> Span { - match self { - Callback::Label(tokens) => tokens.span(), - Callback::Inline(inline) => inline.span, - Callback::Skip(span) => *span, - } - } -} - -impl<'t> Leaf<'t> { - pub fn new(ident: &'t Ident, span: Span) -> Self { - Leaf { - ident: Some(ident), - span, - priority: 0, - field: MaybeVoid::Void, - callback: None, - } - } - - pub fn new_skip(span: Span) -> Self { - Leaf { - ident: None, - span, - priority: 0, - field: MaybeVoid::Void, - callback: Some(Callback::Skip(span)), - } - } - - pub fn callback(mut self, callback: Option) -> Self { - self.callback = callback; - self - } - - pub fn field(mut self, field: MaybeVoid) -> Self { - self.field = field; - self - } - - pub fn priority(mut self, priority: usize) -> Self { - self.priority = priority; - self - } -} - -impl Disambiguate for Leaf<'_> { - fn cmp(left: &Leaf, right: &Leaf) -> Ordering { - Ord::cmp(&left.priority, &right.priority) - } -} - -impl<'t> From> for Node> { - fn from(leaf: Leaf<'t>) -> Self { - Node::Leaf(leaf) - } -} - -impl Debug for Leaf<'_> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "::{}", self)?; - - match self.callback { - Some(Callback::Label(ref label)) => write!(f, " ({})", label), - Some(Callback::Inline(_)) => f.write_str(" ()"), - Some(Callback::Skip(_)) => f.write_str(" ()"), - None => Ok(()), - } - } -} - -impl Display for Leaf<'_> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self.ident { - Some(ident) => Display::fmt(ident, f), - None => f.write_str(""), - } - } -} -- cgit v1.2.3