Retrieve a secure configuration setting¶
This operation calls the Environment API's secure-setting route, which returns values that are gated by track and by a system hash rather than served from the general-purpose cache. It resolves the current track, shapes the request URL to match whether the caller's key is section-qualified, and returns either the raw string or a converted value.
| Field | Value |
|---|---|
| Operation ID | OP-ENV-005 |
| Trigger | Caller request to read a secure configuration value |
| Inputs | configKey, systemHashValue |
| Outputs | Secure setting value as string or converted T |
| Primary components | EnvironmentServiceBase.GetSecureConfigSetting, EnvironmentServiceBase.GetSecureConfigSetting<T> |
| Entry point | SAIF.Framework.Security.EnvironmentApi\Services.Common\EnvironmentServiceBase.cs |
Steps¶
- Resolve the current application track through
GetApplicationTrack(), which loads configuration first when the shared cache is still empty. - Start the request path at
{EnvironmentApiUrl}/v2/and branch on whetherconfigKeycontains a section delimiter (.) (BR-002). - If the key is section-qualified, split it into
sectionandkeyand build/secureSetting/{ApplicationId}/{track}/{section}/{key}/value?systemHashValue=.... - Otherwise build the simpler
/secureSetting/{ApplicationId}/{track}/{configKey}/value?systemHashValue=...route. - Download the JSON response and deserialize it directly to a
string. - Return the raw string result, or convert it to
TthroughConvert.ChangeTypewhen the caller used the generic overload. - Let any HTTP or serialization failure surface to the caller rather than masking it.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller requests secure setting]) --> Track[Resolve application track]
Track --> Split{Key includes section?}
Split -->|Yes| SectionUrl[Build section-qualified secure-setting URL]
Split -->|No| DirectUrl[Build direct secure-setting URL]
SectionUrl --> Download[Download JSON payload]
DirectUrl --> Download
Download --> Deserialize[Deserialize string value]
Deserialize --> End([Return string or converted T])
Failure and edge-case behavior¶
- The method trusts the caller-supplied
systemHashValueas-is; it does not validate hash age locally, so lifetime enforcement must happen through a separate call to Validate system hash lifetime or on the server side. - Section-qualified and global keys resolve to different route shapes, so a caller must format
configKeyconsistently with how the setting was stored. - The generic overload performs only a direct
Convert.ChangeTypeconversion, so it will fail for types that conversion cannot bridge.
Related documentation¶
Sources¶
- SAIF.Framework.Security.EnvironmentApi\Services.Common\EnvironmentServiceBase.cs