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

Method get

crates/openshell-supervisor-network/src/token_grant.rs:104–113  ·  view source on GitHub ↗

Get a cached token if it exists and is not expired.

(&self, provider_name: &str)

Source from the content-addressed store, hash-verified

102
103 /// Get a cached token if it exists and is not expired.
104 fn get(&self, provider_name: &str) -> Option<String> {
105 let now_ms = current_time_ms();
106 let tokens = self.tokens.read().ok()?;
107 let cached = tokens.get(provider_name)?;
108 if cached.expires_at_ms > now_ms {
109 Some(cached.access_token.clone())
110 } else {
111 None
112 }
113 }
114
115 /// Store a token with expiration time.
116 fn set(&self, provider_name: String, access_token: String, expires_at_ms: i64) {

Callers 15

get_strFunction · 0.45
get_boolFunction · 0.45
get_str_arrayFunction · 0.45
normalize_endpoint_portsFunction · 0.45
get_object_boolFunction · 0.45

Calls 2

current_time_msFunction · 0.70
readMethod · 0.45