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/hyper/src/common/time.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/hyper/src/common/time.rs')
| -rw-r--r-- | vendor/hyper/src/common/time.rs | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/vendor/hyper/src/common/time.rs b/vendor/hyper/src/common/time.rs deleted file mode 100644 index a8d3cc9c..00000000 --- a/vendor/hyper/src/common/time.rs +++ /dev/null @@ -1,79 +0,0 @@ -#[cfg(any( - all(any(feature = "client", feature = "server"), feature = "http2"), - all(feature = "server", feature = "http1"), -))] -use std::time::Duration; -use std::{fmt, sync::Arc}; -use std::{pin::Pin, time::Instant}; - -use crate::rt::Sleep; -use crate::rt::Timer; - -/// A user-provided timer to time background tasks. -#[derive(Clone)] -pub(crate) enum Time { - Timer(Arc<dyn Timer + Send + Sync>), - Empty, -} - -#[cfg(all(feature = "server", feature = "http1"))] -#[derive(Clone, Copy, Debug)] -pub(crate) enum Dur { - Default(Option<Duration>), - Configured(Option<Duration>), -} - -impl fmt::Debug for Time { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("Time").finish() - } -} - -impl Time { - #[cfg(all(any(feature = "client", feature = "server"), feature = "http2"))] - pub(crate) fn sleep(&self, duration: Duration) -> Pin<Box<dyn Sleep>> { - match *self { - Time::Empty => { - panic!("You must supply a timer.") - } - Time::Timer(ref t) => t.sleep(duration), - } - } - - #[cfg(feature = "http1")] - pub(crate) fn sleep_until(&self, deadline: Instant) -> Pin<Box<dyn Sleep>> { - match *self { - Time::Empty => { - panic!("You must supply a timer.") - } - Time::Timer(ref t) => t.sleep_until(deadline), - } - } - - pub(crate) fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant) { - match *self { - Time::Empty => { - panic!("You must supply a timer.") - } - Time::Timer(ref t) => t.reset(sleep, new_deadline), - } - } - - #[cfg(all(feature = "server", feature = "http1"))] - pub(crate) fn check(&self, dur: Dur, name: &'static str) -> Option<Duration> { - match dur { - Dur::Default(Some(dur)) => match self { - Time::Empty => { - warn!("timeout `{}` has default, but no timer set", name,); - None - } - Time::Timer(..) => Some(dur), - }, - Dur::Configured(Some(dur)) => match self { - Time::Empty => panic!("timeout `{}` set, but no timer set", name,), - Time::Timer(..) => Some(dur), - }, - Dur::Default(None) | Dur::Configured(None) => None, - } - } -} |
