MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / extract_account_uri

Function extract_account_uri

gateway/src/distributed_certbot.rs:510–520  ·  view source on GitHub ↗

Extract account_id (URI) from ACME credentials JSON

(credentials_json: &str)

Source from the content-addressed store, hash-verified

508
509/// Extract account_id (URI) from ACME credentials JSON
510fn extract_account_uri(credentials_json: &str) -> Option<String> {
511 #[derive(serde::Deserialize)]
512 struct Creds {
513 #[serde(default)]
514 account_id: String,
515 }
516 serde_json::from_str::<Creds>(credentials_json)
517 .ok()
518 .filter(|c| !c.account_id.is_empty())
519 .map(|c| c.account_id)
520}

Callers 1

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected