Resolve base URL and authenticate¶
This operation is the shared pipeline every Guidewire client runs through: it resolves the client's base URL and Basic-auth credentials from configuration, then executes GET/POST calls through an optional Polly cache policy, all implemented once in HttpClientBase and reused by all five concrete clients.
| Field | Value |
|---|---|
| Operation ID | OP-SDG-01 |
| Trigger | Client construction (base URL); first request when AuthKey is set (credentials) |
| Inputs | UrlKey, AuthKey, IDataClientConfiguration (SystemType, SystemName, UseCache, CachePolicyKey, MaxCacheDuration) |
| Outputs | Configured HttpClient with BaseAddress and Authorization header set; cached or direct HTTP response |
| Primary components | HttpClientBase |
| Entry point | Data/SAIF.Data.Guidewire/Clients/HttpClientBase.cs |
Steps¶
- On construction, set
client.BaseAddress = IEnvironmentService.GetConfigSetting(UrlKey). (SDG-BR-001) GetConfigSettingis resolved eagerly, so a missingUrlKeyfails at DI resolution time rather than at first request.*GetConfigSetting(UrlKey)† is implemented inIEnvironmentServiceinSAIF.Framework.Core(retrieved via the Legends CLI RAG service) and executed on behalf of this operation.
Origin: Step 1.1† is implemented in
GetConfigSettinginSAIF.Framework.Core(retrieved via the Legends CLI RAG service) and executed on behalf of this operation. 2. On first request, ifAuthKeyis set, compute the system hash. (SDG-BR-002) - IfIDataClientConfiguration.SystemNameis set: callSystemHashUtil.ComputeHash(SystemType, SystemName).† - Otherwise: callSystemHashUtil.Get(SystemType).†Origin: Steps 2.1–2.2† are implemented in
ComputeHash/GetinSAIF.HashUtil(retrieved via the Legends CLI RAG service) and executed on behalf of this operation. 3. ReadGetSecureConfigSetting(AuthKey, hash), split the result on|into user and password, and set theAuthorization: Basic base64(user:password)header on theHttpClient. (SDG-BR-002) - The split result is indexed without a length check, so a value not inuser|passwordformat is not defensively validated.* 4. For a cached GET/POST call, build the cache key{Type}-{url}-{ensureSuccess}[-bodyhash]and execute it through the Polly cache policy looked up byIDataClientConfiguration.CachePolicyKey. (SDG-BR-003) - IfUseCacheisfalse(including every obsolete constructor): use a NoOp policy instead, so every call executes directly.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["Trigger: construction / first request"]) --> S1["Set BaseAddress from<br>GetConfigSetting UrlKey"]
S1 --> S2{"AuthKey set?"}
S2 -->|No| S4[Execute request]
S2 -->|Yes| S3a["Compute system hash via<br>SystemHashUtil"]
S3a --> S3b["Read GetSecureConfigSetting<br>and set Authorization header"]
S3b --> S4
S4 --> S5{"Cached call and UseCache true?"}
S5 -->|Yes| S6[Execute via Polly cache policy]
S5 -->|No| S7[Execute via NoOp policy]
S6 --> EndOk([Return response])
S7 --> EndOk
Failure and edge-case behavior¶
- A missing
UrlKeyenvironment setting fails at DI resolution time, before any request is attempted.* - A malformed secure credential (not
user|password) is not defensively validated and may throw when split/indexed.* - The obsolete
[Obsolete]constructors forceUseCache = false, so every call from a client built that way bypasses the Polly cache entirely.
Related documentation¶
Note: Statements marked with
†are derived from dependency library documentation via the Legends CLI. Statements marked with*were inferred from code structure or contextual evidence.
Sources¶
Data/SAIF.Data.Guidewire/Clients/HttpClientBase.csData/SAIF.Data.Guidewire/Clients/DataClientConfiguration.csData/SAIF.Data.Guidewire/Clients/IDataClientConfiguration.cs