Skip to content

Commit

Permalink
H-3552: graph: Integrate harpc into the graph (#5577)
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Diekmann <[email protected]>
  • Loading branch information
indietyp and TimDiekmann authored Nov 6, 2024
1 parent 7631610 commit 10447a2
Show file tree
Hide file tree
Showing 32 changed files with 1,815 additions and 59 deletions.
35 changes: 35 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion apps/hash-graph/libs/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@ graph = { workspace = true, public = true, features = ["utoipa"] }
graph-types = { workspace = true, public = true, features = ["utoipa"] }
hash-graph-store = { workspace = true, features = ["utoipa"] }
temporal-client = { workspace = true, public = true }
harpc-server = { workspace = true, public = true }
harpc-client = { workspace = true, public = true }

# Public third-party dependencies
axum = { workspace = true, public = true }
axum-core = { workspace = true, public = true }
http = { workspace = true, public = true }
tower-http = { workspace = true, public = true }
tracing = { workspace = true, public = true }
error-stack = { workspace = true, features = ["futures", "spantrace", "unstable"] }

# Private workspace dependencies
error-stack = { workspace = true, features = ["spantrace"] }
graph-type-defs = { workspace = true }
harpc-codec = { workspace = true }
harpc-service = { workspace = true }
harpc-tower = { workspace = true }
harpc-types = { workspace = true }
hash-status = { workspace = true }
temporal-versioning = { workspace = true }
type-system = { workspace = true, features = ["utoipa"] }
Expand All @@ -39,6 +45,10 @@ validation = { workspace = true, features = ["utoipa"] }
# Private third-party dependencies
async-trait = { workspace = true }
bytes = { workspace = true }
derive-where = { workspace = true }
derive_more = { version = "1.0.0", features = ["display", "error"] }
frunk = "0.4.3"
futures = { workspace = true }
hyper = { workspace = true }
include_dir = { workspace = true }
mime = { workspace = true }
Expand All @@ -48,6 +58,7 @@ sentry = { workspace = true }
serde = { workspace = true, features = ['derive'] }
serde_json = { workspace = true }
time = { workspace = true }
tower = { workspace = true }
tracing-opentelemetry = { workspace = true }
utoipa = { workspace = true }
uuid = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions apps/hash-graph/libs/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"@rust/graph": "0.0.0-private",
"@rust/graph-type-defs": "0.0.0-private",
"@rust/graph-types": "0.0.0-private",
"@rust/harpc-client": "0.0.0-private",
"@rust/harpc-codec": "0.0.0-private",
"@rust/harpc-server": "0.0.0-private",
"@rust/harpc-service": "0.0.0-private",
"@rust/harpc-tower": "0.0.0-private",
"@rust/harpc-types": "0.0.0-private",
"@rust/hash-graph-store": "0.0.0-private",
"@rust/hash-status": "0.0.0-private",
"@rust/temporal-client": "0.0.0-private",
Expand Down
8 changes: 7 additions & 1 deletion apps/hash-graph/libs/api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#![feature(impl_trait_in_assoc_type)]
#![feature(
impl_trait_in_assoc_type,
never_type,
return_type_notation,
error_generic_member_access
)]

extern crate alloc;

pub mod rest;
pub mod rpc;
6 changes: 3 additions & 3 deletions apps/hash-graph/libs/api/src/rest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use hash_graph_store::{
use hash_status::Status;
use include_dir::{Dir, include_dir};
use sentry::integrations::tower::{NewSentryLayer, SentryHttpLayer};
use serde::Serialize;
use serde::{Deserialize, Serialize};
use temporal_client::TemporalClient;
use temporal_versioning::{
ClosedTemporalBound, DecisionTime, LeftClosedTemporalInterval, LimitedTemporalBound,
Expand Down Expand Up @@ -116,9 +116,9 @@ impl<S> FromRequestParts<S> for AuthenticatedUserHeader {
}
}

#[derive(Debug, Serialize, ToSchema)]
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct PermissionResponse {
has_permission: bool,
pub has_permission: bool,
}

pub trait RestApiStore: Store + TypeFetcher {
Expand Down
Loading

0 comments on commit 10447a2

Please sign in to comment.