Sha256: d35f1eca69e4da6e11c8daae7284444bdae1e529927c42a262c9da36f188112c

Contents?: true

Size: 573 Bytes

Versions: 9

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

module Tamashii
  module Manager
    # :nodoc:
    class Authorization < Tamashii::Handler
      def resolve(data = nil)
        type, client_id = case @type
                          when Tamashii::Type::AUTH_TOKEN
                            Authorizator::Token.new.verify!(data)
                          else
                            raise Error::AuthorizationError,
                                  'Invalid authorization type.'
                          end
        @env[:client].accept(type, client_id)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tamashii-manager-0.3.0 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.7 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.6 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.5 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.4 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.3 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.2 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.1 lib/tamashii/manager/authorization.rb
tamashii-manager-0.2.0 lib/tamashii/manager/authorization.rb