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/string_cache/src/trivial_impls.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/string_cache/src/trivial_impls.rs')
| -rw-r--r-- | vendor/string_cache/src/trivial_impls.rs | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/vendor/string_cache/src/trivial_impls.rs b/vendor/string_cache/src/trivial_impls.rs deleted file mode 100644 index 960dde0d..00000000 --- a/vendor/string_cache/src/trivial_impls.rs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2014 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use crate::{Atom, StaticAtomSet}; -#[cfg(feature = "serde_support")] -use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use std::borrow::Cow; -use std::fmt; - -impl<Static: StaticAtomSet> ::precomputed_hash::PrecomputedHash for Atom<Static> { - fn precomputed_hash(&self) -> u32 { - self.get_hash() - } -} - -impl<'a, Static: StaticAtomSet> From<&'a Atom<Static>> for Atom<Static> { - fn from(atom: &'a Self) -> Self { - atom.clone() - } -} - -impl<Static: StaticAtomSet> PartialEq<str> for Atom<Static> { - fn eq(&self, other: &str) -> bool { - &self[..] == other - } -} - -impl<Static: StaticAtomSet> PartialEq<Atom<Static>> for str { - fn eq(&self, other: &Atom<Static>) -> bool { - self == &other[..] - } -} - -impl<Static: StaticAtomSet> PartialEq<String> for Atom<Static> { - fn eq(&self, other: &String) -> bool { - self[..] == other[..] - } -} - -impl<'a, Static: StaticAtomSet> From<&'a str> for Atom<Static> { - #[inline] - fn from(string_to_add: &str) -> Self { - Atom::from(Cow::Borrowed(string_to_add)) - } -} - -impl<Static: StaticAtomSet> From<String> for Atom<Static> { - #[inline] - fn from(string_to_add: String) -> Self { - Atom::from(Cow::Owned(string_to_add)) - } -} - -impl<Static: StaticAtomSet> fmt::Display for Atom<Static> { - #[inline] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - <str as fmt::Display>::fmt(self, f) - } -} - -impl<Static: StaticAtomSet> AsRef<str> for Atom<Static> { - fn as_ref(&self) -> &str { - self - } -} - -#[cfg(feature = "serde_support")] -impl<Static: StaticAtomSet> Serialize for Atom<Static> { - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> - where - S: Serializer, - { - let string: &str = self.as_ref(); - string.serialize(serializer) - } -} - -#[cfg(feature = "serde_support")] -impl<'a, Static: StaticAtomSet> Deserialize<'a> for Atom<Static> { - fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> - where - D: Deserializer<'a>, - { - use serde::de; - use std::marker::PhantomData; - - struct AtomVisitor<Static: StaticAtomSet>(PhantomData<Static>); - - impl<'de, Static: StaticAtomSet> de::Visitor<'de> for AtomVisitor<Static> { - type Value = Atom<Static>; - - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "an Atom") - } - - fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> - where - E: de::Error, - { - Ok(Atom::from(v)) - } - - fn visit_string<E>(self, v: String) -> Result<Self::Value, E> - where - E: de::Error, - { - Ok(Atom::from(v)) - } - } - - deserializer.deserialize_str(AtomVisitor(PhantomData)) - } -} |
