'apikey' 或者 'oauth2Token'.
Optional位置: “cookie” | “query” | “header”
API密钥的传输路径。此信息可被忽略。 'oauth2Token'因为承载令牌(bearer token)总是通过 `Authorization` 头部进行传输。
Optional名称: string
头部信息(header)、查询参数(query parameter)或 Cookie 的名称。
OptionalcredentialValue: string
API密钥或令牌值。如果仅需要构建该方案(scheme),可以忽略此字段。
A [scheme, credential] `pair`。该凭证是…… undefined 当……的时候
credentialValue (注:原句中“is omitted”已被保留;如果需要进一步解释或补充内容,请提供更多背景信息。)
// API key in a header.
const [scheme, credential] = tokenToSchemeCredential(
'apikey', 'header', 'X-API-Key', 'your_api_key_value');
为 API 密钥或承载令牌(bearer token)创建相应的 `AuthScheme` 和 `AuthCredential` 对象。