Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add test mode for Hookdeck destination to skip external API verification

Đang mở
#523 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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:

  1. Parses the token format (base64 encoded source_id:signing_key)
  2. Makes an HTTP request to https://events.hookdeck.com/e/{source_id} to verify the token
  3. 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

  1. should create a Hookdeck destination with valid config (line 61)
  2. should create a Hookdeck destination with array of topics (line 66)
  3. should create destination with user-provided ID (line 81)
  4. Entire describe block: GET /api/v1/{tenant_id}/destinations/{id} (line 167)
  5. Entire describe block: GET /api/v1/{tenant_id}/destinations (line 210)
  6. Entire describe block: PATCH /api/v1/{tenant_id}/destinations/{id} (line 236)
  7. 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hookdeck/outpost

Tất cả issue của hookdeck/outpost

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.