- Notifications
You must be signed in to change notification settings - Fork947
Commit78f8578
fix(oauth2): add proper redirect URI validation to prevent invalid URIs
The OAuth2 provider app validation was too permissive, allowing invalidredirect URIs like 'localhost:3000', '/path/only', and 'http://' to passvalidation. This caused test failures in TestOAuth2ProviderAppValidation.Changes:- Updated PostOAuth2ProviderAppRequest.Validate() to call validateRedirectURIs- Updated PutOAuth2ProviderAppRequest.Validate() to call validateRedirectURIs- Added isHostnameScheme() function to detect hostname-like schemes- Added validation to catch common patterns like 'localhost:3000' that are missing the http:// or https:// prefixFixes the failing test cases:- URLNoHost: 'http://' now fails with scheme validation- URLLocalhostNoScheme: 'localhost:3000' now fails with hostname detection- URLPathOnly: '/bar/baz/qux' now fails with missing scheme validationCo-authored-by: mattvollmer <95866673+mattvollmer@users.noreply.github.com>1 parent63934b4 commit78f8578
2 files changed
+56
-2
lines changedLines changed: 28 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
133 |
| - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
134 | 147 |
| |
135 | 148 |
| |
136 | 149 |
| |
| |||
157 | 170 |
| |
158 | 171 |
| |
159 | 172 |
| |
160 |
| - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
161 | 187 |
| |
162 | 188 |
| |
163 | 189 |
| |
|
Lines changed: 28 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 |
| |
100 | 105 |
| |
101 | 106 |
| |
| |||
267 | 272 |
| |
268 | 273 |
| |
269 | 274 |
| |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + |
0 commit comments
Comments
(0)