MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / issue_token

Function issue_token

nodedb-cluster/src/auth/join_token.rs:68–75  ·  view source on GitHub ↗

Convenience: issue a token and return it as a lowercase hex string.

(
    secret: &[u8; 32],
    for_node: u64,
    expiry_unix_secs: u64,
)

Source from the content-addressed store, hash-verified

66
67/// Convenience: issue a token and return it as a lowercase hex string.
68pub fn issue_token(
69 secret: &[u8; 32],
70 for_node: u64,
71 expiry_unix_secs: u64,
72) -> Result<String, TokenError> {
73 let bytes = issue_token_bytes(secret, for_node, expiry_unix_secs)?;
74 Ok(token_to_hex(&bytes))
75}
76
77/// Encode raw token bytes as a lowercase hex string.
78pub fn token_to_hex(bytes: &[u8]) -> String {

Callers 12

rejects_tampered_macFunction · 0.85
rejects_wrong_secretFunction · 0.85
rejects_expiredFunction · 0.85
token_hash_stableFunction · 0.85
mint_tokenFunction · 0.85
createFunction · 0.85
verify_rejects_expiredFunction · 0.85

Calls 2

issue_token_bytesFunction · 0.85
token_to_hexFunction · 0.85