Commit 8c35e6e
committed
fix(azkv): handle whitespace in Azure Key Vault URLs
### Problem:
The Azure Key Vault key parser would fail when URLs contained leading or trailing whitespace, which commonly occurs when using YAML Block Scalar syntax.
```yaml
creation_rules:
- azure_keyvault: >-
https://test.vault.azure.net/keys/test-key/a2a690a4fcc04166b739da342a912c90,
https://test2.vault.azure.net/keys/another-test-key/cf0021e8b743453bae758e7fbf71b60e
```
This resulted in the error:
```bash
"could not parse " https://test2.vault.azure.net/keys/another-test-key/cf0021e8b743453bae758e7fbf71b60e" into a valid Azure Key Vault MasterKey"
```
### Fix:
- Added `strings.TrimSpace()` to clean the URL before parsing in `NewMasterKeyFromURL()`
- Added test case to verify handling of URLs with leading/trailing spaces
Signed-off-by: Vasily Marnopolsky <sept0r.com@gmail.com>1 parent 7880ef4 commit 8c35e6e
2 files changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
| |||
0 commit comments