Commit fb99a2a
committed
docs: package-wide comment sweep (non-security)
Pre-existing comment drift in files unrelated to the recent security fix —
unrelated docstrings that misled, said the wrong thing, or were copy-paste
leftovers. Mirrored across v1 and v2.
The security-fix docstring fixes (avatar/avatar.go security comments and
auth.go withSecurityHeaders) live in PR #291 and are intentionally NOT
included here so the two PRs stay independent.
Findings:
* avatar/gridfs.go — ID doc claimed MD5 sourced from gridfs; metadata.hash
is the sha1 written at Put time.
* avatar/bolt.go, avatar/gridfs.go — Put docs and BoltDB type doc claimed
these layers "resize" the image; they only copy bytes. Resize happens
in Proxy.resize upstream.
* avatar/store.go — Migrate doc didn't mention that per-avatar Get/Put/Close
errors are logged and skipped, and that the returned count is "ids
attempted", not "ids stored".
* provider/oauth1.go — initOauth1Handler doc and DEBUG log both said
"oauth2".
* provider/service.go — Service.Handler doc said "returns auth routes";
it dispatches login/callback/logout.
* provider/telegram.go — processUpdates claimed to return an offset (no
return value); checkToken doc described an "address or empty string"
return shape but the signature is (*token.User, error).
* provider/verify.go — Sender interface doc locked the contract to "send
emails", contradicting the broader "email, IM, or anything else" on
VerifyHandler. AuthHandler comment was copy-pasted from direct.
* provider/dev_provider.go — NewDev doc said "for admin user"; just makes
the dev oauth2 provider.
* middleware/user_updater.go — UserUpdFunc adapter doc said result "is a
Handler"; implements UserUpdater.
* logger/interface.go — Func adapter doc said "Logf calls f(id)"; actually
calls f(format, args...).
* token/jwt.go — SendJWTHeader option doc said "instead of cookie"; Set
sends header AND cookie. Set doc referenced a "permanent flag" that
doesn't exist in the signature (controlled by claims.SessionOnly/Handshake).
Get doc oversimplified the XSRF gate. Update/Validate adapter docs said
"calls f(id)"; actually f(claims) and f(token, claims).
* token/user.go — HashID inline "or empty" was wrong; an empty val never
matches reValidSha.
* auth.go — BasicAuthChecker doc grammar broken and understated behavior
(AdminPasswd is bypassed entirely, not "ignored"); "peak dev provider"
typo; AvatarProxy doc was a sentence fragment.
All changes mirrored across v1 and v2. Build green, lint clean, go fix clean.1 parent b19c8d7 commit fb99a2a
26 files changed
Lines changed: 82 additions & 56 deletions
File tree
- avatar
- logger
- middleware
- provider
- token
- v2
- avatar
- logger
- middleware
- provider
- token
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
519 | | - | |
| 519 | + | |
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
| 159 | + | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
0 commit comments