Incorrect error in case of invalid foreign entity name reference with plugin

Aperta
#1,976 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Riproduci il sync o diff con il file di stato dichiarativo fornito, in cui il plugin fa riferimento al consumer non definito alice. Traccia come decK gestisce i riferimenti a entità esterne prima di inviare la richiesta al gateway; il lavoro è completato quando fallisce tempestivamente con un errore chiaro di elemento non trovato invece del fuorviante errore di validazione UUID.

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

Descrizione

While running sync/diff, if a plugin references a foreign entity that doesn’t exist, the request goes through without being caught by decK. As a result, the call reaches the gateway, which then returns below error.

Error: 1 errors occurred:
	while processing event: Create plugin rate-limiting for service example-service and consumer shivay failed: HTTP status 400 (message: "schema violation (consumer.id: expected a valid UUID)")

This error can be misleading, because the root cause is that the referenced entity is missing, but decK does not validate or catch this earlier in the flow.

Ideally, in such cases, decK should fail early and return a clear error indicating that the referenced entity was not found, instead of letting the request reach the gateway and surface a misleading error.

Steps to reproduce :

I am running below file, but the consumer is not defined not in the state file neither globally.

_format_version: "3.0"
services:
  - name: example-service
    port: 3200
    protocol: http
    host: localhost
    plugins:
      - config:
          limit_by: consumer
          minute: 6
          policy: local
        consumer: alice  
        enabled: true
        name: rate-limiting
        protocols:
            - http

Error:

Error: 1 errors occurred:
	while processing event: Create plugin rate-limiting for service example-service and consumer shivay failed: HTTP status 400 (message: "schema violation (consumer.id: expected a valid UUID)")
Lingua principale
Go
Stelle
507
Fork
142
Merge medio
1g 15h
PR unite (30g)
9

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 Kong/deck

Tutte le issue di Kong/deck

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.