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

Creation of a new target succeeds despite empty name

Abierto
#1,237 0 comentarios 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
java
Área
api

Línea de trabajo

Start at the POST /rest/v1/targets endpoint and trace how target creation handles the name field. Reproduce the request from the issue's shell example; done means an empty name is rejected instead of creating a target named after its controller ID.

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

Descripción

I'm working on a library providing Go bindings for Eclipse Hawkbit. As a part of the process I created integration tests that interrogate a real Hawkbit installation to see how it behaves.

According to the documentation at https://www.eclipse.org/hawkbit/rest-api/targets-api-guide/#_create_list_of_targets the name fields is mandatory when creating a target. Providing an empty value unexpectedly succeeds, with the name being set to the controller ID.

See the sample shell test program I created.

    # We should not be able to create a target with an empty name
    # https://www.eclipse.org/hawkbit/rest-api/targets-api-guide/#_create_list_of_targets
    curl \
        --verbose \
        --dump-header resp.head \
        --output resp.body \
        -H "$TEST_HAWKBIT_AUTH" \
        -H 'Accept: application/hal+json' \
        -H 'Content-Type: application/json;charset=UTF-8' \
        "${TEST_HAWKBIT_URL}/rest/v1/targets" \
        -d '[{"controllerId": "1001", "name": "",  "description": "First test device", "securityToken": "9999", "address": "https://localhost:8001"}]'

    # The request unexpected succeeds.
    fromdos resp.head
    GREP -qFx 'HTTP/1.1 201 Created' < resp.head

    # The returned data is sane.
    jq '.[0].controllerId' -r < resp.body | GREP -qFx 1001
    # The name seems to default to the value of the controllerId.
    jq '.[0].name' -r < resp.body | GREP -qFx "1001"
    jq '.[0].description' -r < resp.body | GREP -qFx "First test device"
    jq '.[0].createdBy' -r < resp.body | GREP -qFx admin
    jq '.[0].lastModifiedBy' -r < resp.body | GREP -qFx admin
    jq '.[0].updateStatus' -r < resp.body | GREP -qFx unknown
    jq '.[0]._links.self.href' -r < resp.body | GREP -qFx "${TEST_HAWKBIT_URL}/rest/v1/targets/1001"
Lenguaje dominante
Java
Estrellas
601
Forks
228
Merge medio
18 h 20 min
PR fusionados (30 d)
58

Preparar el entorno

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 eclipse-hawkbit/hawkbit

Todos los issues de eclipse-hawkbit/hawkbit

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.