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 =
"5.0.0"

Class Method Summary collapse

Class Method Details

.conjur_rackObject



7
8
9
# File 'lib/conjur/rack/authenticator.rb', line 7

def conjur_rack
  Thread.current[:conjur_rack] ||= {}
end

.identityObject



24
25
26
# File 'lib/conjur/rack/authenticator.rb', line 24

def identity
  conjur_rack[:identity] or raise "No Conjur identity for current request"
end

.identity?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/conjur/rack/authenticator.rb', line 11

def identity?
  !conjur_rack[:identity].nil?
end

.userObject



15
16
17
18
19
20
21
22
# File 'lib/conjur/rack/authenticator.rb', line 15

def user
  User.new(identity[0], identity[1], 
    :privilege => privilege, 
    :remote_ip => remote_ip, 
    :audit_roles => audit_roles, 
    :audit_resources => audit_resources
    )
end