认证凭证语义
本文档定义了在以下场景中使用的规范凭证资格和解析语义:resolveAuthProfileOrderresolveApiKeyForProfilemodels status --probedoctor-auth
稳定的原因代码
okmissing_credentialinvalid_expiresexpiredunresolved_ref
令牌凭证
令牌凭证(type: "token")支持内联 token 和/或 tokenRef。
资格规则
- 当
token和tokenRef均缺失时,令牌配置不可用。 expires是可选的。- 如果存在
expires,它必须是大于0的有限数字。 - 如果
expires无效(NaN、0、负数、非有限数或类型错误),则配置因invalid_expires不可用。 - 如果
expires已经过期,配置因expired不可用。 tokenRef不可跳过expires验证。
解析规则
- 解析器语义与
expires的资格语义相匹配。 - 对于合格的配置,可以从内联值或
tokenRef中解析令牌内容。 - 无法解析的引用在
models status --probe输出中产生unresolved_ref。
向后兼容消息
为兼容脚本,探测错误保持首行不变:Auth profile credentials are missing or expired.
接下来的行可以添加易读的详细信息和稳定的原因代码。