Go SDK: validate personal access token name length before serialization

Aperta
#4,749 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@p4rtridge ci sta già lavorando.

Dal 4/11/2026.

  • #4763 di @p4rtridge — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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
Lingua principale
Rust
Stelle
5.2k
Fork
502
Merge medio
2g 21h
PR unite (30g)
159

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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

Tutte le issue di apache/iggy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.