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

Function load_oidc_token

crates/openshell-bootstrap/src/oidc_token.rs:59–66  ·  view source on GitHub ↗

Load a stored OIDC token bundle for a gateway. Returns `None` if the token file does not exist or cannot be parsed.

(gateway_name: &str)

Source from the content-addressed store, hash-verified

57///
58/// Returns `None` if the token file does not exist or cannot be parsed.
59pub fn load_oidc_token(gateway_name: &str) -> Option<OidcTokenBundle> {
60 let path = oidc_token_path(gateway_name).ok()?;
61 if !path.exists() {
62 return None;
63 }
64 let contents = std::fs::read_to_string(&path).ok()?;
65 serde_json::from_str(&contents).ok()
66}
67
68/// Remove a stored OIDC token.
69pub fn remove_oidc_token(gateway_name: &str) -> Result<()> {

Callers 4

connect_to_gatewayFunction · 0.85
ensure_valid_oidc_tokenFunction · 0.85
apply_authFunction · 0.85
completion_grpc_clientFunction · 0.85

Calls 2

oidc_token_pathFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected