Interface AlmanacCredentials
- All Known Implementing Classes:
ApiKeyCredentials
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Almanac 認證策略
將認證資訊(HTTP header)套用到送往 almanac 的請求上。框架內建
ApiKeyCredentials(X-Almanac-Api-Key 標頭)作為預設實作;保留此介面
是為了讓未來能擴充 almanac 的 service account(OAuth2 client-credentials →
Bearer token)等其他認證方式,消費端只需提供對應的實作即可。
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.apache.hc.core5.http.ClassicHttpRequest request) 套用認證到請求(通常是設定一個或多個 HTTP 標頭)
-
Method Details
-
apply
void apply(org.apache.hc.core5.http.ClassicHttpRequest request) 套用認證到請求(通常是設定一個或多個 HTTP 標頭)- Parameters:
request- 即將送出的 HTTP 請求
-