summaryrefslogtreecommitdiff
path: root/vendor/syn/tests/test_parse_quote.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-15 16:37:08 -0600
committermo khan <mo@mokhan.ca>2025-07-17 16:30:22 -0600
commit45df4d0d9b577fecee798d672695fe24ff57fb1b (patch)
tree1b99bf645035b58e0d6db08c7a83521f41f7a75b /vendor/syn/tests/test_parse_quote.rs
parentf94f79608393d4ab127db63cc41668445ef6b243 (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/tests/test_parse_quote.rs')
-rw-r--r--vendor/syn/tests/test_parse_quote.rs170
1 files changed, 0 insertions, 170 deletions
diff --git a/vendor/syn/tests/test_parse_quote.rs b/vendor/syn/tests/test_parse_quote.rs
deleted file mode 100644
index 33665e06..00000000
--- a/vendor/syn/tests/test_parse_quote.rs
+++ /dev/null
@@ -1,170 +0,0 @@
-#![allow(
- clippy::elidable_lifetime_names,
- clippy::needless_lifetimes,
- clippy::uninlined_format_args
-)]
-
-#[macro_use]
-mod macros;
-
-use syn::punctuated::Punctuated;
-use syn::{parse_quote, Attribute, Field, Lit, Pat, Stmt, Token};
-
-#[test]
-fn test_attribute() {
- let attr: Attribute = parse_quote!(#[test]);
- snapshot!(attr, @r#"
- Attribute {
- style: AttrStyle::Outer,
- meta: Meta::Path {
- segments: [
- PathSegment {
- ident: "test",
- },
- ],
- },
- }
- "#);
-
- let attr: Attribute = parse_quote!(#![no_std]);
- snapshot!(attr, @r#"
- Attribute {
- style: AttrStyle::Inner,
- meta: Meta::Path {
- segments: [
- PathSegment {
- ident: "no_std",
- },
- ],
- },
- }
- "#);
-}
-
-#[test]
-fn test_field() {
- let field: Field = parse_quote!(pub enabled: bool);
- snapshot!(field, @r#"
- Field {
- vis: Visibility::Public,
- ident: Some("enabled"),
- colon_token: Some,
- ty: Type::Path {
- path: Path {
- segments: [
- PathSegment {
- ident: "bool",
- },
- ],
- },
- },
- }
- "#);
-
- let field: Field = parse_quote!(primitive::bool);
- snapshot!(field, @r#"
- Field {
- vis: Visibility::Inherited,
- ty: Type::Path {
- path: Path {
- segments: [
- PathSegment {
- ident: "primitive",
- },
- Token![::],
- PathSegment {
- ident: "bool",
- },
- ],
- },
- },
- }
- "#);
-}
-
-#[test]
-fn test_pat() {
- let pat: Pat = parse_quote!(Some(false) | None);
- snapshot!(&pat, @r#"
- Pat::Or {
- cases: [
- Pat::TupleStruct {
- path: Path {
- segments: [
- PathSegment {
- ident: "Some",
- },
- ],
- },
- elems: [
- Pat::Lit(ExprLit {
- lit: Lit::Bool {
- value: false,
- },
- }),
- ],
- },
- Token![|],
- Pat::Ident {
- ident: "None",
- },
- ],
- }
- "#);
-
- let boxed_pat: Box<Pat> = parse_quote!(Some(false) | None);
- assert_eq!(*boxed_pat, pat);
-}
-
-#[test]
-fn test_punctuated() {
- let punctuated: Punctuated<Lit, Token![|]> = parse_quote!(true | true);
- snapshot!(punctuated, @r#"
- [
- Lit::Bool {
- value: true,
- },
- Token![|],
- Lit::Bool {
- value: true,
- },
- ]
- "#);
-
- let punctuated: Punctuated<Lit, Token![|]> = parse_quote!(true | true |);
- snapshot!(punctuated, @r#"
- [
- Lit::Bool {
- value: true,
- },
- Token![|],
- Lit::Bool {
- value: true,
- },
- Token![|],
- ]
- "#);
-}
-
-#[test]
-fn test_vec_stmt() {
- let stmts: Vec<Stmt> = parse_quote! {
- let _;
- true
- };
- snapshot!(stmts, @r#"
- [
- Stmt::Local {
- pat: Pat::Wild,
- },
- Stmt::Expr(
- Expr::Lit {
- lit: Lit::Bool {
- value: true,
- },
- },
- None,
- ),
- ]
- "#);
-}