Module: Async::Caldav::TestStub

Defined in:
lib/async/caldav/forward_auth.rb

Class Method Summary collapse

Class Method Details

.inject(env, user: 'admin', email: nil, name: nil, groups: nil) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/async/caldav/forward_auth.rb', line 31

def inject(env, user: 'admin', email: nil, name: nil, groups: nil)
  env['HTTP_REMOTE_USER'] ||= user
  if email
    env['HTTP_REMOTE_EMAIL'] ||= email
  end
  if name
    env['HTTP_REMOTE_NAME'] ||= name
  end
  if groups
    env['HTTP_REMOTE_GROUPS'] ||= groups
  end
  env
end