MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / server_decoding_key

Method server_decoding_key

crates/cli/src/config.rs:747–765  ·  view source on GitHub ↗
(&self, server: Option<&str>)

Source from the content-addressed store, hash-verified

745 }
746
747 pub fn server_decoding_key(&self, server: Option<&str>) -> anyhow::Result<DecodingKey> {
748 self.server_fingerprint(server).and_then(|fing| {
749 if let Some(fing) = fing {
750 DecodingKey::from_ec_pem(fing.as_bytes()).with_context(|| {
751 format!(
752 "Unable to parse invalid saved server fingerprint as ECDSA public key.
753Update the server's fingerprint with:
754\tspacetime server fingerprint {}",
755 server.unwrap_or("")
756 )
757 })
758 } else {
759 Err(anyhow::anyhow!(
760 "No fingerprint saved for server: {}",
761 self.server_nick_or_host(server)?,
762 ))
763 }
764 })
765 }
766
767 pub fn server_nick_or_host<'a>(&'a self, server: Option<&'a str>) -> anyhow::Result<&'a str> {
768 if let Some(server) = server {

Callers

nothing calls this directly

Calls 3

server_fingerprintMethod · 0.80
ErrFunction · 0.50
as_bytesMethod · 0.45

Tested by

no test coverage detected