Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add test mode for Hookdeck destination to skip external API verification

Abierto
#523 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
go

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
1.1k
Forks
70
Merge medio
1 d 18 h
PR fusionados (30 d)
56

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hookdeck/outpost

Todos los issues de hookdeck/outpost

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.