Skip to content

Commit

Permalink
(BSR)[API] chore: Remove /offerers/{id}/api_keys unused pro route
Browse files Browse the repository at this point in the history
  • Loading branch information
dramelet-pass committed Nov 6, 2024
1 parent 0cc7455 commit 788522e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 115 deletions.
16 changes: 0 additions & 16 deletions api/src/pcapi/routes/pro/offerers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,6 @@ def get_offerer_members(offerer_id: int) -> offerers_serialize.GetOffererMembers
)


@private_api.route("/offerers/<int:offerer_id>/api_keys", methods=["POST"])
@login_required
@spectree_serialize(response_model=offerers_serialize.GenerateOffererApiKeyResponse, api=blueprint.pro_private_schema)
def generate_api_key_route(offerer_id: int) -> offerers_serialize.GenerateOffererApiKeyResponse:
check_user_has_access_to_offerer(current_user, offerer_id)
offerer = offerers_models.Offerer.query.get_or_404(offerer_id)
try:
clear_key = api.generate_and_save_api_key(offerer.id)
except offerers_exceptions.ApiKeyCountMaxReached:
raise ApiErrors({"api_key_count_max": "Le nombre de clés maximal a été atteint"})
except offerers_exceptions.ApiKeyPrefixGenerationError:
raise ApiErrors({"api_key": "Could not generate api key"})

return offerers_serialize.GenerateOffererApiKeyResponse(apiKey=clear_key)


@private_api.route("/offerers/api_keys/<api_key_prefix>", methods=["DELETE"])
@login_required
@spectree_serialize(on_success_status=204, api=blueprint.pro_private_schema)
Expand Down
68 changes: 0 additions & 68 deletions api/tests/routes/pro/post_offerer_api_key_test.py

This file was deleted.

1 change: 0 additions & 1 deletion pro/src/apiClient/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export type { FeatureResponseModel } from './models/FeatureResponseModel';
export type { FinanceBankAccountListResponseModel } from './models/FinanceBankAccountListResponseModel';
export type { FinanceBankAccountResponseModel } from './models/FinanceBankAccountResponseModel';
export { GenderEnum } from './models/GenderEnum';
export type { GenerateOffererApiKeyResponse } from './models/GenerateOffererApiKeyResponse';
export type { GetCollectiveOfferCollectiveStockResponseModel } from './models/GetCollectiveOfferCollectiveStockResponseModel';
export type { GetCollectiveOfferManagingOffererResponseModel } from './models/GetCollectiveOfferManagingOffererResponseModel';
export type { GetCollectiveOfferProviderResponseModel } from './models/GetCollectiveOfferProviderResponseModel';
Expand Down
8 changes: 0 additions & 8 deletions pro/src/apiClient/v1/models/GenerateOffererApiKeyResponse.ts

This file was deleted.

22 changes: 0 additions & 22 deletions pro/src/apiClient/v1/services/DefaultService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import type { EducationalInstitutionsResponseModel } from '../models/Educational
import type { EducationalRedactors } from '../models/EducationalRedactors';
import type { EventDatesInfos } from '../models/EventDatesInfos';
import type { FinanceBankAccountListResponseModel } from '../models/FinanceBankAccountListResponseModel';
import type { GenerateOffererApiKeyResponse } from '../models/GenerateOffererApiKeyResponse';
import type { GetCollectiveOfferRequestResponseModel } from '../models/GetCollectiveOfferRequestResponseModel';
import type { GetCollectiveOfferResponseModel } from '../models/GetCollectiveOfferResponseModel';
import type { GetCollectiveOfferTemplateResponseModel } from '../models/GetCollectiveOfferTemplateResponseModel';
Expand Down Expand Up @@ -1412,27 +1411,6 @@ export class DefaultService {
},
});
}
/**
* generate_api_key_route <POST>
* @param offererId
* @returns GenerateOffererApiKeyResponse OK
* @throws ApiError
*/
public generateApiKeyRoute(
offererId: number,
): CancelablePromise<GenerateOffererApiKeyResponse> {
return this.httpRequest.request({
method: 'POST',
url: '/offerers/{offerer_id}/api_keys',
path: {
'offerer_id': offererId,
},
errors: {
403: `Forbidden`,
422: `Unprocessable Entity`,
},
});
}
/**
* get_offerer_bank_accounts_and_attached_venues <GET>
* @param offererId
Expand Down

0 comments on commit 788522e

Please sign in to comment.