Skip to content

feat(hubspot): add api_key_name support for Vault secret lookup by name#543

Closed
JohnCari wants to merge 2 commits intosupabase:mainfrom
JohnCari:feat/hubspot-api-key-name
Closed

feat(hubspot): add api_key_name support for Vault secret lookup by name#543
JohnCari wants to merge 2 commits intosupabase:mainfrom
JohnCari:feat/hubspot-api-key-name

Conversation

@JohnCari
Copy link
Copy Markdown
Contributor

@JohnCari JohnCari commented Dec 23, 2025

Summary

Add api_key_name support to HubSpot FDW, enabling Vault secret lookup by name for environment-agnostic configuration.

This PR includes the complete infrastructure to support api_key_name in WASM-based FDWs:

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

Changes

File Description
wasm-wrappers/wit/v1/utils.wit Add get-vault-secret-by-name to WIT interface
wasm-wrappers/wit/v2/utils.wit Add get-vault-secret-by-name to WIT interface
wrappers/src/fdw/wasm_fdw/host/utils.rs Implement host-side function
wasm-wrappers/fdw/hubspot_fdw/src/lib.rs Add api_key_name support
docs/catalog/hubspot.md Document new option

Testing

  • Verified backward compatibility with api_key and api_key_id
  • Verified precedence order: api_key > api_key_id > api_key_name

Benefits

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.

Fixes #437

Add api_key_name option to HubSpot FDW, enabling Vault secret lookup by
name for environment-agnostic configuration.

Changes:
- Add api_key_name option with precedence: api_key > api_key_id > api_key_name
- Update authentication error message to include all three options
- Update documentation with api_key_name examples

Fixes #437
@JohnCari
Copy link
Copy Markdown
Contributor Author

I have to improve a fews things, but will try to fix this!

Add support for looking up Vault secrets by name in WASM-based FDWs.
This enables environment-agnostic configuration where the same SQL
works across dev, staging, and production environments.

Changes:
- 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
@JohnCari
Copy link
Copy Markdown
Contributor Author

Update: The implementation is now complete and ready for review.

I've expanded the PR to include the full infrastructure needed for api_key_name support in WASM-based FDWs:

Added:

  • get-vault-secret-by-name function to WIT interface (v1 and v2)
  • Host-side binding implementation

This follows the same pattern as the native Stripe FDW and enables any WASM FDW to use Vault secret lookup by name.

The previous comment about needing improvements has been addressed - the PR now includes all necessary changes for the feature to work.

@JohnCari JohnCari closed this by deleting the head repository Dec 28, 2025
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.

Allow api_key_name for Hubspot

1 participant