Class: Bosh::Director::Api::ConfigUserManager
- Defined in:
- lib/bosh/director/api/user/config_user_manager.rb
Instance Method Summary collapse
- #authenticate(username, password) ⇒ Object
- #create_user(_) ⇒ Object
- #delete_user(_) ⇒ Object
- #get_user_from_json(_) ⇒ Object
-
#initialize(users) ⇒ ConfigUserManager
constructor
A new instance of ConfigUserManager.
- #supports_api_update? ⇒ Boolean
- #update_user(_) ⇒ Object
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
27 28 29 |
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 27 def create_user(_) raise NotSupported end |
#delete_user(_) ⇒ Object
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
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
10 11 12 |
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 10 def supports_api_update? false end |
#update_user(_) ⇒ Object
31 32 33 |
# File 'lib/bosh/director/api/user/config_user_manager.rb', line 31 def update_user(_) raise NotSupported end |