Class: KStor::Controller::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/kstor/controller/secret.rb

Overview

Handle secret-related requests.

Instance Method Summary collapse

Constructor Details

#initialize(store) ⇒ Secret

Returns a new instance of Secret.



16
17
18
# File 'lib/kstor/controller/secret.rb', line 16

def initialize(store)
  @store = store
end

Instance Method Details

#handle_request(user, req) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/kstor/controller/secret.rb', line 20

def handle_request(user, req)
  case req.type
  when 'secret-create' then handle_create(user, req)
  when 'secret-search' then handle_search(user, req)
  when 'secret-unlock' then handle_unlock(user, req)
  when 'secret-update-meta' then handle_update_meta(user, req)
  when 'secret-update-value' then handle_update_value(user, req)
  when 'secret-delete' then handle_delete(user, req)
  else
    raise Error.for_code('REQ/UNKNOWN', req.type)
  end
end