You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(hubspot): add api_key_name support for Vault secret lookup by name (supabase#545)
* feat(hubspot): add api_key_name support for Vault secret lookup by name
## Summary
Add `api_key_name` support to HubSpot FDW, enabling Vault secret lookup by name for environment-agnostic configuration.
### Infrastructure Changes (enables feature for all WASM FDWs)
- Add `get-vault-secret-by-name` function to WIT interface (v1 and v2)
- Implement host-side binding to call native `get_vault_secret_by_name`
### HubSpot FDW Changes
- Add `api_key_name` option to HubSpot FDW authentication
- Follow Stripe FDW implementation pattern
- Update documentation with examples
Fixessupabase#437
* docs(hubspot): clarify that api_key accepts Private App Access Token
Add note explaining that HubSpot deprecated their legacy API Keys in
November 2022 and that the api_key option accepts Private App Access
Tokens, which is HubSpot's recommended authentication method.
This helps address confusion reported in supabase#461.
* fix: correct Rust type errors in api_key retrieval
- Remove `.cloned()` call on Option<String> (already owned)
- Pass &key_id and &key_name to get_vault_secret functions (expects &str)
Copy file name to clipboardExpand all lines: docs/catalog/hubspot.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,9 @@ create foreign data wrapper wasm_wrapper
42
42
validator wasm_fdw_validator;
43
43
```
44
44
45
+
!!! note "About Authentication"
46
+
HubSpot deprecated their legacy API Keys in November 2022. The `api_key` option in this wrapper accepts a **Private App Access Token**, which is HubSpot's recommended authentication method. See [HubSpot Private Apps](https://developers.hubspot.com/docs/guides/apps/private-apps/overview) for setup instructions.
47
+
45
48
### Store your credentials (optional)
46
49
47
50
By default, Postgres stores FDW credentials inside `pg_catalog.pg_foreign_server` in plain text. Anyone with access to this table will be able to view these credentials. Wrappers is designed to work with [Vault](https://supabase.com/docs/guides/database/vault), which provides an additional level of security for storing credentials. We recommend using Vault to store your credentials.
api_key_name 'hubspot' -- The secret name from above.
94
+
);
95
+
```
96
+
97
+
Using `api_key_name` enables environment-agnostic configuration - the same SQL works across dev, staging, and production as long as each environment has a Vault secret with the same name.
0 commit comments