Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow replacement pattern in data sources #1172

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Conversation

pb82
Copy link
Collaborator

@pb82 pb82 commented Jul 20, 2023

What

This PR extends the existing functionality to inject values from Secrets into data sources. It allows replacement patterns (e.g. Bearer ${TOKEN}) instead of overwriting whatever is there in the first place.

Why

Injecting bearer tokens is a typical use case for data sources. However this was not properly supported until now. The value of a bearer token starts with Bearer followed by the token. The existing mechanism replaced the whole value, including the Bearer part. You would have to include Bearer in the secret, but often you don't create or manage those secrets.

How

Bevor overwriting the value found at the given path, we fetch it and apply the replacement.

@pb82 pb82 force-pushed the datasource-vars-partial branch 2 times, most recently from b7f234f to d8f5917 Compare July 20, 2023 13:18
Copy link
Collaborator

@HVBE HVBE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, would be nice if we had test for this to avoid regressions, but we can merge it in

@pb82 pb82 merged commit ffd4174 into master Jul 20, 2023
9 checks passed
@pb82 pb82 deleted the datasource-vars-partial branch July 20, 2023 18:52
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.

None yet

2 participants