public class DynamicKeyOpenAiAuthInterceptor extends OpenAiAuthInterceptor
| Constructor and Description |
|---|
DynamicKeyOpenAiAuthInterceptor()
请求头处理
|
DynamicKeyOpenAiAuthInterceptor(Map warringConfig)
构造方法
|
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Request |
auth(String key,
okhttp3.Request original)
默认的鉴权处理方法
|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
protected void |
noHaveActiveKeyWarring()
所有的key都失效后,自定义预警配置
不配置直接return
|
protected List<String> |
onErrorDealApiKeys(String errorKey)
自定义apiKeys的处理逻辑
|
getKeypublic DynamicKeyOpenAiAuthInterceptor()
public DynamicKeyOpenAiAuthInterceptor(Map warringConfig)
warringConfig - 所有的key都失效后的告警参数配置public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
IOExceptionprotected List<String> onErrorDealApiKeys(String errorKey)
OpenAiAuthInterceptoronErrorDealApiKeys in class OpenAiAuthInterceptorerrorKey - 错误的keyprotected void noHaveActiveKeyWarring()
noHaveActiveKeyWarring in class OpenAiAuthInterceptorpublic okhttp3.Request auth(String key, okhttp3.Request original)
OpenAiAuthInterceptorauth in class OpenAiAuthInterceptorkey - api keyoriginal - 源请求体Copyright © 2023 grt1228. All rights reserved.