Add test mode for Hookdeck destination to skip external API verification
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- go
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start with internal/destregistry/providers/desthookdeck/desthookdeck.go, especially Preprocess and the VerifyHookdeckToken call, then read spec-sdk-tests/tests/destinations/hookdeck.test.ts and the referenced test-status documents. Decide how test mode or configuration should be supplied, ensuring production verification remains enabled. Done means test mode still validates token format, skips the external request, and the Hookdeck destination tests can run without real credentials.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 testing
Expected 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
- Ngôn ngữ chính
- Go
- Star
- 1.1k
- Fork
- 70
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 56
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hookdeck/outpost
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
hookdeck/outpost#1117 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của hookdeck/outpost
Issue tương tự
-
copilot-api domain:platform go
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: clarify gh api -f vs -F and @-file expansion in the gh skillCó thể đã có người làm @MatiasOlivera đã nhận hôm nay. Đang mởenhancement
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
aws/aws-advanced-go-wrapper#612 ·
-
Say in the changelog that the text-index update cannot be rolled backCó thể đã có người làm @praetorianer777 đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
praetorianer777/GoTome#275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
SAP/crossplane-provider-btp#1118 ·
Maintainer thường phản hồi trong vòng 1 ngày