Sha256: 965f6725ed36ae9bdd3e3213f054218752b4649c763c236822a36a8c6c888bdf

Contents?: true

Size: 572 Bytes

Versions: 20

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

module Aserto
  module IdentityMapper
    module Sub
      extend Aserto::IdentityMapper::Base

      class << self
        def execute(request)
          config = Aserto.config
          auth_token = request.get_header("HTTP_AUTHORIZATION")
          return {} unless auth_token

          auth_token = auth_token.split.last if auth_token
          data = extract_data(auth_token) || {}

          {
            type: :sub,
            identity: data[config.identity_mapping[:from].to_s]
          }
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
aserto-0.31.3 lib/aserto/identity_mapper/sub.rb
aserto-0.31.2 lib/aserto/identity_mapper/sub.rb
aserto-0.31.1 lib/aserto/identity_mapper/sub.rb
aserto-0.31.0 lib/aserto/identity_mapper/sub.rb
aserto-0.30.6 lib/aserto/identity_mapper/sub.rb
aserto-0.30.5 lib/aserto/identity_mapper/sub.rb
aserto-0.30.4 lib/aserto/identity_mapper/sub.rb
aserto-0.30.1 lib/aserto/identity_mapper/sub.rb
aserto-0.30.0 lib/aserto/identity_mapper/sub.rb
aserto-0.20.6 lib/aserto/identity_mapper/sub.rb
aserto-0.20.5 lib/aserto/identity_mapper/sub.rb
aserto-0.20.4 lib/aserto/identity_mapper/sub.rb
aserto-0.20.3 lib/aserto/identity_mapper/sub.rb
aserto-0.20.2 lib/aserto/identity_mapper/sub.rb
aserto-0.0.6 lib/aserto/identity_mapper/sub.rb
aserto-0.0.5 lib/aserto/identity_mapper/sub.rb
aserto-0.0.4 lib/aserto/identity_mapper/sub.rb
aserto-0.0.3 lib/aserto/identity_mapper/sub.rb
aserto-0.0.2 lib/aserto/identity_mapper/sub.rb
aserto-0.0.1 lib/aserto/identity_mapper/sub.rb