37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/jungle_path/api/helpers/auth_local_user.rb', line 37
def basic_authentication remote_user, remote_password, no_cache=false
identity, assume_identity = parse_identities(remote_user, remote_password)
puts "identity: #{identity}"
puts "assume_identity: #{assume_identity}"
valid = false
identity = authenticate_identity(identity, no_cache)
if identity.valid
identity.roles = get_roles(identity.key, no_cache)
identity.auth = get_auth(identity.roles, no_cache)
if assume_identity
puts "assume_identity..."
assume_identity = authenticate_assumed_identity(assume_identity, no_cache)
assume_identity.roles = get_roles(assume_identity.key, no_cache)
assume_identity.auth = get_auth(assume_identity.roles, no_cache)
valid = assume_identity.valid
set_current_identity assume_identity, no_cache
else
valid = identity.valid
set_current_identity identity, no_cache
end
else
set_current_identity identity, no_cache
end
valid
end
|