Method: Reedb::Vault.access_headers

Defined in:
lib/reedb.rb

.access_headers(uuid, token, search = nil) ⇒ Object

List headers from a vault with a search qeury (nil by default). Can only be used with a token on vaults that authentication has been successful before.

Parameters:

  • uuid (String)

    UUID of a vault (as an ID)

  • token (String)

    Authentication token for access

  • search (String) (defaults to: nil)

    Search qeury as described in the wiki

Raises:



721
722
723
724
725
726
727
728
729
730
731
# File 'lib/reedb.rb', line 721

def access_headers(uuid, token, search = nil)
  token.delete!("\n")

  raise VaultNotAvailableError.new, 'The vault you have requested data from is not currently active on this system.' unless @@active_vaults[uuid]
  raise UnknownTokenError.new, 'The token you provided is unknown to this system. Access denied!' unless @@tokens[token]
  raise UnautherisedTokenError.new, 'The token you provided currently has no access to the desired vault. Access denied!' unless @@tokens[token].include?(uuid)

  debouncer.debounce_vault(uuid)

  return @@active_vaults[uuid].list_headers(search)
end