Class: Keycard::Request::CosignAttributes

Inherits:
Attributes
  • Object
show all
Defined in:
lib/keycard/request/cosign_attributes.rb

Overview

This class extracts attributes for Cosign-protected applications. It follows the same basic pattern as for general proxied requests; that is, the pid/eid are the same and there are currently no additional attributes extracted.

Constant Summary

Constants inherited from Attributes

Attributes::IDENTITY_ATTRS

Instance Method Summary collapse

Methods inherited from Attributes

#[], #all, #external, #identity, #identity_keys, #initialize, #supplemental

Constructor Details

This class inherits a constructor from Keycard::Request::Attributes

Instance Method Details

#baseObject



9
10
11
12
13
14
15
# File 'lib/keycard/request/cosign_attributes.rb', line 9

def base
  {
    user_pid:  user_pid,
    user_eid:  user_eid,
    client_ip: client_ip
  }
end

#client_ipObject



25
26
27
# File 'lib/keycard/request/cosign_attributes.rb', line 25

def client_ip
  safe('HTTP_X_FORWARDED_FOR').split(',').first
end

#user_eidObject



21
22
23
# File 'lib/keycard/request/cosign_attributes.rb', line 21

def user_eid
  user_pid
end

#user_pidObject



17
18
19
# File 'lib/keycard/request/cosign_attributes.rb', line 17

def user_pid
  get 'HTTP_X_REMOTE_USER'
end