Class: Bosh::Director::Api::ConfigUserManager

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/api/user/config_user_manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(users) ⇒ ConfigUserManager

Returns a new instance of ConfigUserManager.



6
7
8
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 6

def initialize(users)
  @users = users
end

Instance Method Details

#authenticate(username, password) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 14

def authenticate(username, password)
  return false if username.empty? || password.empty?

  user = @users.find { |u| u['name'] == username }
  return false if user.nil?

  user['password'] == password
end

#create_user(_) ⇒ Object

Raises:

  • (NotSupported)


27
28
29
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 27

def create_user(_)
  raise NotSupported
end

#delete_user(_) ⇒ Object

Raises:

  • (NotSupported)


23
24
25
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 23

def delete_user(_)
  raise NotSupported
end

#get_user_from_json(_) ⇒ Object

Raises:

  • (NotSupported)


35
36
37
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 35

def get_user_from_json(_)
  raise NotSupported
end

#supports_api_update?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 10

def supports_api_update?
  false
end

#update_user(_) ⇒ Object

Raises:

  • (NotSupported)


31
32
33
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 31

def update_user(_)
  raise NotSupported
end