-
Couldn't load subscription status.
- Fork 18
Description
Description
The Hookdeck destination provider currently requires external API verification for all tokens during destination creation/update. This makes it impossible to write automated tests without real Hookdeck credentials.
7 tests are currently skipped in the SDK test suite due to this limitation.
Current Behavior
When creating or updating a Hookdeck destination, the backend:
- Parses the token format (base64 encoded
source_id:signing_key) - Makes an HTTP request to
https://events.hookdeck.com/e/{source_id}to verify the token - Fails with validation error if the external API call fails
Evidence
Backend Code: internal/destregistry/providers/desthookdeck/desthookdeck.go lines 208-266
func (p *HookdeckProvider) Preprocess(newDestination *models.Destination, originalDestination *models.Destination, opts *destregistry.PreprocessDestinationOpts) error {
// ...
if shouldVerify {
ctx := context.Background()
// LINE 243: Makes external HTTP request
sourceResponse, err := VerifyHookdeckToken(p.httpClient, ctx, parsedToken)
if err != nil {
return destregistry.NewErrDestinationValidation([]destregistry.ValidationErrorDetail{
{
Field: "credentials.token",
Type: "token_verification_failed",
},
})
}
}
return nil
}Impact
Skipped Tests: spec-sdk-tests/tests/destinations/hookdeck.test.ts
should create a Hookdeck destination with valid config(line 61)should create a Hookdeck destination with array of topics(line 66)should create destination with user-provided ID(line 81)- Entire describe block:
GET /api/v1/{tenant_id}/destinations/{id}(line 167) - Entire describe block:
GET /api/v1/{tenant_id}/destinations(line 210) - Entire describe block:
PATCH /api/v1/{tenant_id}/destinations/{id}(line 236) - Entire describe block:
DELETE /api/v1/{tenant_id}/destinations/{id}(line 304)
Proposed Solution
Add a test mode or configuration flag that skips external token verification:
Option 1: Environment Variable
if os.Getenv("OUTPOST_TEST_MODE") == "true" {
// Skip external verification in tests
return nil
}Option 2: Configuration Flag
hookdeck:
skip_token_verification: true # Only for testingExpected Behavior
- In production: Continue to verify tokens against Hookdeck API
- In test mode: Skip external verification, only validate token format
- Tests can create/update/delete Hookdeck destinations without real credentials
Additional Context
See detailed analysis in spec-sdk-tests/TEST_STATUS.md and spec-sdk-tests/GITHUB_ISSUES.md
Metadata
Metadata
Assignees
Labels
Type
Projects
Status