Repository navigation
Conversation
Add DynamicParameterUtil support for the
{ds/<resource>/service-keys.<key>.credentials.<field>} reference form:
isServiceKeyCredentialReference, getServiceKeyName and
getCredentialFieldPath. This is the parsing groundwork for injecting a
created service key's credential output into another resource's
service-keys[].config at deploy time.
|
| public static final String REGEX_PATTERN_FOR_DYNAMIC_PARAMETERS = "^\\{ds[A-Za-z0-9_\\-\\.\\/]+\\}$"; | ||
|
|
||
| private static final String SERVICE_KEY_REFERENCE_PREFIX = "service-keys."; | ||
| private static final String CREDENTIALS_SEPARATOR = ".credentials."; |
There was a problem hiding this comment.
As this is written, this will only work for a 'credentials' map inside the service key. Should this be a bit more general or do we intentionally want it this way? What would happen if the ztis service changes the internal service key parameter structure.
There was a problem hiding this comment.
credentials is the standard CF contract for service keys, not a ZTIS-specific structure. Every CF service key, regardless of service type, returns its useful data under credentials
| private static final String SERVICE_KEY_REFERENCE_PREFIX = "service-keys."; | ||
| private static final String CREDENTIALS_SEPARATOR = ".credentials."; |
There was a problem hiding this comment.
What are these dots after or between keywords?
There was a problem hiding this comment.
The dots are delimiters in the{ds/<resource>/service-keys.<key>.credentials.<field>} reference syntax, and they're part of that literal text. The two constants are just the fixed delimiter substrings used to split the reference into its parts:
SERVICE_KEY_REFERENCE_PREFIX = "service-keys." - separates the literal service-keys token from the key name, so we can strip it off and get key
CREDENTIALS_SEPARATOR = ".credentials." - fences off the literal credentials token, so we can split off field
for exampel: "{ds/source-service/service-keys.source-key.credentials.clientid}"



Add DynamicParameterUtil support for the
{ds//service-keys..credentials.} reference form: isServiceKeyCredentialReference, getServiceKeyName and getCredentialFieldPath. This is the parsing groundwork for injecting a created service key's credential output into another resource's service-keys[].config at deploy time.