docs: slice binding example (#170) + JWT timing-attack caveat (#100)#417
Merged
Conversation
…100) #170 — Struct-tag binding to a slice field (repeated query/path/form/header values collected into []T) was undocumented. Add a "Slices" subsection to the binding guide with a `[]string` + repeated-query-param example, across all five locales (translated heading/lead-in, identical code block). #100 — The JWT cookbook login handler compared hard-coded credentials with a plain `!=` and only a "// Throws unauthorized error" comment. Replace it with a caveat noting it's demo-only and that production code should verify a hashed password using a constant-time compare to avoid timing attacks (all locales). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small docs content fixes.
#170 — Document binding repeated query params to a slice
Struct-tag binding to a slice field wasn't documented (only the fluent binder showed it). Adds a Slices subsection to the binding guide:
Across all 5 locales (heading + lead-in translated; code block identical).
#100 — JWT example timing attack
The cookbook login handler compared hard-coded credentials with a plain
!=. Replaced the bare// Throws unauthorized errorcomment with a caveat that it's demo-only and that production code should verify a hashed password with a constant-time compare (e.g.bcrypt.CompareHashAndPassword) to avoid timing attacks. Comment is identical across all 5 locales (matching the docs' code-comment convention).Verification
Closes #170
Closes #100
🤖 Generated with Claude Code