docbrown/app/controllers/api/v1/listings_controller.rb
Fernando Valverde 2ad02cf31c
API v1 without api key restriction (#18340)
* Remove :api_v1 feature flag

* Reworking the auth configs throughout V1 + specs

* Fix remaining v1 specs

* Enhanced inline docs

* deprecation warning update

* Use headers variable for most v1 specs

* Cherry pick spec changes

* Fix specs

* group let! statements - rubocop

* Bring back ||= on api v1 authentication methods

* Bump swagger/v1/api_v1.json
2022-08-19 14:04:41 -06:00

14 lines
630 B
Ruby

module Api
module V1
class ListingsController < ApiController
include Api::ListingsController
# actions `create` and `update` are defined in the module `ListingsToolkit`,
# we thus silence Rubocop lexical scope filter cop: https://rails.rubystyle.guide/#lexically-scoped-action-filter
before_action :authenticate_with_api_key_or_current_user!, only: %i[create update]
before_action :authenticate_with_api_key_or_current_user, only: %i[show]
before_action :set_cache_control_headers, only: %i[index show]
before_action :set_and_authorize_listing, only: %i[update]
end
end
end