Commit 90184a4
feat: allow vault secret lookup by name in _id options (supabase#591)
* feat: allow vault secret lookup by name in `_id` options
Change `get_vault_secret()` to fall back to name-based lookup when
the input is not a valid UUID.
This allows all FDW `*_id` options (e.g. `conn_string_id`,
`api_key_id`, `bearer_token_id`) to accept either a vault secret
UUID or a human-readable name, making configuration easier:
```sql
-- Before: only UUID worked
OPTIONS (conn_string_id 'a1b2c3d4-e5f6-...')
-- Now: name also works
OPTIONS (conn_string_id 'my_mysql_prod')
```
Since vault secret names are human-readable labels that cannot be
valid UUIDs, there is no ambiguity. Existing UUID-based usage is
completely unaffected.
* feat: update get_vault_secret to accept secret name or ID
---------
Co-authored-by: Bo Lu <[email protected]>1 parent 2baf2d2 commit 90184a4
1 file changed
Lines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
364 | 371 | | |
365 | 372 | | |
366 | 373 | | |
| |||
371 | 378 | | |
372 | 379 | | |
373 | 380 | | |
374 | | - | |
| 381 | + | |
375 | 382 | | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
379 | 386 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
| 387 | + | |
387 | 388 | | |
388 | 389 | | |
389 | 390 | | |
| |||
0 commit comments