Module: Conjur::Rack

Defined in:
lib/conjur/rack/user.rb,
lib/conjur/rack/version.rb,
lib/conjur/rack/path_prefix.rb,
lib/conjur/rack/authenticator.rb

Defined Under Namespace

Classes: Authenticator, PathPrefix, User

Constant Summary collapse

VERSION =
"1.4.0"

Class Method Summary collapse

Class Method Details

.identityObject



13
14
15
# File 'lib/conjur/rack/authenticator.rb', line 13

def self.identity
  Thread.current[:conjur_rack_identity] or raise "No Conjur identity for current request"
end

.identity?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/conjur/rack/authenticator.rb', line 5

def self.identity?
  !Thread.current[:conjur_rack_identity].nil?
end

.privilegeObject



17
18
19
# File 'lib/conjur/rack/authenticator.rb', line 17

def self.privilege
  Thread.current[:conjur_rack_privilege]
end

.remote_ipObject



21
22
23
# File 'lib/conjur/rack/authenticator.rb', line 21

def self.remote_ip
  Thread.current[:conjur_rack_remote_ip]
end

.userObject



9
10
11
# File 'lib/conjur/rack/authenticator.rb', line 9

def self.user
  User.new(identity[0], identity[1], privilege, remote_ip)
end