Skip to content

Comments

Add ConfigAwarePlaceholders class#997

Merged
thiagoloureiro merged 2 commits intoThreeMammals:developfrom
donaldgray:config-placeholder
Sep 12, 2019
Merged

Add ConfigAwarePlaceholders class#997
thiagoloureiro merged 2 commits intoThreeMammals:developfrom
donaldgray:config-placeholder

Conversation

@donaldgray
Copy link
Contributor

This allows placeholder values to be sourced from IConfiguration in
addition to set values.

New Feature

Proposed Changes

I found myself writing a few DelegatingHandlers for appending headers for downstream calls using values from IConfiguration. This PR contains a new implementation of IPlaceholders.

This decorates and replaces the IPlaceholders instaces in the IoC container to allow the existing placeholders to be used (it checks these first). The idea is to have config like:

"UpstreamHeaderTransform": {
    "x-api-key": "{DownstreamService:ApiKey}"
}

I've added AddConfigPlaceholders() to IOcelotBuilder but I wasn't sure if that was the correct location, or if somewhere else would work.

This allows placeholder values to be sourced from IConfiguration in
addition to set values.
@thiagoloureiro thiagoloureiro merged commit bef4004 into ThreeMammals:develop Sep 12, 2019
@donaldgray donaldgray deleted the config-placeholder branch March 25, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants