Go SDK: validate personal access token name length before serialization

Abierto
#4,749 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@p4rtridge ya está trabajando en esto.

Desde el 4/11/2026.

  • #4763 de @p4rtridge — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug go good first issue
Bug description

In foreign/go/internal/command/access_token.go, the Go SDK does not validate personal access token name lengths in CreatePersonalAccessToken or DeletePersonalAccessToken.

The server’s WireName type requires names to contain 1–255 bytes, as defined in core/binary_protocol/src/primitives/identifier.rs.

Both Go commands serialize invalid names without returning an error:

  • Empty names produce a zero length prefix, which the server rejects.
  • Names longer than 255 bytes cause byte(len(c.Name)) to wrap while the full name is still written. For example, a 256-byte name produces a zero length prefix, which the server rejects.
Affected area / component

Go SDK

Related pull request

Follow-up to the review of #4640.

Reproduction

Call MarshalBinary() on either command with:

  • Name: ""
  • Name: strings.Repeat("t", 256)

Both return a request body without an error, but the server rejects these requests.

Proposed solution

Validate the name’s byte length before serialization in both commands and return an error when it falls outside the 1–255 range. Follow the existing name-length validation pattern in foreign/go/internal/command/update_resource.go.

Contribution
  • I'm willing to submit a pull request to fix this bug
Good first issue
  • I think this could be a good first issue for a new contributor
Lenguaje dominante
Rust
Estrellas
5.2k
Forks
516
Merge medio
2 d 17 h
PR fusionados (30 d)
155

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 apache/iggy

Todos los issues de apache/iggy

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.