Skip to content

Commit 138c1f8

Browse files
caseylockerclaude
andcommitted
fix(promo-codes): use rate.limit instead of auth.user on discover route
The discover endpoint's seeder entry intentionally omits authz_groups per SDS Task 9 ("any authenticated user with read scope"). The auth.user middleware requires at least one matching group, so every request fell through to a 403. Switch to rate.limit:25,1 to match the adjacent pre-validate-promo-code route, which has the same "any authenticated user" profile. OAuth2 bearer auth and scope enforcement are still applied via the parent 'api' middleware group. All 5 discover integration tests now pass (verified locally). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent a9ece25 commit 138c1f8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

routes/api_v1.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,8 @@
19511951
// promo codes
19521952
Route::group(['prefix' => 'promo-codes'], function () {
19531953
Route::group(['prefix' => 'all'], function () {
1954-
Route::get('discover', ['middleware' => 'auth.user', 'uses' => 'OAuth2SummitPromoCodesApiController@discover']);
1954+
// rate-limit only — no authz groups required per SDS Task 9
1955+
Route::get('discover', ['middleware' => ['rate.limit:25,1'], 'uses' => 'OAuth2SummitPromoCodesApiController@discover']);
19551956
});
19561957
Route::get('', ['middleware' => 'auth.user', 'uses' => 'OAuth2SummitPromoCodesApiController@getAllBySummit']);
19571958
Route::group(['prefix' => 'csv'], function () {

0 commit comments

Comments
 (0)