tangled
alpha
login
or
join now
vielle.dev
/
tangled-on-commit
5
fork
atom
Listen to git commits for a specific repo and run a shell command
5
fork
atom
overview
issues
pulls
pipelines
cargo fmt
vielle.dev
6 months ago
a7bb68a5
29c04a75
verified
This commit was signed with the committer's
known signature
.
vielle.dev
SSH Key Fingerprint:
SHA256:/4bvxqoEh9iMdjAPgcgAgXKZZQTROL3ULiPt6nH9RSs=
+15
-9
1 changed file
expand all
collapse all
unified
split
src
did.rs
+15
-9
src/did.rs
···
38
}
39
40
fn get_http_did(handle: &String) -> Result<String, ()> {
41
-
let res = match reqwest::blocking::get("https://".to_owned() + handle + "/.well-known/atproto-did") {
42
-
Ok(val) => val,
43
-
Err(_) => return Err(())
44
-
};
0
45
46
// as per spec, non 2xx code means failure
47
-
if !res.status().is_success() { return Err(()) }
0
0
48
49
let did_unparsed = match res.text() {
50
-
Ok(val) => val,
51
-
Err(_) => return Err(())
52
};
53
54
let did = did_unparsed.trim();
55
56
-
if !did.starts_with("did:") { return Err(()) };
57
-
return Ok(String::from(did))
0
0
0
58
}
59
60
pub fn get_did(handle: String) -> Result<DidDoc, ()> {
···
38
}
39
40
fn get_http_did(handle: &String) -> Result<String, ()> {
41
+
let res =
42
+
match reqwest::blocking::get("https://".to_owned() + handle + "/.well-known/atproto-did") {
43
+
Ok(val) => val,
44
+
Err(_) => return Err(()),
45
+
};
46
47
// as per spec, non 2xx code means failure
48
+
if !res.status().is_success() {
49
+
return Err(());
50
+
}
51
52
let did_unparsed = match res.text() {
53
+
Ok(val) => val,
54
+
Err(_) => return Err(()),
55
};
56
57
let did = did_unparsed.trim();
58
59
+
if !did.starts_with("did:") {
60
+
return Err(());
61
+
};
62
+
return Ok(String::from(did));
63
+
}
64
}
65
66
pub fn get_did(handle: String) -> Result<DidDoc, ()> {