Sha256: 511a4d7922c6b8568d489d6450a1f059147600d2926873e9e14b2d406c1ca006

Contents?: true

Size: 967 Bytes

Versions: 21

Compression:

Stored size: 967 Bytes

Contents

class Jets::Resource::ApiGateway::Method
  module Authorization
  private
    def authorizer_id
      if @route.authorizer
        logical_id = @route.authorizer_id
      elsif controller_klass.authorizer
        logical_id = controller_klass.authorizer_logical_id_for(@route.action_name)
      end

      "!Ref #{logical_id}" if logical_id
    end

    def authorization_type
      type = @route.authorization_type ||
             controller_klass.authorization_type || # Already handles inheritance via class_attribute, applies controller-wide
             controller_klass.infer_authorization_type_for(@route.action_name) || # Applies specifically to route
             Jets.config.api.authorization_type
      type.to_s.upcase
    end

    def api_key_required?
      api_key_required == true
    end

    def api_key_required
      @route.api_key_required ||
        controller_klass.api_key_required ||
        Jets.config.api.api_key_required
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
jets-2.3.15 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.14 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.13 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.12 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.11 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.10 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.9 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.8 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.7 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.6 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.5 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.4 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.3 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.2 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.1 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.3.0 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.2.5 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.2.4 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.2.3 lib/jets/resource/api_gateway/method/authorization.rb
jets-2.2.2 lib/jets/resource/api_gateway/method/authorization.rb