MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / store_edge_token

Function store_edge_token

crates/openshell-bootstrap/src/edge_token.rs:26–35  ·  view source on GitHub ↗

Store an edge authentication token for a gateway.

(gateway_name: &str, token: &str)

Source from the content-addressed store, hash-verified

24
25/// Store an edge authentication token for a gateway.
26pub fn store_edge_token(gateway_name: &str, token: &str) -> Result<()> {
27 let path = edge_token_path(gateway_name)?;
28 ensure_parent_dir_restricted(&path)?;
29 std::fs::write(&path, token)
30 .into_diagnostic()
31 .wrap_err_with(|| format!("failed to write edge token to {}", path.display()))?;
32 // Restrict permissions to owner-only (0600).
33 set_file_owner_only(&path)?;
34 Ok(())
35}
36
37/// Load a stored edge authentication token for a gateway.
38///

Callers 8

load_edge_tokenFunction · 0.85
gateway_addFunction · 0.85
gateway_loginFunction · 0.85

Calls 3

edge_token_pathFunction · 0.85
set_file_owner_onlyFunction · 0.85