Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add test mode for Hookdeck destination to skip external API verification

Aperta
#523 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
1.1k
Fork
70
Merge medio
1g 18h
PR unite (30g)
56

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hookdeck/outpost

Tutte le issue di hookdeck/outpost

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.