summaryrefslogtreecommitdiff
path: root/vendor/hyper-timeout/examples/client.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/hyper-timeout/examples/client.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/hyper-timeout/examples/client.rs')
-rw-r--r--vendor/hyper-timeout/examples/client.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/vendor/hyper-timeout/examples/client.rs b/vendor/hyper-timeout/examples/client.rs
deleted file mode 100644
index 0e75c9c5..00000000
--- a/vendor/hyper-timeout/examples/client.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-use std::env;
-use std::time::Duration;
-
-use http_body_util::{BodyExt, Empty};
-use hyper::body::Bytes;
-use hyper_util::{client::legacy::Client, rt::TokioExecutor};
-use tokio::io::{self, AsyncWriteExt};
-
-use hyper_tls::HttpsConnector;
-
-use hyper_timeout::TimeoutConnector;
-
-#[tokio::main(flavor = "current_thread")]
-async fn main() -> Result<(), Box<dyn std::error::Error>> {
- let url = match env::args().nth(1) {
- Some(url) => url,
- None => {
- println!("Usage: client <url>");
- println!("Example: client https://example.com");
- return Ok(());
- }
- };
-
- let url = url.parse::<hyper::Uri>().unwrap();
-
- // This example uses `HttpsConnector`, but you can also use hyper `HttpConnector`
- //let h = hyper_util::client::legacy::connect::HttpConnector::new();
- let h = HttpsConnector::new();
- let mut connector = TimeoutConnector::new(h);
- connector.set_connect_timeout(Some(Duration::from_secs(5)));
- connector.set_read_timeout(Some(Duration::from_secs(5)));
- connector.set_write_timeout(Some(Duration::from_secs(5)));
- let client = Client::builder(TokioExecutor::new()).build::<_, Empty<Bytes>>(connector);
-
- let mut res = client.get(url).await?;
-
- println!("Status: {}", res.status());
- println!("Headers:\n{:#?}", res.headers());
-
- while let Some(frame) = res.body_mut().frame().await {
- let bytes = frame?
- .into_data()
- .map_err(|_| io::Error::new(io::ErrorKind::Other, "Error when consuming frame"))?;
- io::stdout().write_all(&bytes).await?;
- }
-
- Ok(())
-}