Skip to content

Commit 108a114

Browse files
docs: add explanation about url-encoded placeholders detection
Signed-off-by: DziyanaT <dziyana.tsetserava@etu.umontpellier.fr>
1 parent 3781d70 commit 108a114

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/howitworks.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,40 @@ data:
153153
POSTGRES_URL: cG9zdGdyZXM6Ly91c2VyOnBhc3NAaG9zdDo5NDQzL215LWRiP3NzbG1vZGU9cmVxdWlyZQ==
154154
```
155155

156+
##### URL encoded placeholders
157+
When using plugin with a Helm chart, it is possible to use placeholders in values file. If a chart applies Helm's `urlquery` function to the value in order to safely include it in an URL, the placeholder will end up looking like this: `%3Cpath%3Asome%2Fpath%23secret-key%3E`.
158+
159+
The plugin can handle this case by finding any url encoded placeholders (inline-path only), replacing them, and re-url encoding the result.
160+
161+
For example, imagine that we have this value file:
162+
163+
```yaml
164+
redis:
165+
external:
166+
addr: "redis-master.harbor.svc.cluster.local"
167+
password: <path:kv/data/config/redis-pwd#password>
168+
```
169+
170+
And that the Helm chart passes the password value through `urlquery`, combines it with other data into a connection string and then adds it to a ConfigMap or Secret looking like this:
171+
172+
```yaml
173+
data:
174+
_REDIS_URL_CORE: >-
175+
redis://:%3Cpath%3Akv%2Fdata%2Fconfig%2Fredis-pwd%23password%3E@redis-master.harbor.svc.cluster.local/0?idle_timeout_seconds=30
176+
```
177+
178+
The plugin will be able to find the placeholder `%3Cpath%3Akv%2Fdata%2Fconfig%2Fredis-pwd%23password%3E`, decode it, get the password value (for example, "redis@123"), re-encode the value as "redis%40123" and put it back in the connection string.
179+
180+
Thus, the output will look like this:
181+
182+
```yaml
183+
data:
184+
_REDIS_URL_CORE: >-
185+
redis://:redis%40123@redis-master.harbor.svc.cluster.local/0?idle_timeout_seconds=30
186+
```
187+
188+
It will work even if the string with url-encoded placeholders was added to a Secret and base64-encoded.
189+
156190
##### Automatically ignoring `<placeholder>` strings
157191
The plugin tries to be helpful and will ignore strings in the format `<string>` if the `avp.kubernetes.io/path` annotation is missing, and only try to replace [inline-path placeholders](#inline-path-placeholders)
158192

0 commit comments

Comments
 (0)