Sha256: 00a7cd4da1ca910a21553daa15c7dfc5b5d7ac9049a72605a7f21c8ae3099850

Contents?: true

Size: 437 Bytes

Versions: 7

Compression:

Stored size: 437 Bytes

Contents

require 'bootic_client/strategies/strategy'

module BooticClient
  module Strategies
    class Bearer < Strategy

      private

      def validate!
        raise ArgumentError, 'options MUST include access_token' unless options[:access_token]
      end

      def request_headers
        {
          'Authorization' => "Bearer #{options[:access_token]}"
        }
      end
    end
  end

  strategies[:bearer] = Strategies::Bearer
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bootic_client-0.0.28 lib/bootic_client/strategies/bearer.rb
bootic_client-0.0.27 lib/bootic_client/strategies/bearer.rb
bootic_client-0.0.26 lib/bootic_client/strategies/bearer.rb
bootic_client-0.0.25 lib/bootic_client/strategies/bearer.rb
bootic_client-0.0.24 lib/bootic_client/strategies/bearer.rb
bootic_client-0.0.23 lib/bootic_client/strategies/bearer.rb
bootic_client-0.0.22 lib/bootic_client/strategies/bearer.rb