pub fn parse_tokens_env(env_value: &str) -> ParsedTokensExpand description
Parse the TENSOR_WASM_API_TOKENS env-var value into a map of bearer →
scope, plus a count of legacy (bare) entries that were coerced to the
wildcard scope.
The input may mix the two entry shapes freely. Splitting is two-pass:
- Split on commas to obtain raw fragments.
- Walk fragments left to right, re-joining any fragment that does not
contain a
:and follows an entry whose scope clause wastenant=(a continuation of the tenant list).
Entries that fail parse_token_entry are dropped with a
tracing::warn! so a malformed entry never causes the gateway to refuse
to start. The remaining valid entries are returned in ParsedTokens.