Commit 89268b4
Extract error message constants in Google JWT token package
- Add comprehensive error message constants for JWT validation
- Replace hardcoded error strings with named constants throughout token validation
- Improve consistency and maintainability of JWT error handling
- Address goconst linter warnings for repeated error messages
Error constants added:
- errAudienceRequired, errAudienceMismatch for audience validation
- errIssuerMismatch for issuer validation
- errTokenExpired, errInvalidIssuedTime for time validation
- errUnsupportedAlg for algorithm validation
- errInvalidJWTFormat, errKeyNotFound for format/key errors
This centralizes all JWT validation error messages and ensures consistent
error responses across the Google JWT verification process.
Co-authored-by: Amp <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-5be4213f-26eb-400c-bb7b-d4c79b7ee6fe1 parent a84d16e commit 89268b4
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| |||
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
68 | | - | |
| 78 | + | |
69 | 79 | | |
70 | 80 | | |
71 | 81 | | |
| |||
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
82 | | - | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| |||
101 | 111 | | |
102 | 112 | | |
103 | 113 | | |
104 | | - | |
| 114 | + | |
105 | 115 | | |
106 | 116 | | |
107 | 117 | | |
| |||
151 | 161 | | |
152 | 162 | | |
153 | 163 | | |
154 | | - | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
158 | 168 | | |
159 | | - | |
| 169 | + | |
160 | 170 | | |
161 | 171 | | |
162 | 172 | | |
163 | 173 | | |
164 | 174 | | |
165 | | - | |
| 175 | + | |
166 | 176 | | |
167 | 177 | | |
168 | 178 | | |
169 | 179 | | |
170 | | - | |
| 180 | + | |
171 | 181 | | |
172 | 182 | | |
173 | 183 | | |
| |||
223 | 233 | | |
224 | 234 | | |
225 | 235 | | |
226 | | - | |
| 236 | + | |
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
| |||
0 commit comments