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/syn/src/parse_macro_input.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/syn/src/parse_macro_input.rs')
| -rw-r--r-- | vendor/syn/src/parse_macro_input.rs | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/vendor/syn/src/parse_macro_input.rs b/vendor/syn/src/parse_macro_input.rs deleted file mode 100644 index f0660aed..00000000 --- a/vendor/syn/src/parse_macro_input.rs +++ /dev/null @@ -1,128 +0,0 @@ -/// Parse the input TokenStream of a macro, triggering a compile error if the -/// tokens fail to parse. -/// -/// Refer to the [`parse` module] documentation for more details about parsing -/// in Syn. -/// -/// [`parse` module]: mod@crate::parse -/// -/// <br> -/// -/// # Intended usage -/// -/// This macro must be called from a function that returns -/// `proc_macro::TokenStream`. Usually this will be your proc macro entry point, -/// the function that has the #\[proc_macro\] / #\[proc_macro_derive\] / -/// #\[proc_macro_attribute\] attribute. -/// -/// ``` -/// # extern crate proc_macro; -/// # -/// use proc_macro::TokenStream; -/// use syn::{parse_macro_input, Result}; -/// use syn::parse::{Parse, ParseStream}; -/// -/// struct MyMacroInput { -/// /* ... */ -/// } -/// -/// impl Parse for MyMacroInput { -/// fn parse(input: ParseStream) -> Result<Self> { -/// /* ... */ -/// # Ok(MyMacroInput {}) -/// } -/// } -/// -/// # const IGNORE: &str = stringify! { -/// #[proc_macro] -/// # }; -/// pub fn my_macro(tokens: TokenStream) -> TokenStream { -/// let input = parse_macro_input!(tokens as MyMacroInput); -/// -/// /* ... */ -/// # TokenStream::new() -/// } -/// ``` -/// -/// <br> -/// -/// # Usage with Parser -/// -/// This macro can also be used with the [`Parser` trait] for types that have -/// multiple ways that they can be parsed. -/// -/// [`Parser` trait]: crate::parse::Parser -/// -/// ``` -/// # extern crate proc_macro; -/// # -/// # use proc_macro::TokenStream; -/// # use syn::{parse_macro_input, Result}; -/// # use syn::parse::ParseStream; -/// # -/// # struct MyMacroInput {} -/// # -/// impl MyMacroInput { -/// fn parse_alternate(input: ParseStream) -> Result<Self> { -/// /* ... */ -/// # Ok(MyMacroInput {}) -/// } -/// } -/// -/// # const IGNORE: &str = stringify! { -/// #[proc_macro] -/// # }; -/// pub fn my_macro(tokens: TokenStream) -> TokenStream { -/// let input = parse_macro_input!(tokens with MyMacroInput::parse_alternate); -/// -/// /* ... */ -/// # TokenStream::new() -/// } -/// ``` -/// -/// <br> -/// -/// # Expansion -/// -/// `parse_macro_input!($variable as $Type)` expands to something like: -/// -/// ```no_run -/// # extern crate proc_macro; -/// # -/// # macro_rules! doc_test { -/// # ($variable:ident as $Type:ty) => { -/// match syn::parse::<$Type>($variable) { -/// Ok(syntax_tree) => syntax_tree, -/// Err(err) => return proc_macro::TokenStream::from(err.to_compile_error()), -/// } -/// # }; -/// # } -/// # -/// # fn test(input: proc_macro::TokenStream) -> proc_macro::TokenStream { -/// # let _ = doc_test!(input as syn::Ident); -/// # proc_macro::TokenStream::new() -/// # } -/// ``` -#[macro_export] -#[cfg_attr(docsrs, doc(cfg(all(feature = "parsing", feature = "proc-macro"))))] -macro_rules! parse_macro_input { - ($tokenstream:ident as $ty:ty) => { - match $crate::parse::<$ty>($tokenstream) { - $crate::__private::Ok(data) => data, - $crate::__private::Err(err) => { - return $crate::__private::TokenStream::from(err.to_compile_error()); - } - } - }; - ($tokenstream:ident with $parser:path) => { - match $crate::parse::Parser::parse($parser, $tokenstream) { - $crate::__private::Ok(data) => data, - $crate::__private::Err(err) => { - return $crate::__private::TokenStream::from(err.to_compile_error()); - } - } - }; - ($tokenstream:ident) => { - $crate::parse_macro_input!($tokenstream as _) - }; -} |
