Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

log a few errors that were dropped + atrium fork

atrium fork for the https handle method fix

Changed files
+148 -48
jetstream
slingshot
+108 -18
Cargo.lock
···
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46355d3245edc7b3160b2a45fe55d09a6963ebd3eee0252feb6b72fb0eb71463"
dependencies = [
-
"atrium-common",
-
"atrium-xrpc",
+
"atrium-common 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-xrpc 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
+
"chrono",
+
"http",
+
"ipld-core",
+
"langtag",
+
"regex",
+
"serde",
+
"serde_bytes",
+
"serde_json",
+
"thiserror 1.0.69",
+
"tokio",
+
"trait-variant",
+
]
+
+
[[package]]
+
name = "atrium-api"
+
version = "0.25.4"
+
source = "git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace#80a355991ac9b48ba3f559d12aac74f071fc638c"
+
dependencies = [
+
"atrium-common 0.1.2 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-xrpc 0.12.3 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
"chrono",
"http",
"ipld-core",
···
]
[[package]]
+
name = "atrium-common"
+
version = "0.1.2"
+
source = "git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace#80a355991ac9b48ba3f559d12aac74f071fc638c"
+
dependencies = [
+
"dashmap",
+
"lru",
+
"moka",
+
"thiserror 1.0.69",
+
"tokio",
+
"trait-variant",
+
"web-time",
+
]
+
+
[[package]]
name = "atrium-identity"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9e2d42bb4dbea038f4f5f45e3af2a89d61a9894a75f06aa550b74a60d2be380"
dependencies = [
-
"atrium-api",
-
"atrium-common",
-
"atrium-xrpc",
+
"atrium-api 0.25.4 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-common 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-xrpc 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
+
"serde",
+
"serde_html_form",
+
"serde_json",
+
"thiserror 1.0.69",
+
"trait-variant",
+
]
+
+
[[package]]
+
name = "atrium-identity"
+
version = "0.1.5"
+
source = "git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace#80a355991ac9b48ba3f559d12aac74f071fc638c"
+
dependencies = [
+
"atrium-api 0.25.4 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-common 0.1.2 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-xrpc 0.12.3 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
"serde",
"serde_html_form",
"serde_json",
···
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca22dc4eaf77fd9bf050b21192ac58cd654a437d28e000ec114ebd93a51d36f5"
dependencies = [
-
"atrium-api",
-
"atrium-common",
-
"atrium-identity",
-
"atrium-xrpc",
+
"atrium-api 0.25.4 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-common 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-identity 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-xrpc 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
+
"base64 0.22.1",
+
"chrono",
+
"dashmap",
+
"ecdsa",
+
"elliptic-curve",
+
"jose-jwa",
+
"jose-jwk",
+
"p256",
+
"rand 0.8.5",
+
"reqwest",
+
"serde",
+
"serde_html_form",
+
"serde_json",
+
"sha2",
+
"thiserror 1.0.69",
+
"tokio",
+
"trait-variant",
+
]
+
+
[[package]]
+
name = "atrium-oauth"
+
version = "0.1.3"
+
source = "git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace#80a355991ac9b48ba3f559d12aac74f071fc638c"
+
dependencies = [
+
"atrium-api 0.25.4 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-common 0.1.2 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-identity 0.1.5 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-xrpc 0.12.3 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
"base64 0.22.1",
"chrono",
"dashmap",
···
]
[[package]]
+
name = "atrium-xrpc"
+
version = "0.12.3"
+
source = "git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace#80a355991ac9b48ba3f559d12aac74f071fc638c"
+
dependencies = [
+
"http",
+
"serde",
+
"serde_html_form",
+
"serde_json",
+
"thiserror 1.0.69",
+
"trait-variant",
+
]
+
+
[[package]]
name = "auto_enums"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
dependencies = [
"anyhow",
"async-trait",
-
"atrium-api",
+
"atrium-api 0.25.4 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
"chrono",
"clap",
"futures-util",
···
name = "slingshot"
version = "0.1.0"
dependencies = [
-
"atrium-api",
-
"atrium-common",
-
"atrium-identity",
-
"atrium-oauth",
+
"atrium-api 0.25.4 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-common 0.1.2 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-identity 0.1.5 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
+
"atrium-oauth 0.1.3 (git+https://github.com/uniphil/atrium.git?branch=fix%2Fresolve-handle-https-accept-whitespace)",
"clap",
"ctrlc",
"foyer",
···
name = "who-am-i"
version = "0.1.0"
dependencies = [
-
"atrium-api",
-
"atrium-common",
-
"atrium-identity",
-
"atrium-oauth",
+
"atrium-api 0.25.4 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-common 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-identity 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+
"atrium-oauth 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"axum",
"axum-extra",
"axum-template",
+1 -1
jetstream/Cargo.toml
···
[dependencies]
async-trait = "0.1.83"
-
atrium-api = { version = "0.25.4", default-features = false, features = [
+
atrium-api = { git = "https://github.com/uniphil/atrium.git", branch = "fix/resolve-handle-https-accept-whitespace", default-features = false, features = [
"namespace-appbsky",
] }
tokio = { version = "1.44.2", features = ["full", "sync", "time"] }
+4 -4
slingshot/Cargo.toml
···
edition = "2024"
[dependencies]
-
atrium-api = { version = "0.25.4", default-features = false }
-
atrium-common = "0.1.2"
-
atrium-identity = "0.1.5"
-
atrium-oauth = "0.1.3"
+
atrium-api = { git = "https://github.com/uniphil/atrium.git", branch = "fix/resolve-handle-https-accept-whitespace", default-features = false }
+
atrium-common = { git = "https://github.com/uniphil/atrium.git", branch = "fix/resolve-handle-https-accept-whitespace" }
+
atrium-identity = { git = "https://github.com/uniphil/atrium.git", branch = "fix/resolve-handle-https-accept-whitespace" }
+
atrium-oauth = { git = "https://github.com/uniphil/atrium.git", branch = "fix/resolve-handle-https-accept-whitespace" }
clap = { version = "4.5.41", features = ["derive"] }
ctrlc = "3.4.7"
foyer = { version = "0.18.0", features = ["serde"] }
+4 -3
slingshot/src/identity.rs
···
Err(atrium_identity::Error::NotFound) => {
Ok(IdentityVal(UtcDateTime::now(), IdentityData::NotFound))
}
-
Err(other) => Err(foyer::Error::Other(Box::new(
-
IdentityError::ResolutionFailed(other),
-
))),
+
Err(other) => Err(foyer::Error::Other(Box::new({
+
log::debug!("other error resolving handle: {other:?}");
+
IdentityError::ResolutionFailed(other)
+
}))),
}
}
})
+31 -22
slingshot/src/server.rs
···
let Ok(alleged_handle) = Handle::new(identifier) else {
return invalid("identifier was not a valid DID or handle");
};
-
if let Ok(res) = self.identity.handle_to_did(alleged_handle.clone()).await {
-
if let Some(did) = res {
-
// we did it joe
-
unverified_handle = Some(alleged_handle);
-
did
-
} else {
-
return invalid("Could not resolve handle identifier to a DID");
+
+
match self.identity.handle_to_did(alleged_handle.clone()).await {
+
Ok(res) => {
+
if let Some(did) = res {
+
// we did it joe
+
unverified_handle = Some(alleged_handle);
+
did
+
} else {
+
return invalid("Could not resolve handle identifier to a DID");
+
}
+
}
+
Err(e) => {
+
log::debug!("failed to resolve handle: {e}");
+
// TODO: ServerError not BadRequest
+
return invalid("errored while trying to resolve handle to DID");
}
-
} else {
-
// TODO: ServerError not BadRequest
-
return invalid("errored while trying to resolve handle to DID");
}
}
};
···
"repo was not a valid DID or handle",
));
};
-
if let Ok(res) = self.identity.handle_to_did(handle).await {
-
if let Some(did) = res {
-
did
-
} else {
-
return GetRecordResponse::BadRequest(xrpc_error(
-
"InvalidRequest",
-
"Could not resolve handle repo to a DID",
+
match self.identity.handle_to_did(handle).await {
+
Ok(res) => {
+
if let Some(did) = res {
+
did
+
} else {
+
return GetRecordResponse::BadRequest(xrpc_error(
+
"InvalidRequest",
+
"Could not resolve handle repo to a DID",
+
));
+
}
+
}
+
Err(e) => {
+
log::debug!("handle resolution failed: {e}");
+
return GetRecordResponse::ServerError(xrpc_error(
+
"ResolutionFailed",
+
"errored while trying to resolve handle to DID",
));
}
-
} else {
-
return GetRecordResponse::ServerError(xrpc_error(
-
"ResolutionFailed",
-
"errored while trying to resolve handle to DID",
-
));
}
}
};